36#define MAXNUMCOLUMNS 4
37#define NUMROWSBYCOLUMN 20
68 applicationWindow->getStaticTooltipMenu(), (std::string(
"\t") +
TL(
"Toggle Menu Tooltips") + std::string(
"\t") +
TL(
"Toggles whether tooltips in the menu shall be shown.")).c_str(),
70 auto saveFile =
new MFXButtonTooltip(horizontalOptionsFrame, applicationWindow->getStaticTooltipMenu(),
TL(
"Save toolcfg"),
72 saveFile->setTipText(
TL(
"Save file with tool configuration"));
73 auto loadFile =
new MFXButtonTooltip(horizontalOptionsFrame, applicationWindow->getStaticTooltipMenu(),
TL(
"Load toolcfg"),
75 loadFile->setTipText(
TL(
"Load file with tool configuration"));
79 new FXSeparator(myContentFrame);
82 auto horizontalRowFrames =
new FXHorizontalFrame(contentScrollWindow, LAYOUT_FILL_X | LAYOUT_FILL_Y | PACK_UNIFORM_WIDTH);
88 setTitle(myPythonTool->getToolName().c_str());
90 mySortedCheckButton->setCheck(FALSE);
91 myGroupedCheckButton->setCheck(TRUE);
93 myShowToolTipsMenu->setChecked(getApp()->reg().readIntEntry(
"gui",
"menuToolTips", 0) != 1);
95 myPythonTool->setCurrentValues();
97 buildArguments(
false,
true);
99 const int maximumHeight = myArgumentFrameLeft->numChildren() *
GUIDesignHeight + 120;
101 resize(1024, maximumHeight <= 768 ? maximumHeight : 768);
202 if (argument->requiredAttributeSet() ==
false) {
203 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
206 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
211 std::string(category) {
217 myOptions.push_back(std::make_pair(name, option));
221const std::vector<std::pair<std::string, Option*> >&
230 std::sort(myOptions.begin(), myOptions.end());
248 int numArguments = 0;
249 for (
auto& categoryOption : categoryOptions) {
250 numArguments += (int)categoryOption.getOptions().size() + 1;
252 const int halfNumArguments = numArguments / 2;
254 int numInsertedArguments = 0;
256 for (
auto& categoryOption : categoryOptions) {
260 if (categoryOption.size() > 0) {
262 numInsertedArguments++;
266 categoryOption.sortByName();
269 for (
const auto& option : categoryOption.getOptions()) {
273 if (option.second->isInteger()) {
275 }
else if (option.second->isFloat()) {
277 }
else if (option.second->isBool()) {
279 }
else if (option.second->isFileName()) {
281 }
else if (option.second->isNetwork()) {
283 }
else if (option.second->isAdditional()) {
285 }
else if (option.second->isRoute()) {
287 }
else if (option.second->isData()) {
289 }
else if (option.second->isSumoConfig()) {
291 }
else if (option.second->isEdge()) {
293 }
else if (option.second->isEdgeVector()) {
298 numInsertedArguments++;
308 int maximumWidth = 0;
311 const auto label = argument->getParameterLabel();
312 const int columnWidth = label->getFont()->getTextWidth(label->getText().text(), label->getText().length() +
MARGIN);
313 if (columnWidth > maximumWidth) {
314 maximumWidth = columnWidth;
319 argument->getParameterLabel()->setWidth(maximumWidth);
324std::vector<GNEPythonToolDialog::CategoryOptions>
329 for (
const auto& option : optionsCont) {
330 result.front().
addOption(option.first, option.second);
336std::vector<GNEPythonToolDialog::CategoryOptions>
339 const std::vector<std::string> commonCategories = {
"input",
"output",
"processing",
"time"};
341 std::vector<std::string> categories = commonCategories;
342 for (
const auto& option : optionsCont) {
343 if (std::find(categories.begin(), categories.end(), option.second->getSubTopic()) == categories.end()) {
344 categories.push_back(option.second->getSubTopic());
348 std::vector<GNEPythonToolDialog::CategoryOptions> result;
349 for (
const auto& category : categories) {
353 for (
const auto& option : optionsCont) {
354 auto category = std::find(result.begin(), result.end(), option.second->getSubTopic());
356 category->addOption(option.first, option.second);
359 auto it = result.begin();
360 while (it != result.end()) {
361 if (it->getOptions().empty()) {
362 it = result.erase(it);
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_BUTTON_RUN
run button
@ MID_CHOOSEN_SAVE
Save set.
@ MID_GNE_BUTTON_RESET
reset button
@ MID_GNE_RUNPYTHONTOOL
run python
@ MID_SHOWTOOLTIPS_MENU
Show tool tips in menus - button.
@ MID_CHOOSEN_LOAD
Load set.
#define GUIDesignScrollWindow
design for scroll windows extended over Y and y
#define GUIDesignButtonConfiguration
Configuration Button.
#define GUIDesignMFXCheckableButtonSquare
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignHorizontalFrameNoPadding
Horizontal frame extended over frame parent without padding and spacing.
GUIIcon
An enumeration of icons used by the gui applications.
int GUIDesignHeight
the default height for GUI elements
The main window of Netedit.
GNEViewNet * getViewNet()
get pointer to viewNet
GNEApplicationWindow * getApplicationWindow() const
get pointer to the application window
GNEApplicationWindow * myApplicationWindow
FOX needs this.
OpenType
Open dialog type.
GNEViewParent * getViewParent() const
get the net object
MFXCheckableButton * getShowToolTipsMenu() const
get menu for tooltips menu
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
dialog arguments, used for certain modal dialogs that can not be edited using tab
A class representing a single program option.
A storage for options typed value containers)
static StringBijection< XMLFileExtension > XMLFileExtensions
XML file Extensions.