46 FXText(parent, nullptr, 0, 0, 0, 0, 0, 50),
47 myStyles(new FXHiliteStyle[8]),
48 myErrorRetriever(nullptr),
49 myMessageRetriever(nullptr),
50 myWarningRetriever(nullptr) {
53 const FXColor white = FXRGB(0xff, 0xff, 0xff);
54 const FXColor blue = FXRGB(0x00, 0x00, 0x88);
55 const FXColor green = FXRGB(0x00, 0x88, 0x00);
56 const FXColor red = FXRGB(0x88, 0x00, 0x00);
57 const FXColor yellow = FXRGB(0xe6, 0x98, 0x00);
58 const FXColor fuchsia = FXRGB(0x88, 0x00, 0x88);
84 myStyles[3].normalForeColor = yellow;
85 myStyles[3].selectBackColor = yellow;
86 myStyles[3].hiliteForeColor = yellow;
91 myStyles[7].normalForeColor = fuchsia;
92 myStyles[7].selectBackColor = fuchsia;
93 myStyles[7].hiliteForeColor = fuchsia;
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" || type ==
"trainstop") {
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();
146 if (glObj !=
nullptr) {
149 if (getApp()->getKeyState(KEY_Control_L)) {
188 FXString text(msg.c_str());
190 FXint pos = text.find(
"'");
193 if (glObj !=
nullptr) {
195 FXString insText = text.left(pos + 1);
196 FXText::appendStyledText(insText, style + 1);
197 text.erase(0, pos + 1);
198 pos = text.find(
"'");
199 insText = text.left(pos);
200 FXText::appendStyledText(insText, style + 4);
203 pos = text.find(
"'", pos + 1);
207 FXText::appendStyledText(text, style + 1,
true);
208 FXText::setCursorPos(getLength() - 1);
209 FXText::setBottomLine(getLength() - 1);
219 std::string msg =
"----------------------------------------------------------------------------------------\n";
220 FXText::appendStyledText(msg.c_str(), (FXint) msg.length(), 1,
true);
221 FXText::setCursorPos(getLength() - 1);
222 FXText::setBottomLine(getLength() - 1);
232 if (getLength() == 0) {
235 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.
send when a warning occured
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
static MsgHandler * getGLDebugInstance()
Returns the instance to add GLdebug to.
OutputDevice * myGLDebugRetriever
void toggleSelection(GUIGlID id)
Toggles selection of an object.
void registerMsgHandlers()
register message handlers
send when a debug occured
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
void unregisterMsgHandlers()
unregister message handlers
~GUIMessageWindow()
Destructor.
std::vector< std::string > getViewIDs() const
void addSeparator()
Adds a a separator to this log window.
OutputDevice * myDebugRetriever
FXHiliteStyle * myStyles
The text colors used.
virtual void setCursorPos(FXint pos, FXbool notify=FALSE)
set cursor position over a certain line
static GUIMainWindow * getInstance()
static MsgHandler * getDebugInstance()
Returns the instance to add debug to.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
virtual 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.
OutputDevice * myMessageRetriever
void setView(GUIGlID id)
Centers the view onto the given artifact.
send when a gldebug occured
send when a message occured
static bool myLocateLinks
whether messages are linked to the GUI elements
send when a error 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
get active string object
GUIGlChildWindow * getViewByID(const std::string &id) 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[])