SUMO - Simulation of Urban MObility
GUIDialog_AppSettings.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 // The application-settings dialog
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
36 #include <gui/GUIGlobals.h>
37 #include "GUIDialog_AppSettings.h"
38 
39 #ifdef CHECK_MEMORY_LEAKS
40 #include <foreign/nvwa/debug_new.h>
41 #endif // CHECK_MEMORY_LEAKS
42 
43 
44 // ===========================================================================
45 // FOX callback mapping
46 // ===========================================================================
47 FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[] = {
51  FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_AppSettings::onCmdOk),
53 };
54 
55 FXIMPLEMENT(GUIDialog_AppSettings, FXDialogBox, GUIDialog_AppSettingsMap, ARRAYNUMBER(GUIDialog_AppSettingsMap))
56 
57 
58 // ===========================================================================
59 // method definitions
60 // ===========================================================================
62  : FXDialogBox(parent, "Application Settings"),
63  myAppQuitOnEnd(GUIGlobals::gQuitOnEnd),
64  myAllowTextures(GUITexturesHelper::texturesAllowed()),
65  myLocateLinks(GUIMessageWindow::locateLinksEnabled()) {
66  FXCheckButton* b = 0;
67  FXVerticalFrame* f1 = new FXVerticalFrame(this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0);
68  b = new FXCheckButton(f1, "Quit on Simulation End", this , MID_QUITONSIMEND);
69  b->setCheck(myAppQuitOnEnd);
70  b = new FXCheckButton(f1, "Locate elements when clicking on messages", this , MID_LOCATELINKS);
71  b->setCheck(myLocateLinks);
72  new FXHorizontalSeparator(f1, SEPARATOR_GROOVE | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X);
73  b = new FXCheckButton(f1, "Allow Textures", this , MID_ALLOWTEXTURES);
74  b->setCheck(myAllowTextures);
75  FXHorizontalFrame* f2 = new FXHorizontalFrame(f1, LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 5, 5);
76  FXButton* initial = new FXButton(f2, "&OK", NULL, 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);
77  new FXButton(f2, "&Cancel", NULL, 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);
78  initial->setFocus();
80 }
81 
82 
84 
85 
86 long
87 GUIDialog_AppSettings::onCmdOk(FXObject*, FXSelector, void*) {
91  destroy();
92  return 1;
93 }
94 
95 
96 long
97 GUIDialog_AppSettings::onCmdCancel(FXObject*, FXSelector, void*) {
98  destroy();
99  return 1;
100 }
101 
102 
103 long
104 GUIDialog_AppSettings::onCmdQuitOnEnd(FXObject*, FXSelector, void*) {
106  return 1;
107 }
108 
109 
110 long
111 GUIDialog_AppSettings::onCmdAllowTextures(FXObject*, FXSelector, void*) {
113  return 1;
114 }
115 
116 
117 long
118 GUIDialog_AppSettings::onCmdLocateLinks(FXObject*, FXSelector, void*) {
120  return 1;
121 }
122 
123 
124 /****************************************************************************/
long onCmdQuitOnEnd(FXObject *, FXSelector, void *)
Called on "Quit on end"-button change.
bool myAllowTextures
Information whether textures may be used.
long onCmdOk(FXObject *, FXSelector, void *)
Called on OK-button pressure.
Allow textures - Option.
Definition: GUIAppEnum.h:299
Locate links in messages - Option.
Definition: GUIAppEnum.h:301
long onCmdLocateLinks(FXObject *, FXSelector, void *)
Called on "Locate links in messages"-button change.
long onCmdCancel(FXObject *, FXSelector, void *)
Called on Cancel-button pressure.
Close simulation at end - Option.
Definition: GUIAppEnum.h:297
FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[]
long onCmdAllowTextures(FXObject *, FXSelector, void *)
Called on "Allow textures"-button change.
Cancel-button was pushed.
Definition: GUIAppEnum.h:289
Ok-button was pushed.
Definition: GUIAppEnum.h:287
The dialog to change the application (gui) settings.
bool myAppQuitOnEnd
Information whether the application shall be quit.
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
Definition: GUIGlobals.h:55
static void enableLocateLinks(const bool val)
switch locate links on and off
Global storage for textures; manages and draws them.
static void allowTextures(const bool val)
switch texture drawing on and off
bool myLocateLinks
Information whether locate links appear in messages.
A logging window for the gui.
static FXIcon * getIcon(GUIIcon which)