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-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// Dialog for tools
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31
33class GNEPythonTool;
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
39
46 FXDECLARE(GNEPythonToolDialog)
47
48
50
51public:
54
57
59 void openDialog(GNEPythonTool* tool);
60
62 void runInternalTest(const InternalTestStep::DialogTest* modalArguments);
63
66
68 const GNEPythonTool* getPythonTool() const;
69
72
74 long onCmdShowToolTipsMenu(FXObject*, FXSelector, void*);
75
77 long onCmdSave(FXObject*, FXSelector, void*);
78
80 long onCmdLoad(FXObject*, FXSelector, void*);
81
83 long onCmdSetVisualization(FXObject*, FXSelector, void*);
84
86 long onCmdRun(FXObject*, FXSelector, void*);
87
89 long onCmdCancel(FXObject*, FXSelector, void*);
90
92 long onCmdReset(FXObject*, FXSelector, void*);
93
95 long onUpdRequiredAttributes(FXObject* sender, FXSelector, void*);
96
98
99protected:
101 class CategoryOptions : public std::string {
102
103 public:
105 CategoryOptions(const std::string& category);
106
108 void addOption(const std::string& name, Option* option);
109
111 const std::vector<std::pair<std::string, Option*> >& getOptions() const;
112
114 void sortByName();
115
116 private:
118 std::vector<std::pair<std::string, Option*> > myOptions;
119
122 };
123
126
128 void buildArguments(bool sortByName, bool groupedByCategories);
129
132
135
137 std::vector<GNEPythonToolDialog::CategoryOptions> getOptions(OptionsCont& optionsCont) const;
138
140 std::vector<CategoryOptions> getOptionsByCategories(OptionsCont& optionsCont) const;
141
143 int getNumRowColums() const;
144
146 FXVerticalFrame* getArgumentFrameLeft() const;
147
149 FXVerticalFrame* getArgumentFrameRight() const;
150
152 std::vector<GNEPythonToolDialogElements::Argument*> myArguments;
153
155 std::vector<GNEPythonToolDialogElements::Category*> myCategories;
156
157private:
160
163
165 FXCheckButton* mySortedCheckButton = nullptr;
166
168 FXCheckButton* myGroupedCheckButton = nullptr;
169
171 FXVerticalFrame* myArgumentFrameLeft = nullptr;
172
174 FXVerticalFrame* myArgumentFrameRight = nullptr;
175
178
181
184};
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
void runInternalTest(const InternalTestStep::DialogTest *modalArguments)
run internal test
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