44 FXText(parent, nullptr, 0, 0, 0, 0, 0, 50),
45 myStyles(new FXHiliteStyle[8]),
46 myErrorRetriever(nullptr),
47 myMessageRetriever(nullptr),
48 myWarningRetriever(nullptr) {
51 const FXColor white = FXRGB(0xff, 0xff, 0xff);
52 const FXColor blue = FXRGB(0x00, 0x00, 0x88);
53 const FXColor green = FXRGB(0x00, 0x88, 0x00);
54 const FXColor red = FXRGB(0x88, 0x00, 0x00);
55 const FXColor yellow = FXRGB(0xe6, 0x98, 0x00);
56 const FXColor fuchsia = FXRGB(0x88, 0x00, 0x88);
82 myStyles[3].normalForeColor = yellow;
83 myStyles[3].selectBackColor = yellow;
84 myStyles[3].hiliteForeColor = yellow;
89 myStyles[7].normalForeColor = fuchsia;
90 myStyles[7].selectBackColor = fuchsia;
91 myStyles[7].hiliteForeColor = fuchsia;
107 const FXint idS =
MAX2(text.rfind(
" '", pos), text.rfind(
"='", pos));
108 const FXint idE = text.find(
"'", pos);
109 if (idS >= 0 && idE >= 0 && idS >= lineS && idE <= lineE) {
110 FXint typeS = text.rfind(
" ", idS - 1);
112 if (text.at(typeS + 1) ==
'(') {
115 std::string type(text.mid(typeS + 1, idS - typeS - 1).lower().text());
116 if (type ==
"tllogic") {
118 }
else if (type ==
"busstop" || type ==
"trainstop") {
120 }
else if (type ==
"containerstop") {
121 type =
"containerStop";
122 }
else if (type ==
"chargingstation") {
123 type =
"chargingStation";
124 }
else if (type ==
"overheadwiresegment") {
125 type =
"overheadWireSegment";
126 }
else if (type ==
"parkingarea") {
127 type =
"parkingArea";
129 const std::string id(text.mid(idS + 2, idE - idS - 2).text());
139 FXText::setCursorPos(pos, notify);
142 std::vector<std::string> viewIDs =
main->getViewIDs();
143 if (viewIDs.empty()) {
147 const FXString text = getText();
149 if (glObj !=
nullptr) {
152 if (getApp()->getKeyState(KEY_Control_L)) {
191 FXString text(msg.c_str());
193 FXint pos = text.find(
"'");
196 if (glObj !=
nullptr) {
198 FXString insText = text.left(pos + 1);
199 FXText::appendStyledText(insText, style + 1);
200 text.erase(0, pos + 1);
201 pos = text.find(
"'");
202 insText = text.left(pos);
203 FXText::appendStyledText(insText, style + 4);
206 pos = text.find(
"'", pos + 1);
210 FXText::appendStyledText(text, style + 1,
true);
211 FXText::setCursorPos(getLength() - 1);
212 FXText::setBottomLine(getLength() - 1);
222 std::string msg =
"----------------------------------------------------------------------------------------\n";
223 FXText::appendStyledText(msg.c_str(), (FXint) msg.length(), 1,
true);
224 FXText::setCursorPos(getLength() - 1);
225 FXText::setBottomLine(getLength() - 1);
235 if (getLength() == 0) {
238 FXText::removeText(0, getLength() - 1,
true);
@ EVENT_GLDEBUG_OCCURRED
send when a gldebug occured
@ EVENT_ERROR_OCCURRED
send when a error occured
@ EVENT_DEBUG_OCCURRED
send when a debug occured
@ EVENT_MESSAGE_OCCURRED
send when a message occured
@ EVENT_WARNING_OCCURRED
send when a warning occured
GUISelectedStorage gSelected
A global holder of selected objects.
int main(int argc, char *argv[])
void setView(GUIGlID id)
Centers the view onto the given artifact.
GUIGlID getGlID() const
Returns the numerical id of the object.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
static GUIMainWindow * getInstance()
get instance
OutputDevice * myGLDebugRetriever
void addSeparator()
Adds a a separator to this log window.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations.
void unregisterMsgHandlers()
unregister message handlers
void clear()
Clears the window.
GUIMessageWindow(FXComposite *parent)
Constructor.
static bool myLocateLinks
whether messages are linked to the GUI elements
FXHiliteStyle * myStyles
The text colors used.
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
virtual void setCursorPos(FXint pos, FXbool notify=FALSE)
set cursor position over a certain line
OutputDevice * myWarningRetriever
OutputDevice * myMessageRetriever
OutputDevice * myDebugRetriever
~GUIMessageWindow()
Destructor.
const GUIGlObject * getActiveStringObject(const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
get active string object
void registerMsgHandlers()
register message handlers
void toggleSelection(GUIGlID id)
Toggles selection of an object.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static MsgHandler * getGLDebugInstance()
Returns the instance to add GLdebug to.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static MsgHandler * getDebugInstance()
Returns the instance to add debug to.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.