SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIMessageWindow.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A logging window for the gui
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GUIMessageWindow_h
21 #define GUIMessageWindow_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <fx.h>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
54 class GUIMessageWindow : public FXText {
55 public:
60  GUIMessageWindow(FXComposite* parent);
61 
62 
65 
66 
68  void addSeparator();
69 
70 
79  void appendText(GUIEventType eType, const std::string& msg);
80 
81 
83  void clear();
84 
86  void registerMsgHandlers();
87  void unregisterMsgHandlers();
88 
89 
90 private:
91  class MsgOutputDevice : public OutputDevice {
92  public:
94  myMsgWindow(msgWindow),
95  myType(type) { }
96 
98 
99  protected:
100  std::ostream& getOStream() {
101  return myStream;
102  }
103  void postWriteHook() {
105  myStream.str("");
106  }
107 
108  private:
110  std::ostringstream myStream;
112  };
113 
114 
115 private:
117  FXHiliteStyle* myStyles;
118 
121 
122 
123 
124 };
125 
126 
127 #endif
128 
129 /****************************************************************************/
130