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 /****************************************************************************/
8 // A logging window for the gui
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GUIMessageWindow_h
22 #define GUIMessageWindow_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <fx.h>
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
55 class GUIMessageWindow : public FXText {
56 public:
61  GUIMessageWindow(FXComposite* parent);
62 
63 
66 
67 
69  void addSeparator();
70 
71 
80  void appendText(GUIEventType eType, const std::string& msg);
81 
82 
84  void clear();
85 
87  void registerMsgHandlers();
88  void unregisterMsgHandlers();
89 
90 
91 private:
92  class MsgOutputDevice : public OutputDevice {
93  public:
95  myMsgWindow(msgWindow),
96  myType(type) { }
97 
99 
100  protected:
101  std::ostream& getOStream() {
102  return myStream;
103  }
104  void postWriteHook() {
106  myStream.str("");
107  }
108 
109  private:
111  std::ostringstream myStream;
113  };
114 
115 
116 private:
118  FXHiliteStyle* myStyles;
119 
122 
123 
124 
125 };
126 
127 
128 #endif
129 
130 /****************************************************************************/
131