56 FXMainWindow(a,
"SUMO-gui main window", nullptr, nullptr, DECOR_ALL, 20, 20, 600, 400),
57 myAmFullScreen(false),
59 myGLVisual(new FXGLVisual(a, VISUAL_DOUBLEBUFFER)),
61 myListInternal(false),
63 myListTeleporting(false) {
66 getApp()->getNormalFont()->getFontDesc(fdesc);
67 fdesc.weight = FXFont::Bold;
70 myTopDock =
new FXDockSite(
this, LAYOUT_SIDE_TOP | LAYOUT_FILL_X);
71 myBottomDock =
new FXDockSite(
this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X);
72 myLeftDock =
new FXDockSite(
this, LAYOUT_SIDE_LEFT | LAYOUT_FILL_Y);
73 myRightDock =
new FXDockSite(
this, LAYOUT_SIDE_RIGHT | LAYOUT_FILL_Y);
124 std::vector<std::string>
126 std::vector<std::string> ret;
128 ret.push_back(window->getTitle().text());
137 if (std::string(window->getTitle().text()) ==
id) {
187 throw ProcessError(
"A GUIMainWindow instance was not yet constructed.");
203 int windowWidth = getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600);
204 int windowHeight = getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400);
206 if (oc.
isSet(
"window-size")) {
207 std::vector<std::string> windowSize = oc.
getStringVector(
"window-size");
208 if (windowSize.size() != 2) {
209 WRITE_ERROR(
"option window-size requires INT,INT");
219 if (oc.
isSet(
"window-size") || getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 0 || oc.
isSet(
"window-pos")) {
221 int x =
MAX2(0,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150), getApp()->getRootWindow()->getWidth() - windowWidth));
222 int y =
MAX2(50,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150), getApp()->getRootWindow()->getHeight() - windowHeight));
223 if (oc.
isSet(
"window-pos")) {
225 if (windowPos.size() != 2) {
237 resize(windowWidth, windowHeight);
244 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
245 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
246 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
247 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
FXGLVisual * getGLVisual() const
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call ...
FXFont * myBoldFont
Font used for popup-menu titles.
FXGLVisual * myGLVisual
The gl-visual used.
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
std::vector< std::string > getViewIDs() const
static OptionsCont & getOptions()
Retrieves the options.
FXLabel & getCartesianLabel()
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
GUISUMOAbstractView * getActiveView() const
get the active view or 0
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static GUIMainWindow * getInstance()
static GUIMainWindow * myInstance
the singleton window instance
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
void addGLChild(GUIGlChildWindow *child)
Adds a further child window to the list.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
std::vector< GUIGlChildWindow * > myGLWindows
void removeChild(FXMainWindow *child)
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
FXDockSite * myBottomDock
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
A Simulation step was performed.
A storage for options typed value containers)
FXMDIClient * myMDIClient
The multi view panel.
bool myAmFullScreen
whether to show the window in full screen mode
GUIGlChildWindow * getViewByID(const std::string &id) const
void addChild(FXMainWindow *child)
void storeWindowSizeAndPos()
record window position and size in registry
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list