54 FXMainWindow(app,
"sumo-gui main window", nullptr, nullptr, DECOR_ALL, 20, 20, 600, 400),
55 myAmFullScreen(false),
57 myGLVisual(new FXGLVisual(app, VISUAL_DOUBLEBUFFER)),
59 myListInternal(false),
61 myListTeleporting(false) {
67 app->getNormalFont()->getFontDesc(fdesc);
68 fdesc.weight = FXFont::Bold;
73 myTopDock =
new FXDockSite(
this, LAYOUT_SIDE_TOP | LAYOUT_FILL_X);
74 myBottomDock =
new FXDockSite(
this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X);
75 myLeftDock =
new FXDockSite(
this, LAYOUT_SIDE_LEFT | LAYOUT_FILL_Y);
76 myRightDock =
new FXDockSite(
this, LAYOUT_SIDE_RIGHT | LAYOUT_FILL_Y);
137std::vector<std::string>
139 std::vector<std::string> ret;
141 ret.push_back(window->getTitle().text());
150 if (std::string(window->getTitle().text()) ==
id) {
161 if (std::string(window->getTitle().text()) ==
id) {
180const std::vector<GUIGlChildWindow*>&
189 myMDIClient->forallWindows(
this, FXSEL(SEL_COMMAND, msg),
nullptr);
264 throw ProcessError(
"A GUIMainWindow instance was not yet constructed.");
280 int windowWidth = getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600);
281 int windowHeight = getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400);
283 if (oc.
isSet(
"window-size")) {
284 std::vector<std::string> windowSize = oc.
getStringVector(
"window-size");
285 if (windowSize.size() != 2) {
296 if (oc.
isSet(
"window-size") || getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 0 || oc.
isSet(
"window-pos")) {
298 int x =
MAX2(0,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150), getApp()->getRootWindow()->getWidth() - windowWidth));
299 int y =
MAX2(50,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150), getApp()->getRootWindow()->getHeight() - windowHeight));
300 if (oc.
isSet(
"window-pos")) {
302 if (windowPos.size() != 2) {
314 resize(windowWidth, windowHeight);
321 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
322 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
323 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
324 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
const std::vector< GUIGlChildWindow * > & getViews() const
get views
bool myListParking
information whether the locator should list parking vehicles
static GUIMainWindow * myInstance
the singleton window instance
virtual ~GUIMainWindow()
destructor
void removeViewByID(const std::string &id)
GUIGlChildWindow * getViewByID(const std::string &id) const
get specific view by ID
std::vector< FXMainWindow * > myTrackerWindows
list of tracker windows
MFXStaticToolTip * getStaticTooltipView() const
get static toolTip for view
FXFont * myFallbackFont
Fallback font for extended characters support.
std::vector< std::string > getViewIDs() const
get view IDs
GUISUMOAbstractView * getActiveView() const
get the active view or 0
FXLabel * getGeoLabel()
get geo label
bool isGaming() const
return whether the gui is in gaming mode
bool myListTeleporting
information whether the locator should list teleporting vehicles
FXLabel * myCartesianCoordinate
Labels for the current cartesian, geo-coordinate and test coordinates.
MFXStaticToolTip * myStaticTooltipMenu
static toolTip used in menus
FXMDIClient * myMDIClient
The multi view panel.
FXFont * getBoldFont()
get bold front
bool listTeleporting() const
return whether to list teleporting vehicles
FXLabel * getTestLabel()
get test label
MFXStaticToolTip * myStaticTooltipView
static toolTip used in view
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
FXFont * myBoldFont
Font used for popup-menu titles.
static GUIMainWindow * getInstance()
get instance
bool listParking() const
return whether to list parking vehicles
FXDockSite * myBottomDock
bool listInternal() const
return whether to list internal structures
void addGLChild(GUIGlChildWindow *child)
Adds a further child window to the list (GUIGlChildWindow)
FXLabel * myTestCoordinate
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
FXDockSite * myTopDock
dock sites
bool myListInternal
information whether the locator should list internal structures
void storeWindowSizeAndPos()
record window position and size in registry
FXLabel * getCartesianLabel()
get cartesian label
FXGLVisual * getGLVisual() const
get GL Visual
bool myAmFullScreen
FOX need this.
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list (GUIGlChildWindow)
FXDockSite * getTopDock()
get top dock
FXLabel * myGeoCoordinate
FXFont * getFallbackFont()
get fallback front
void updateChildren(int msg=MID_SIMSTEP)
update childrens
FXGLVisual * myGLVisual
The gl-visual used.
bool myAmGaming
information whether the gui is currently in gaming mode
void removeChild(FXMainWindow *child)
removes the given child window from the list (FXMainWindow)
GUIMainWindow(FXApp *app)
constructor
std::vector< GUIGlChildWindow * > myGLWindows
list of GLWindows
void addChild(FXMainWindow *child)
Adds a further child window to the list (FXMainWindow)
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static OptionsCont & getOptions()
Retrieves the options.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...