Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPythonToolDialog.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// Dialog for tools
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30
32class GNEPythonTool;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
43class GNEPythonToolDialog : protected FXDialogBox {
45 FXDECLARE(GNEPythonToolDialog)
46
47
49
50public:
53
56
58 void openDialog(GNEPythonTool* tool);
59
62
64 const GNEPythonTool* getPythonTool() const;
65
68
70 long onCmdShowToolTipsMenu(FXObject*, FXSelector, void*);
71
73 long onCmdSave(FXObject*, FXSelector, void*);
74
76 long onCmdLoad(FXObject*, FXSelector, void*);
77
79 long onCmdSetVisualization(FXObject*, FXSelector, void*);
80
82 long onCmdRun(FXObject*, FXSelector, void*);
83
85 long onCmdCancel(FXObject*, FXSelector, void*);
86
88 long onCmdReset(FXObject*, FXSelector, void*);
89
91 long onUpdRequiredAttributes(FXObject* sender, FXSelector, void*);
92
94
95protected:
97 class CategoryOptions : public std::string {
98
99 public:
101 CategoryOptions(const std::string& category);
102
104 void addOption(const std::string& name, Option* option);
105
107 const std::vector<std::pair<std::string, Option*> >& getOptions() const;
108
110 void sortByName();
111
112 private:
114 std::vector<std::pair<std::string, Option*> > myOptions;
115
118 };
119
122
124 void buildArguments(bool sortByName, bool groupedByCategories);
125
128
131
133 std::vector<GNEPythonToolDialog::CategoryOptions> getOptions(OptionsCont& optionsCont) const;
134
136 std::vector<CategoryOptions> getOptionsByCategories(OptionsCont& optionsCont) const;
137
139 int getNumRowColums() const;
140
142 FXVerticalFrame* getArgumentFrameLeft() const;
143
145 FXVerticalFrame* getArgumentFrameRight() const;
146
148 std::vector<GNEPythonToolDialogElements::Argument*> myArguments;
149
151 std::vector<GNEPythonToolDialogElements::Category*> myCategories;
152
153private:
156
159
161 FXCheckButton* mySortedCheckButton = nullptr;
162
164 FXCheckButton* myGroupedCheckButton = nullptr;
165
167 FXVerticalFrame* myArgumentFrameLeft = nullptr;
168
170 FXVerticalFrame* myArgumentFrameRight = nullptr;
171
174
177
180};
The main window of Netedit.
internal class used for sorting options by categories
std::vector< std::pair< std::string, Option * > > myOptions
options for this category
elements used in Tool Dialogs
Dialog for python tool dialog.
std::vector< CategoryOptions > getOptionsByCategories(OptionsCont &optionsCont) const
get options sorted by category
FXVerticalFrame * myArgumentFrameRight
argument frame right
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
GNEPythonTool * myPythonTool
python tool
GNEPythonToolDialog & operator=(const GNEPythonToolDialog &)=delete
Invalidated assignment operator.
void adjustParameterColumn()
adjust parameter column
int getNumRowColums() const
get number of row colums
GNEPythonToolDialog()
FOX needs this.
long onCmdLoad(FXObject *, FXSelector, void *)
load options
std::vector< GNEPythonToolDialogElements::Argument * > myArguments
list of arguments sorted by categories
GNEApplicationWindow * myGNEApp
pointer to GNEApplicationWindow
std::vector< GNEPythonToolDialogElements::Category * > myCategories
list of categories
OptionsCont myCustomToolsOptions
custom tools options
long onCmdShowToolTipsMenu(FXObject *, FXSelector, void *)
enable/disable show toolTip
GNEApplicationWindow * getGNEApplicationWindow() const
get pointer to GNEApplicationWindow
long onCmdRun(FXObject *, FXSelector, void *)
event after press run button
MFXCheckableButton * myShowToolTipsMenu
menu for tooltips menu
std::vector< GNEPythonToolDialog::CategoryOptions > getOptions(OptionsCont &optionsCont) const
get options
FXVerticalFrame * getArgumentFrameLeft() const
get argument frame left
long onUpdRequiredAttributes(FXObject *sender, FXSelector, void *)
event for check if required attributes was set
FXCheckButton * mySortedCheckButton
check button to enable/diasble sorting
long onCmdSetVisualization(FXObject *, FXSelector, void *)
set visualization (sorting and grouping)
FXVerticalFrame * getArgumentFrameRight() const
get argument frame right
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
FXVerticalFrame * myArgumentFrameLeft
argument frame left
const GNEPythonTool * getPythonTool() const
get python tool
long onCmdSave(FXObject *, FXSelector, void *)
save options
GNEPythonToolDialog(const GNEPythonToolDialog &)=delete
Invalidated copy constructor.
void buildArguments(bool sortByName, bool groupedByCategories)
build arguments
FXCheckButton * myGroupedCheckButton
check button to enable/diasble grouping
void openDialog(GNEPythonTool *tool)
open dialog
A class representing a single program option.
Definition Option.h:74
A storage for options typed value containers)
Definition OptionsCont.h:89
Definition json.hpp:4471
every row value