55 FXMainWindow(app,
"sumo-gui main window", nullptr, nullptr, DECOR_ALL, 20, 20, 600, 400),
56 myAmFullScreen(false),
58 myGLVisual(new FXGLVisual(app, VISUAL_DOUBLEBUFFER)),
60 myListInternal(false),
62 myListTeleporting(false) {
68 app->getNormalFont()->getFontDesc(fdesc);
69 fdesc.weight = FXFont::Bold;
75 myTopDock =
new FXDockSite(
this, LAYOUT_SIDE_TOP | LAYOUT_FILL_X);
76 myBottomDock =
new FXDockSite(
this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X);
77 myLeftDock =
new FXDockSite(
this, LAYOUT_SIDE_LEFT | LAYOUT_FILL_Y);
78 myRightDock =
new FXDockSite(
this, LAYOUT_SIDE_RIGHT | LAYOUT_FILL_Y);
140std::vector<std::string>
142 std::vector<std::string> ret;
144 ret.push_back(window->getTitle().text());
153 if (std::string(window->getTitle().text()) == id) {
164 if (std::string(window->getTitle().text()) == id) {
183const std::vector<GUIGlChildWindow*>&
192 myMDIClient->forallWindows(
this, FXSEL(SEL_COMMAND, msg),
nullptr);
273 throw ProcessError(
"A GUIMainWindow instance was not yet constructed.");
289 int windowWidth = getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600);
290 int windowHeight = getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400);
292 if (oc.
isSet(
"window-size")) {
293 std::vector<std::string> windowSize = oc.
getStringVector(
"window-size");
294 if (windowSize.size() != 2) {
305 if (oc.
isSet(
"window-size") || getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 0 || oc.
isSet(
"window-pos")) {
307 int x =
MAX2(0,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150), getApp()->getRootWindow()->getWidth() - windowWidth));
308 int y =
MAX2(50,
MIN2(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150), getApp()->getRootWindow()->getHeight() - windowHeight));
309 if (oc.
isSet(
"window-pos")) {
311 if (windowPos.size() != 2) {
323 resize(windowWidth, windowHeight);
330 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
331 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
332 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
333 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
370 switch (FXSELID(sel)) {
377 lang =
TL(
"spanish");
385 lang =
TL(
"italian");
389 lang =
TL(
"simplified chinese");
393 lang =
TL(
"traditional chinese");
397 lang =
TL(
"turkish");
401 lang =
TL(
"hungarian");
405 lang =
TL(
"english");
415 const std::string header =
TL(
"Restart needed");
416 const std::string body =
TL(
"Changing display language needs restart to take effect.") + std::string(
"\n") +
419 TL(
"For the Debug build you might also need to set the LANG environment variable.") + std::string(
"\n") +
422 TL(
"Under development. You can help to improve the translation at:") + std::string(
"\n") +
423 "https://hosted.weblate.org/projects/eclipse-sumo/";
424 FXMessageBox::information(getApp(), MBOX_OK, header.c_str(),
"%s", body.c_str());
426 std::string appKey = getApp()->reg().getAppKey().text();
427 if (appKey ==
"SUMO GUI") {
429 getApp()->reg().writeStringEntry(
"gui",
"language", langID.c_str());
431 FXRegistry reg(
"SUMO GUI",
"sumo-gui");
433 reg.writeStringEntry(
"gui",
"language", langID.c_str());
444 FXMenuCommand* menuCommand =
dynamic_cast<FXMenuCommand*
>(obj);
448 menuCommand->setTextColor(FXRGB(0, 0, 255));
450 menuCommand->setTextColor(FXRGB(0, 0, 255));
452 menuCommand->setTextColor(FXRGB(0, 0, 255));
454 menuCommand->setTextColor(FXRGB(0, 0, 255));
456 menuCommand->setTextColor(FXRGB(0, 0, 255));
458 menuCommand->setTextColor(FXRGB(0, 0, 255));
460 menuCommand->setTextColor(FXRGB(0, 0, 255));
462 menuCommand->setTextColor(FXRGB(0, 0, 255));
464 menuCommand->setTextColor(FXRGB(0, 0, 255));
466 menuCommand->setTextColor(FXRGB(0, 0, 0));
@ MID_LANGUAGE_TR
change language to turkish
@ MID_LANGUAGE_ZHT
change language to chinese (traditional)
@ MID_LANGUAGE_ES
change language to spanish
@ MID_LANGUAGE_HU
change language to hungarian
@ MID_LANGUAGE_IT
change language to italian
@ MID_LANGUAGE_EN
change language to english
@ MID_LANGUAGE_DE
change language to german
@ MID_LANGUAGE_ZH
change language to chinese (simplified)
@ MID_LANGUAGE_FR
change language to french
@ LANGUAGE_EN
icons for languages
#define WRITE_MESSAGE(msg)
std::string gLanguage
the language for GUI elements and messages
int GUIDesignHeight
the default size for GUI elements
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
static FXMenuCommand * buildFXMenuCommandShortcut(FXComposite *p, const std::string &text, const std::string &shortcut, const std::string &info, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
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
FXMenuPane * myLanguageMenu
Language menu common to all applications.
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
void buildLanguageMenu(FXMenuBar *menuBar)
long onCmdChangeLanguage(FXObject *, FXSelector, void *)
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
FXHorizontalFrame * myTestFrame
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
FXHorizontalFrame * getTestFrame()
get test frame
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
long onUpdChangeLanguage(FXObject *, FXSelector, void *)
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,...