52 FXText(parent, 0, 0, 0, 0, 0, 0, 50),
53 myStyles(new FXHiliteStyle[7]),
55 myMessageRetriever(0),
56 myWarningRetriever(0) {
59 const FXColor white = FXRGB(0xff, 0xff, 0xff);
60 const FXColor blue = FXRGB(0x00, 0x00, 0x88);
61 const FXColor green = FXRGB(0x00, 0x88, 0x00);
62 const FXColor red = FXRGB(0x88, 0x00, 0x00);
63 const FXColor yellow = FXRGB(0xe6, 0x98, 0x00);
89 myStyles[3].normalForeColor = yellow;
90 myStyles[3].selectBackColor = yellow;
91 myStyles[3].hiliteForeColor = yellow;
109 const FXint idS =
MAX2(text.rfind(
" '", pos), text.rfind(
"='", pos));
110 const FXint idE = text.find(
"'", pos);
111 if (idS >= 0 && idE >= 0 && idS >= lineS && idE <= lineE) {
112 const FXint typeS = text.rfind(
" ", idS - 1);
114 std::string type(text.mid(typeS + 1, idS - typeS - 1).lower().text());
115 if (type ==
"tllogic") {
117 }
else if (type ==
"busstop") {
119 }
else if (type ==
"containerstop") {
120 type =
"containerStop";
121 }
else if (type ==
"chargingstation") {
122 type =
"chargingStation";
123 }
else if (type ==
"parkingarea") {
124 type =
"parkingArea";
126 const std::string id(text.mid(idS + 2, idE - idS - 2).text());
136 FXText::setCursorPos(pos, notify);
139 std::vector<std::string> viewIDs = main->
getViewIDs();
140 if (viewIDs.empty()) {
144 const FXString text = getText();
149 if (getApp()->getKeyState(KEY_Control_L)) {
180 FXString text(msg.c_str());
182 FXint pos = text.find(
"'");
187 FXString insText = text.left(pos + 1);
188 FXText::appendStyledText(insText, style + 1);
189 text.erase(0, pos + 1);
190 pos = text.find(
"'");
191 insText = text.left(pos);
192 FXText::appendStyledText(insText, style + 4);
195 pos = text.find(
"'", pos + 1);
199 FXText::appendStyledText(text, style + 1,
true);
200 FXText::setCursorPos(getLength() - 1);
201 FXText::setBottomLine(getLength() - 1);
211 std::string msg =
"----------------------------------------------------------------------------------------\n";
212 FXText::appendStyledText(msg.c_str(), (FXint) msg.length(), 1,
true);
213 FXText::setCursorPos(getLength() - 1);
214 FXText::setBottomLine(getLength() - 1);
224 if (getLength() == 0) {
227 FXText::removeText(0, getLength() - 1,
true);
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
send when a message occured
void toggleSelection(GUIGlID id)
Toggles selection of an object.
void registerMsgHandlers()
register and unregister message handlers
void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
void unregisterMsgHandlers()
~GUIMessageWindow()
Destructor.
std::vector< std::string > getViewIDs() const
void addSeparator()
Adds a a separator to this log window.
FXHiliteStyle * myStyles
The text colors used.
virtual void setCursorPos(FXint pos, FXbool notify=FALSE)
static GUIMainWindow * getInstance()
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
GUIMessageWindow(FXComposite *parent)
Constructor.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
send when a error occured
OutputDevice * myMessageRetriever
void setView(GUIGlID id)
Centers the view onto the given artifact.
FXMDIChild * getViewByID(const std::string &id) const
static bool myLocateLinks
whether messages are linked to the GUI elements
send when a warning occured
GUIGlID getGlID() const
Returns the numerical id of the object.
const GUIGlObject * getActiveStringObject(const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
void unblockObject(GUIGlID id)
Marks an object as unblocked.
void clear()
Clears the window.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations.
GUISelectedStorage gSelected
A global holder of selected objects.
OutputDevice * myWarningRetriever
int main(int argc, char *argv[])