46FXIMPLEMENT(
GUIDialog_AppSettings, FXDialogBox, GUIDialog_AppSettingsMap, ARRAYNUMBER(GUIDialog_AppSettingsMap))
53 : FXDialogBox(parent, "Application Settings"),
60 FXCheckButton* b =
nullptr;
61 FXVerticalFrame* f1 =
new FXVerticalFrame(
this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
63 b->setCheck(myAppQuitOnEnd);
64 b =
new FXCheckButton(f1,
TL(
"Autostart Simulation on Load and Reload"),
this,
MID_AUTOSTART);
65 b->setCheck(myAppAutoStart);
66 b =
new FXCheckButton(f1,
TL(
"Reload Simulation after finish (Demo mode)"),
this,
MID_DEMO);
67 b->setCheck(myAppDemo);
68 b =
new FXCheckButton(f1,
TL(
"Locate elements when clicking on messages"),
this,
MID_LOCATELINKS);
69 b->setCheck(myLocateLinks);
71 FXMatrix* m1 =
new FXMatrix(f1, 2, (LAYOUT_FILL_X | LAYOUT_LEFT | MATRIX_BY_COLUMNS), 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
77 const auto& onlineMaps = parent->getOnlineMaps();
78 const int numRows = (int)onlineMaps.size() + 1;
79 myTable->setVisibleRows(numRows);
80 myTable->setVisibleColumns(2);
81 myTable->setTableSize(numRows, 2);
82 myTable->setBackColor(FXRGB(255, 255, 255));
83 myTable->getRowHeader()->setWidth(0);
84 myTable->setTableSize(numRows, 2);
85 myTable->setColumnText(0,
"Name");
86 myTable->setColumnText(1,
"URL");
87 FXHeader* header = myTable->getColumnHeader();
89 header->setItemSize(0, 60);
90 header->setItemSize(1, 275);
92 for (
const auto& item : onlineMaps) {
93 myTable->setItemText(row, 0, item.first.c_str());
94 myTable->setItemText(row, 1, item.second.c_str());
98 new FXHorizontalSeparator(f1, SEPARATOR_GROOVE | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X);
100 b->setCheck(myAllowTextures);
101 FXHorizontalFrame* f2 =
new FXHorizontalFrame(f1, LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 5, 5);
102 FXButton* initial =
new FXButton(f2,
TL(
"&OK"),
nullptr,
this,
MID_SETTINGS_OK, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
103 new FXButton(f2,
TL(
"&Cancel"),
nullptr,
this,
MID_SETTINGS_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
122 for (
int r = 0; r <
myTable->getNumRows(); r++) {
123 if (
myTable->getItem(r, 0) !=
nullptr &&
myTable->getItem(r, 1) !=
nullptr) {
128 maps +=
myTable->getItem(r, 0)->getText() +
"\t" +
myTable->getItem(r, 1)->getText();
131 getApp()->reg().writeStringEntry(
"gui",
"onlineMaps", maps.text());
145 switch (FXSELID(sel)) {
@ MID_ALLOWTEXTURES
Allow textures - Option.
@ MID_AUTOSTART
Start simulation when loaded - Option.
@ MID_QUITONSIMEND
Close simulation at end - Option.
@ MID_LOCATELINKS
Locate links in messages - Option.
@ MID_TIMELINK_BREAKPOINT
Set breakpionts from messages - Option.
@ MID_SETTINGS_OK
Ok-button was pushed.
@ MID_DEMO
Demo mode - Option.
@ MID_SETTINGS_CANCEL
Cancel-button was pushed.
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
#define GUIDesignViewSettingsSpinDial2
#define GUIDesignViewSettingsLabel1
Label.
#define GUIDesignBreakpointTable
design for Breakpoint table
FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[]
The dialog to change the application (gui) settings.
bool myAppDemo
Information whether the simulation restarts after ending (demo mode)
FXTable * myTable
The list that holds the URLs.
bool myAppQuitOnEnd
Information whether the application shall be quit.
long onCmdOk(FXObject *, FXSelector, void *)
Called on OK-button pressure.
bool myAppAutoStart
Information whether the simulation shall start directly after loading.
FXRealSpinner * myBreakPointOffset
Offset when adding breakpoints.
bool myLocateLinks
Information whether locate links appear in messages.
long onCmdSelect(FXObject *, FXSelector sel, void *)
Called on button change.
long onCmdCancel(FXObject *, FXSelector, void *)
Called on Cancel-button pressure.
bool myAllowTextures
Information whether textures may be used.
~GUIDialog_AppSettings()
Destructor.
GUIMainWindow * myParent
The main GUI window.
static bool gRunAfterLoad
the simulation shall start direct after loading
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void addOnlineMap(const std::string &name, const std::string &url)
A logging window for the gui.
static void enableLocateLinks(const bool val)
switch locate links on and off
static void setBreakPointOffset(SUMOTime val)
switch locate links on and off
static SUMOTime getBreakPointOffset()
ask whether locate links is enabled
Global storage for textures; manages and draws them.
static void allowTextures(const bool val)
switch texture drawing on and off