Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEOptionsDialog.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A Dialog for setting options (see OptionsCont)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <set>
28
30
31// ===========================================================================
32// class declaration
33// ===========================================================================
34
36class OptionsCont;
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
45class GNEOptionsDialog : public FXDialogBox {
47 FXDECLARE(GNEOptionsDialog)
48
49
51
52public:
62 static std::pair<int, bool> Options(GNEApplicationWindow* GNEApp, GUIIcon icon, OptionsCont& optionsContainer,
63 const OptionsCont& originalOptionsContainer, const char* titleName);
64
74 static std::pair<int, bool> Run(GNEApplicationWindow* GNEApp, GUIIcon icon, OptionsCont& optionsContainer,
75 const OptionsCont& originalOptionsContainer, const char* titleName);
76
79
81 long onCmdCancel(FXObject*, FXSelector, void*);
82
84 long onCmdReset(FXObject*, FXSelector, void*);
85
87 long onCmdRunNetgenerate(FXObject*, FXSelector, void*);
88
90 long onCmdSelectTopic(FXObject*, FXSelector, void*);
91
93 long onCmdSearch(FXObject*, FXSelector, void*);
94
96 long onCmdShowToolTipsMenu(FXObject*, FXSelector, void*);
97
99 long onCmdSaveOptions(FXObject*, FXSelector, void*);
100
102 long onCmdLoadOptions(FXObject*, FXSelector, void*);
103
105 long onCmdResetDefault(FXObject*, FXSelector, void*);
106
107protected:
110
113
116
119
121 bool myOptionsModified = false;
122
123private:
126
128 FXTreeList* myTopicsTreeList = nullptr;
129
131 FXTreeItem* myRootItem = nullptr;
132
134 FXVerticalFrame* myEntriesFrame = nullptr;
135
138
141
143 std::map<FXTreeItem*, std::string> myTreeItemTopics;
144
147
149 const std::set<std::string> myIgnoredTopics = {"Configuration"};
150
152 const std::set<std::string> myIgnoredEntries = {"geometry.remove", "edges.join", "geometry.split", "ramps.guess", "ramps.set"};
153
156
158 void updateVisibleEntriesBySearch(std::string searchText);
159
161 bool loadConfiguration(const std::string& file);
162
172 GNEOptionsDialog(GNEApplicationWindow* GNEApp, GUIIcon icon, OptionsCont& optionsContainer,
173 const OptionsCont& originalOptionsContainer, const char* titleName, const bool runDialog);
174
177
180};
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
The main window of Netedit.
long onCmdSaveOptions(FXObject *, FXSelector, void *)
save options
FXTreeItem * myRootItem
root item
FXTreeList * myTopicsTreeList
Topics elements tree.
void updateVisibleEntriesBySearch(std::string searchText)
update visible entries by search
GNEOptionsDialog & operator=(const GNEOptionsDialog &)=delete
Invalidated assignment operator.
MFXCheckableButton * myShowToolTipsMenu
checkable button for show toolTips
long onCmdCancel(FXObject *, FXSelector, void *)
called when user press cancel button
const std::set< std::string > myIgnoredEntries
ignores entries
const OptionsCont & myOriginalOptionsContainer
reference to original Option container
long onCmdSelectTopic(FXObject *, FXSelector, void *)
called when user select a topic in the list
std::vector< GNEOptionsDialogElements::InputOption * > myInputOptionEntries
Input option entries.
const std::set< std::string > myIgnoredTopics
ignores topics
long onCmdReset(FXObject *, FXSelector, void *)
called when user press reset button
std::map< FXTreeItem *, std::string > myTreeItemTopics
map with topics and their associated FXTreeItem
GNEApplicationWindow * myGNEApp
pointer to main window parent
MFXTextFieldSearch * mySearchButton
search button
static std::pair< int, bool > Run(GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
Constructor for run dialogs.
bool loadConfiguration(const std::string &file)
load configuration
static std::pair< int, bool > Options(GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
Constructor for options dialogs.
GNEOptionsDialog(const GNEOptionsDialog &)=delete
Invalidated copy constructor.
OptionsCont & myOptionsContainer
reference to edited Option container
FXVerticalFrame * myEntriesFrame
vertical frame for entries
MFXCheckButtonTooltip * myDescriptionSearchCheckButton
checkbox for enable/disable search by description
long onCmdShowToolTipsMenu(FXObject *, FXSelector, void *)
enable/disable show toolTip
long onCmdResetDefault(FXObject *, FXSelector, void *)
reset default
long onCmdSearch(FXObject *, FXSelector, void *)
called when user searches
long onCmdLoadOptions(FXObject *, FXSelector, void *)
load options
bool myOptionsModified
flag for check if options was modified
bool updateVisibleEntriesByTopic()
update visible entries by selected topic
GNEOptionsDialog()
FOX needs this.
long onCmdRunNetgenerate(FXObject *, FXSelector, void *)
called when user press reset button
FXTextFieldIcon (based on FXTextFieldIcon)
A storage for options typed value containers)
Definition OptionsCont.h:89
Definition json.hpp:4471
every row value