111 new FXLabel(
this, category.c_str(),
nullptr,
GUIDesignLabel(JUSTIFY_NORMAL));
125 myToolDialogParent(toolDialogParent),
127 myDefaultValue(toolDialogParent->getPythonTool()->getDefaultValue(parameter)) {
149 return myParameterLabel;
155 if (getValue() != myDefaultValue) {
156 return (
"-" + std::string(myParameterLabel->getText().text()) +
" " + getValue() +
" ");
165 if (myOption->isRequired()) {
166 return getValue() != myDefaultValue;
183 if (getValue() == myDefaultValue) {
184 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
186 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
198 const std::string name,
Option* option) :
205 myFilenameTextField->setText(myDefaultValue.c_str());
206 myOption->set(myDefaultValue, myDefaultValue,
false);
207 myOption->resetDefault();
216 if (file.size() > 0) {
217 myFilenameTextField->setText(file.c_str(), TRUE);
225 myOption->resetWritable();
226 if (myFilenameTextField->getText().empty()) {
229 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(),
false);
239 const std::string name,
Option* option,
const std::string& useCurrent) :
240 Argument(toolDialogParent, argumentFrame, name, option) {
242 if (useCurrent.size() > 0) {
262 return myFilenameTextField->getText().text();
270 const std::string name,
Option* option) :
271 Argument(toolDialogParent, argumentFrame, name, option) {
286 myEdgeVectorTextField->setText(myDefaultValue.c_str());
287 myOption->set(myDefaultValue, myDefaultValue,
false);
288 myOption->resetDefault();
294 myOption->resetWritable();
295 if (myEdgeVectorTextField->getText().empty()) {
298 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(),
false);
307 const auto selectedEdges = myToolDialogParent->getGNEApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
309 std::string selectedEdgesStr;
310 for (
const auto& edge : selectedEdges) {
311 selectedEdgesStr.append(edge->getID());
312 if (edge != selectedEdges.back()) {
313 selectedEdgesStr.append(
" ");
316 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
324 const auto viewNet = myToolDialogParent->getGNEApplicationWindow()->getViewNet();
325 if (viewNet ==
nullptr) {
326 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
327 }
else if (viewNet->getNet()->getAttributeCarriers()->getNumberOfSelectedEdges() == 0) {
328 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
330 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
340 return myEdgeVectorTextField->getText().text();
348 const std::string name,
Option* option) :
358 if (networkFile.size() > 0) {
359 myFilenameTextField->setText(networkFile.c_str(), TRUE);
374 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() ==
nullptr) {
375 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
377 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
379 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
391 const std::string name,
Option* option) :
401 if (additionalFile.size() > 0) {
402 myFilenameTextField->setText(additionalFile.c_str(), TRUE);
417 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() ==
nullptr) {
418 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
420 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
422 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
434 const std::string name,
Option* option) :
444 if (routeFile.size() > 0) {
445 myFilenameTextField->setText(routeFile.c_str(), TRUE);
460 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() ==
nullptr) {
461 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
463 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
465 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
477 const std::string name,
Option* option) :
487 if (dataFile.size() > 0) {
488 myFilenameTextField->setText(dataFile.c_str(), TRUE);
503 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() ==
nullptr) {
504 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
506 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
508 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
520 const std::string name,
Option* option) :
530 if (sumoConfigFile.size() > 0) {
531 myFilenameTextField->setText(sumoConfigFile.c_str(), TRUE);
546 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() ==
nullptr) {
547 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
549 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
551 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
563 Argument(toolDialogParent, argumentFrame, name, option) {
574 myEdgeTextField->setText(myDefaultValue.c_str());
575 myOption->set(myDefaultValue, myDefaultValue,
false);
576 myOption->resetDefault();
582 myOption->resetWritable();
583 if (myEdgeTextField->getText().empty()) {
586 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(),
false);
594 return myEdgeTextField->getText().text();
602 Argument(toolDialogParent, argumentFrame, name, option) {
613 myStringTextField->setText(myDefaultValue.c_str());
614 myOption->set(myDefaultValue, myDefaultValue,
false);
615 myOption->resetDefault();
621 myOption->resetWritable();
622 if (myStringTextField->getText().empty()) {
625 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(),
false);
633 return myStringTextField->getText().text();
641 Argument(toolDialogParent, argumentFrame, name, option) {
652 myIntTextField->setText(myDefaultValue.c_str());
653 if (myDefaultValue.empty()) {
654 myOption->set(INVALID_INT_STR,
"",
false);
656 myOption->set(myDefaultValue, myDefaultValue,
false);
658 myOption->resetDefault();
664 myOption->resetWritable();
665 if (myIntTextField->getText().empty()) {
668 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(),
false);
676 return myIntTextField->getText().text();
684 Argument(toolDialogParent, argumentFrame, name, option) {
695 myFloatTextField->setText(myDefaultValue.c_str());
696 if (myDefaultValue.empty()) {
697 myOption->set(INVALID_DOUBLE_STR,
"",
false);
699 myOption->set(myDefaultValue, myDefaultValue,
false);
701 myOption->resetDefault();
707 myOption->resetWritable();
708 if (myFloatTextField->getText().empty()) {
711 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(),
false);
719 return myFloatTextField->getText().text();
727 Argument(toolDialogParent, argumentFrame, name, option) {
744 if (myDefaultValue ==
"True") {
745 myCheckButton->setCheck(TRUE);
746 myCheckButton->setText(
TL(
"true"));
748 myCheckButton->setCheck(FALSE);
749 myCheckButton->setText(
TL(
"false"));
751 myOption->set(myDefaultValue, myDefaultValue,
false);
752 myOption->resetDefault();
758 myOption->resetWritable();
759 if (myCheckButton->getCheck() == TRUE) {
760 myCheckButton->setText(
TL(
"true"));
761 myOption->set(
"True",
"True",
false);
762 if (myDefaultValue ==
"True") {
763 myOption->resetDefault();
766 myCheckButton->setText(
TL(
"false"));
767 myOption->set(
"False",
"False",
false);
768 if (myDefaultValue ==
"False") {
769 myOption->resetDefault();
778 if (myCheckButton->getCheck() == TRUE) {
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_SELECT
select element
@ MID_GNE_USE_CURRENT
use current network/additional/route/edgedata
@ MID_GNE_RESET
reset element
#define GUIDesignButtonIcon
button only with icon
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignLabel(justify)
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
const double INVALID_DOUBLE
invalid double
const int INVALID_INT
invalid int
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
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.
const std::string & getDescription() const
Returns the description of what this option does.
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
virtual bool getBool() const
Returns the stored boolean value.
bool isRequired() const
check if option is required
const std::string & getValueString() const
Returns the string-representation of the value.
static OptionsCont & getOptions()
Retrieves the options.
static std::string openRouteFileDialog(FXWindow *window, bool save, bool multi=false)
open route file dialog
static std::string openAdditionalFileDialog(FXWindow *window, bool save, bool multi=false)
open additional dialog
static std::string openDataFileDialog(FXWindow *window, bool save, bool multi=false)
open data file dialog
static std::string openSumoConfigFileDialog(FXWindow *window, bool save, bool multi=false)
open SUMO config file dialog
static std::string openFileDialog(FXWindow *window, bool save, bool multi)
open general file dialog
static std::string openNetworkFileDialog(FXWindow *window, bool save, bool multi=false)
open netconvert file dialog