31#define MAXNUMCOLUMNS 4
32#define NUMROWSBYCOLUMN 20
52FXIMPLEMENT(
GNEPythonToolDialog, FXDialogBox, GNEPythonToolDialogMap, ARRAYNUMBER(GNEPythonToolDialogMap))
69 GNEApp->getStaticTooltipMenu(), (std::string(
"\t") +
TL(
"Toggle Menu Tooltips") + std::string(
"\t") +
TL(
"Toggles whether tooltips in the menu shall be shown.")).c_str(),
71 auto saveFile =
new MFXButtonTooltip(horizontalOptionsFrame, GNEApp->getStaticTooltipMenu(),
TL(
"Save toolcfg"),
73 saveFile->setTipText(
TL(
"Save file with tool configuration"));
74 auto loadFile =
new MFXButtonTooltip(horizontalOptionsFrame, GNEApp->getStaticTooltipMenu(),
TL(
"Load toolcfg"),
76 loadFile->setTipText(
TL(
"Load file with tool configuration"));
80 new FXSeparator(verticalContentFrame);
83 auto horizontalRowFrames =
new FXHorizontalFrame(contentScrollWindow, LAYOUT_FILL_X | LAYOUT_FILL_Y | PACK_UNIFORM_WIDTH);
87 new FXSeparator(verticalContentFrame);
90 auto blueLabel =
new FXLabel(horizontalButtonsFrame,
TL(
"Blue options are mandatory"),
nullptr,
GUIDesignLabelFixed(200));
91 blueLabel->setTextColor(FXRGB(0, 0, 255));
125 resize(1024, maximumHeight <= 768 ? maximumHeight : 768);
127 FXDialogBox::show(PLACEMENT_SCREEN);
168 if (file.size() > 0) {
227 if (argument->requiredAttributeSet() ==
false) {
228 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
231 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
236 std::string(category) {
242 myOptions.push_back(std::make_pair(name, option));
246const std::vector<std::pair<std::string, Option*> >&
255 std::sort(myOptions.begin(), myOptions.end());
278 int numArguments = 0;
279 for (
auto& categoryOption : categoryOptions) {
280 numArguments += (int)categoryOption.getOptions().size() + 1;
282 const int halfNumArguments = numArguments / 2;
284 int numInsertedArguments = 0;
286 for (
auto& categoryOption : categoryOptions) {
290 if (categoryOption.size() > 0) {
292 numInsertedArguments++;
296 categoryOption.sortByName();
299 for (
const auto& option : categoryOption.getOptions()) {
303 if (option.second->isInteger()) {
305 }
else if (option.second->isFloat()) {
307 }
else if (option.second->isBool()) {
309 }
else if (option.second->isFileName()) {
311 }
else if (option.second->isNetwork()) {
313 }
else if (option.second->isAdditional()) {
315 }
else if (option.second->isRoute()) {
317 }
else if (option.second->isData()) {
319 }
else if (option.second->isSumoConfig()) {
321 }
else if (option.second->isEdge()) {
323 }
else if (option.second->isEdgeVector()) {
328 numInsertedArguments++;
338 int maximumWidth = 0;
341 const auto label = argument->getParameterLabel();
342 const int columnWidth = label->getFont()->getTextWidth(label->getText().text(), label->getText().length() +
MARGIN);
343 if (columnWidth > maximumWidth) {
344 maximumWidth = columnWidth;
349 argument->getParameterLabel()->setWidth(maximumWidth);
354std::vector<GNEPythonToolDialog::CategoryOptions>
359 for (
const auto& option : optionsCont) {
360 result.front().
addOption(option.first, option.second);
366std::vector<GNEPythonToolDialog::CategoryOptions>
369 const std::vector<std::string> commonCategories = {
"input",
"output",
"processing",
"time"};
371 std::vector<std::string> categories = commonCategories;
372 for (
const auto& option : optionsCont) {
373 if (std::find(categories.begin(), categories.end(), option.second->getSubTopic()) == categories.end()) {
374 categories.push_back(option.second->getSubTopic());
378 std::vector<GNEPythonToolDialog::CategoryOptions> result;
379 for (
const auto& category : categories) {
383 for (
const auto& option : optionsCont) {
384 auto category = std::find(result.begin(), result.end(), option.second->getSubTopic());
386 category->addOption(option.first, option.second);
389 auto it = result.begin();
390 while (it != result.end()) {
391 if (it->getOptions().empty()) {
392 it = result.erase(it);
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_BUTTON_RUN
run button
@ MID_CHOOSEN_SAVE
Save set.
@ MID_GNE_BUTTON_CANCEL
cancel button
@ 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 GUIDesignLabelFixed(width)
label, icon before text, text centered and custom width
#define GUIDesignButtonAccept
Accept Button.
#define GUIDesignButtonCancel
Cancel Button.
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog with padding and spacing
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignButtonConfiguration
Configuration Button.
#define GUIDesignMFXCheckableButtonSquare
#define GUIDesignAuxiliarDialogBoxResizable
design for standard dialog box (for example, about dialog)
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignButtonReset
Reset Button.
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignHorizontalFrameNoPadding
Horizontal frame extended over frame parent without padding and spacing.
#define GUIDesignHorizontalFrame
Horizontal frame extended over frame parent with padding and spacing.
int GUIDesignHeight
the default size for GUI elements
The main window of Netedit.
GNEViewNet * getViewNet()
get pointer to viewNet
GNEViewParent * getViewParent() const
get the net object
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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
A class representing a single program option.
A storage for options typed value containers)
static std::string openOptionFileDialog(FXWindow *window, bool save)
open option dialog