Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEOptionsEditor.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-2025 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 <map>
24#include <set>
25#include <vector>
26
27#include "GNEOptionsEditorRow.h"
28
29// ===========================================================================
30// class declaration
31// ===========================================================================
32
33class GNEDialog;
37class OptionsCont;
38
39// ===========================================================================
40// class definitions
41// ===========================================================================
42
43class GNEOptionsEditor : public FXVerticalFrame {
45 FXDECLARE(GNEOptionsEditor)
46
47
49
50public:
58 GNEOptionsEditor(GNEDialog* dialog, const std::string& titleName, OptionsCont& optionsContainer,
59 const OptionsCont& originalOptionsContainer);
60
63
65 void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
66
68 bool isOptionModified() const;
69
71 void resetAllOptions();
72
75
77 long onCmdSelectTopic(FXObject*, FXSelector, void*);
78
80 long onCmdSearch(FXObject*, FXSelector, void*);
81
83 long onCmdShowToolTipsMenu(FXObject*, FXSelector, void*);
84
86 long onCmdSaveOptions(FXObject*, FXSelector, void*);
87
89 long onCmdLoadOptions(FXObject*, FXSelector, void*);
90
92 long onCmdResetDefault(FXObject*, FXSelector, void*);
93
95
96protected:
99
101 GNEDialog* myDialog = nullptr;
102
105
108
111
113 bool myOptionsModified = false;
114
115private:
118
120 FXTreeList* myTopicsTreeList = nullptr;
121
123 FXTreeItem* myRootItem = nullptr;
124
126 FXVerticalFrame* myEntriesFrame = nullptr;
127
130
133
135 std::map<FXTreeItem*, std::string> myTreeItemTopics;
136
139
141 const std::set<std::string> myIgnoredTopics = {"Configuration"};
142
144 const std::set<std::string> myIgnoredEntries = {"geometry.remove", "edges.join", "geometry.split", "ramps.guess", "ramps.set"};
145
148
150 void updateVisibleEntriesBySearch(std::string searchText);
151
153 bool loadConfiguration(const std::string& file);
154
157
160};
long onCmdSaveOptions(FXObject *, FXSelector, void *)
save options
void resetAllOptions()
reset options
bool loadConfiguration(const std::string &file)
load configuration
long onCmdShowToolTipsMenu(FXObject *, FXSelector, void *)
enable/disable show toolTip
FXVerticalFrame * myEntriesFrame
vertical frame for entries
long onCmdSearch(FXObject *, FXSelector, void *)
called when user searches
const OptionsCont & myOriginalOptionsContainer
reference to original Option container, used for restoring
long onCmdLoadOptions(FXObject *, FXSelector, void *)
load options
MFXTextFieldSearch * mySearchButton
search button
GNEDialog * myDialog
reference to dialog
OptionsCont & myOptionsContainer
reference to edited Option container
bool myOptionsModified
flag for check if options was modified
MFXCheckButtonTooltip * myDescriptionSearchCheckButton
checkbox for enable/disable search by description
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
long onCmdResetDefault(FXObject *, FXSelector, void *)
reset default
MFXCheckableButton * myShowToolTipsMenu
checkable button for show toolTips
GNEOptionsEditor(const GNEOptionsEditor &)=delete
Invalidated copy constructor.
long onCmdSelectTopic(FXObject *, FXSelector, void *)
called when user select a topic in the list
OptionsCont * myCopyOfOptionsContainer
copy of edited Option container, used for reset
GNEOptionsEditor & operator=(const GNEOptionsEditor &)=delete
Invalidated assignment operator.
const std::set< std::string > myIgnoredEntries
ignores entries
FXTreeItem * myRootItem
root item
std::map< FXTreeItem *, std::string > myTreeItemTopics
map with topics and their associated FXTreeItem
const std::set< std::string > myIgnoredTopics
ignores topics
bool updateVisibleEntriesByTopic()
update visible entries by selected topic
void updateVisibleEntriesBySearch(std::string searchText)
update visible entries by search
bool isOptionModified() const
check if option was modified
std::vector< GNEOptionsEditorRow::OptionRow * > myOptionRowEntries
Input option entries.
FXTreeList * myTopicsTreeList
Topics elements tree.
FXTextFieldIcon (based on FXTextFieldIcon)
A storage for options typed value containers)
Definition OptionsCont.h:89
Definition json.hpp:4471
every row value