35#define MAXNUMCOLUMNS 4
36#define NUMROWSBYCOLUMN 20
73 GNEApp->getStaticTooltipMenu(), (std::string(
"\t") +
TL(
"Toggle Menu Tooltips") + std::string(
"\t") +
TL(
"Toggles whether tooltips in the menu shall be shown.")).c_str(),
75 auto saveFile =
new MFXButtonTooltip(horizontalOptionsFrame, GNEApp->getStaticTooltipMenu(),
TL(
"Save toolcfg"),
77 saveFile->setTipText(
TL(
"Save file with tool configuration"));
78 auto loadFile =
new MFXButtonTooltip(horizontalOptionsFrame, GNEApp->getStaticTooltipMenu(),
TL(
"Load toolcfg"),
80 loadFile->setTipText(
TL(
"Load file with tool configuration"));
84 new FXSeparator(verticalContentFrame);
87 auto horizontalRowFrames =
new FXHorizontalFrame(contentScrollWindow, LAYOUT_FILL_X | LAYOUT_FILL_Y | PACK_UNIFORM_WIDTH);
91 new FXSeparator(verticalContentFrame);
94 auto blueLabel =
new FXLabel(horizontalButtonsFrame,
TL(
"Blue options are mandatory"),
nullptr,
GUIDesignLabelFixed(200));
95 blueLabel->setTextColor(FXRGB(0, 0, 255));
129 resize(1024, maximumHeight <= 768 ? maximumHeight : 768);
131 MFXDialogBox::show(PLACEMENT_SCREEN);
178 if (file.size() > 0) {
237 if (argument->requiredAttributeSet() ==
false) {
238 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
241 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
246 std::string(category) {
252 myOptions.push_back(std::make_pair(name, option));
256const std::vector<std::pair<std::string, Option*> >&
265 std::sort(myOptions.begin(), myOptions.end());
288 int numArguments = 0;
289 for (
auto& categoryOption : categoryOptions) {
290 numArguments += (int)categoryOption.getOptions().size() + 1;
292 const int halfNumArguments = numArguments / 2;
294 int numInsertedArguments = 0;
296 for (
auto& categoryOption : categoryOptions) {
300 if (categoryOption.size() > 0) {
302 numInsertedArguments++;
306 categoryOption.sortByName();
309 for (
const auto& option : categoryOption.getOptions()) {
313 if (option.second->isInteger()) {
315 }
else if (option.second->isFloat()) {
317 }
else if (option.second->isBool()) {
319 }
else if (option.second->isFileName()) {
321 }
else if (option.second->isNetwork()) {
323 }
else if (option.second->isAdditional()) {
325 }
else if (option.second->isRoute()) {
327 }
else if (option.second->isData()) {
329 }
else if (option.second->isSumoConfig()) {
331 }
else if (option.second->isEdge()) {
333 }
else if (option.second->isEdgeVector()) {
338 numInsertedArguments++;
348 int maximumWidth = 0;
351 const auto label = argument->getParameterLabel();
352 const int columnWidth = label->getFont()->getTextWidth(label->getText().text(), label->getText().length() +
MARGIN);
353 if (columnWidth > maximumWidth) {
354 maximumWidth = columnWidth;
359 argument->getParameterLabel()->setWidth(maximumWidth);
364std::vector<GNEPythonToolDialog::CategoryOptions>
369 for (
const auto& option : optionsCont) {
370 result.front().
addOption(option.first, option.second);
376std::vector<GNEPythonToolDialog::CategoryOptions>
379 const std::vector<std::string> commonCategories = {
"input",
"output",
"processing",
"time"};
381 std::vector<std::string> categories = commonCategories;
382 for (
const auto& option : optionsCont) {
383 if (std::find(categories.begin(), categories.end(), option.second->getSubTopic()) == categories.end()) {
384 categories.push_back(option.second->getSubTopic());
388 std::vector<GNEPythonToolDialog::CategoryOptions> result;
389 for (
const auto& category : categories) {
393 for (
const auto& option : optionsCont) {
394 auto category = std::find(result.begin(), result.end(), option.second->getSubTopic());
396 category->addOption(option.first, option.second);
399 auto it = result.begin();
400 while (it != result.end()) {
401 if (it->getOptions().empty()) {
402 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
dialog arguments (used for certain functions that opens modal dialogs)
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