SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIApplicationWindow.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The main window of the SUMO-gui.
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef GUIApplicationWindow_h
24 #define GUIApplicationWindow_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <vector>
38 #include <iostream>
39 #include <fx.h>
48 #include "GUISUMOViewParent.h"
49 
50 
51 // ===========================================================================
52 // class declarations
53 // ===========================================================================
54 class GUILoadThread;
55 class GUIRunThread;
56 class GUIMessageWindow;
57 class GUIEvent;
60 
61 
62 // ===========================================================================
63 // class definition
64 // ===========================================================================
75  // FOX-declarations
76  FXDECLARE(GUIApplicationWindow)
77 public:
78 
83  GUIApplicationWindow(FXApp* a, const std::string& configPattern);
84 
85 
87  virtual ~GUIApplicationWindow();
88 
89 
92 
94  virtual void create();
95 
97  virtual void detach();
99 
100  void loadOnStartup();
101 
102 
103  void dependentBuild(bool game);
104 
105  void setStatusBarText(const std::string&);
106 
107  FXGLCanvas* getBuildGLCanvas() const;
108  SUMOTime getCurrentSimTime() const;
109 
110  FXCursor* getDefaultCursor();
111 
112 
113 
114 
117 
118  virtual void eventOccured();
121  void handleEvent_Message(GUIEvent* e);
124 
125 
126 
129 
131  long onCmdOpenConfiguration(FXObject*, FXSelector, void*);
132 
134  long onCmdOpenNetwork(FXObject*, FXSelector, void*);
135 
137  long onCmdReload(FXObject*, FXSelector, void*);
138 
140  long onCmdOpenRecent(FXObject*, FXSelector, void*);
141 
143  long onCmdClose(FXObject*, FXSelector, void*);
144 
148  long onCmdQuit(FXObject*, FXSelector, void*);
149 
151  long onCmdEditChosen(FXObject*, FXSelector, void*);
152 
154  long onCmdEditBreakpoints(FXObject*, FXSelector, void*);
155 
157  long onCmdAppSettings(FXObject*, FXSelector, void*);
158 
160  long onCmdGaming(FXObject*, FXSelector, void*);
161 
163  long onCmdListInternal(FXObject*, FXSelector, void*);
164 
166  long onCmdAbout(FXObject*, FXSelector, void*);
167 
169  long onCmdStart(FXObject*, FXSelector, void*);
170 
172  long onCmdStop(FXObject*, FXSelector, void*);
173 
175  long onCmdStep(FXObject*, FXSelector, void*);
176 
178  long onCmdNewView(FXObject*, FXSelector, void*);
179 
180 #ifdef HAVE_OSG
181 
182  long onCmdNewOSG(FXObject*, FXSelector, void*);
183 #endif
184 
186  long onUpdOpen(FXObject*, FXSelector, void*);
187 
189  long onUpdReload(FXObject*, FXSelector, void*);
190 
192  long onUpdOpenRecent(FXObject*, FXSelector, void*);
193 
195  long onUpdAddView(FXObject*, FXSelector, void*);
196 
198  virtual long onUpdStart(FXObject*, FXSelector, void*);
199 
201  long onUpdStop(FXObject*, FXSelector, void*);
202 
204  long onUpdStep(FXObject*, FXSelector, void*);
205 
207  long onUpdEditChosen(FXObject* sender, FXSelector, void* ptr);
208 
210  virtual long onUpdEditBreakpoints(FXObject*, FXSelector, void*);
211 
213  long onCmdClearMsgWindow(FXObject*, FXSelector, void*);
214 
216  long onLoadThreadEvent(FXObject*, FXSelector, void*);
217 
219  long onRunThreadEvent(FXObject*, FXSelector, void*);
220 
222  long onClipboardRequest(FXObject* sender, FXSelector sel, void* ptr);
224 
225 protected:
226  virtual void addToWindowsMenu(FXMenuPane*) { }
227 
228 private:
230  void load(const std::string& file, bool isNet, bool isReload = false);
231 
233  void closeAllWindows();
234 
235 
238 
239 protected:
242 
243 protected:
245  virtual void fillMenuBar();
246 
248  virtual void buildToolBars();
249 
250 protected:
252  std::string myName;
253 
256 
259 
262 
264  size_t myViewNumber;
265 
268 
272 
275 
277  FXSplitter* myMainSplitter;
278 
282  *myMenuBarDrag;
283 
286 
288  FXdouble mySimDelay;
289 
292 
294  FXMDIMenu* myMDIMenu;
295 
297  FXMenuBar* myMenuBar;
298 
301 
304 
307 
310 
312  FXRecentFiles myRecentConfigs;
313 
315  FXRecentFiles myRecentNets;
316 
318  std::string myConfigPattern;
319 
321 
322 
323 };
324 
325 
326 #endif
327 
328 /****************************************************************************/
329