40 #ifdef CHECK_MEMORY_LEAKS
42 #endif // CHECK_MEMORY_LEAKS
55 FXText(parent, 0, 0, 0, 0, 0, 0, 50),
56 myStyles(
new FXHiliteStyle[7]),
58 myMessageRetriever(0),
59 myWarningRetriever(0) {
62 const FXColor white = FXRGB(0xff, 0xff, 0xff);
63 const FXColor blue = FXRGB(0x00, 0x00, 0x88);
64 const FXColor green = FXRGB(0x00, 0x88, 0x00);
65 const FXColor red = FXRGB(0x88, 0x00, 0x00);
66 const FXColor yellow = FXRGB(0xe6, 0x98, 0x00);
92 myStyles[3].normalForeColor = yellow;
93 myStyles[3].selectBackColor = yellow;
94 myStyles[3].hiliteForeColor = yellow;
112 const FXint idS =
MAX2(text.rfind(
" '", pos), text.rfind(
"='", pos));
113 const FXint idE = text.find(
"'", pos);
114 if (idS >= 0 && idE >= 0 && idS >= lineS && idE <= lineE) {
115 const FXint typeS = text.rfind(
" ", idS - 1);
117 std::string type(text.mid(typeS + 1, idS - typeS - 1).lower().text());
118 if (type ==
"tllogic") {
121 const std::string id(text.mid(idS + 2, idE - idS - 2).text());
131 FXText::setCursorPos(pos, notify);
134 std::vector<std::string> viewIDs = main->
getViewIDs();
135 if (viewIDs.empty()) {
139 const FXString text = getText();
172 FXString text(msg.c_str());
174 FXint pos = text.find(
"'");
179 FXString insText = text.left(pos + 1);
180 FXText::appendStyledText(insText, style + 1);
181 text.erase(0, pos + 1);
182 pos = text.find(
"'");
183 insText = text.left(pos);
184 FXText::appendStyledText(insText, style + 4);
187 pos = text.find(
"'", pos + 1);
191 FXText::appendStyledText(text, style + 1,
true);
192 FXText::setCursorPos(getLength() - 1);
193 FXText::setBottomLine(getLength() - 1);
203 std::string msg =
"----------------------------------------------------------------------------------------\n";
204 FXText::appendStyledText(msg.c_str(), (FXint) msg.length(), 1,
true);
205 FXText::setCursorPos(getLength() - 1);
206 FXText::setBottomLine(getLength() - 1);
216 if (getLength() == 0) {
219 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 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.
GUIGlID getGlID() const
Returns the numerical id of the object.
void addSeparator()
Adds a a separator to this log window.
FXMDIChild * getViewByID(const std::string &id) const
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.
static bool myLocateLinks
whether messages are linked to the GUI elements
const GUIGlObject * getActiveStringObject(const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
send when a warning occured
void unblockObject(GUIGlID id)
Marks an object as unblocked.
void clear()
Clears the window.
std::vector< std::string > getViewIDs() const
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations.
OutputDevice * myWarningRetriever
int main(int argc, char *argv[])