58 FXMainWindow(a,
"SUMO-gui main window", NULL, NULL, DECOR_ALL, 20, 20, 600, 400),
59 myAmFullScreen(false),
60 myGLVisual(new FXGLVisual(a, VISUAL_DOUBLEBUFFER)),
62 myListInternal(false),
64 myListTeleporting(false) {
67 getApp()->getNormalFont()->getFontDesc(fdesc);
68 fdesc.weight = FXFont::Bold;
71 myTopDock =
new FXDockSite(
this, LAYOUT_SIDE_TOP | LAYOUT_FILL_X);
72 myBottomDock =
new FXDockSite(
this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X);
73 myLeftDock =
new FXDockSite(
this, LAYOUT_SIDE_LEFT | LAYOUT_FILL_Y);
74 myRightDock =
new FXDockSite(
this, LAYOUT_SIDE_RIGHT | LAYOUT_FILL_Y);
125 std::vector<std::string>
127 std::vector<std::string> ret;
129 ret.push_back((*i)->getTitle().text());
138 if (std::string((*i)->getTitle().text()) ==
id) {
188 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
211 WRITE_ERROR(
"option window-size requires INT,INT");
217 if (oc.
isSet(
"window-size") || getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 0 || oc.
isSet(
"window-pos")) {
219 int x =
MAX2(0,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150), getApp()->getRootWindow()->getWidth() - windowWidth));
220 int y =
MAX2(50,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150), getApp()->getRootWindow()->getHeight() - windowHeight));
221 if (oc.
isSet(
"window-pos")) {
223 if (windowPos.size() != 2
234 resize(windowWidth, windowHeight);
241 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
242 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
243 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
244 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
static bool _str2int(const std::string &data)
check if a String can be parsed into a int check overflows
GUISUMOAbstractView * getView() const
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.
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.
std::vector< FXMDIChild * > mySubWindows
GUISUMOAbstractView * getActiveView() const
get the active view or 0
void addChild(FXMDIChild *child, bool updateOnSimStep=true)
Adds a further child window to the list.
static GUIMainWindow * getInstance()
static int _str2int(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
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 removeChild(FXMDIChild *child)
removes the given child window from the list
void unlock()
release mutex lock
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
FXDockSite * myBottomDock
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
FXMDIChild * getViewByID(const std::string &id) const
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
void storeWindowSizeAndPos()
record window position and size in registry