46 FXIMPLEMENT(
GUIDialog_AppSettings, FXDialogBox, GUIDialog_AppSettingsMap, ARRAYNUMBER(GUIDialog_AppSettingsMap))
53 : FXDialogBox(parent,
TL("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);
76 const auto& onlineMaps = parent->getOnlineMaps();
77 const int numRows = (int)onlineMaps.size() + 1;
78 myTable->setVisibleRows(numRows);
79 myTable->setVisibleColumns(2);
80 myTable->setTableSize(numRows, 2);
81 myTable->setBackColor(FXRGB(255, 255, 255));
82 myTable->getRowHeader()->setWidth(0);
83 myTable->setTableSize(numRows, 2);
84 myTable->setColumnText(0,
"Name");
85 myTable->setColumnText(1,
"URL");
86 FXHeader* header = myTable->getColumnHeader();
88 header->setItemSize(0, 60);
89 header->setItemSize(1, 275);
91 for (
const auto& item : onlineMaps) {
92 myTable->setItemText(row, 0, item.first.c_str());
93 myTable->setItemText(row, 1, item.second.c_str());
97 new FXHorizontalSeparator(f1, SEPARATOR_GROOVE | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X);
99 b->setCheck(myAllowTextures);
100 FXHorizontalFrame* f2 =
new FXHorizontalFrame(f1, LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 5, 5);
101 FXButton* initial =
GUIDesigns::buildFXButton(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);
102 GUIDesigns::buildFXButton(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);
121 for (
int r = 0; r <
myTable->getNumRows(); r++) {
122 if (
myTable->getItem(r, 0) !=
nullptr &&
myTable->getItem(r, 1) !=
nullptr) {
127 maps +=
myTable->getItem(r, 0)->getText() +
"\t" +
myTable->getItem(r, 1)->getText();
130 getApp()->reg().writeStringEntry(
"gui",
"onlineMaps", maps.text());
144 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 GUIDesignViewSettingsSpinDial2
#define GUIDesignViewSettingsLabel1
Label.
#define GUIDesignBreakpointTable
design for Breakpoint table
FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[]
int GUIDesignHeight
the default size for GUI elements
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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
FOX needs this.
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