121 new FXLabel(
this, category.c_str(),
nullptr,
GUIDesignLabel(JUSTIFY_NORMAL));
133 const std::string& parameter,
Option* option) :
135 myToolDialogParent(toolDialogParent),
137 myDefaultValue(pythonTool->getDefaultValue(parameter)) {
157 return myParameterLabel;
163 if (getValue() != myDefaultValue) {
164 return (
"-" + std::string(myParameterLabel->getText().text()) +
" " + getValue() +
" ");
173 if (myOption->isRequired()) {
174 return getValue() != myDefaultValue;
191 if (getValue() == myDefaultValue) {
192 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
194 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
207 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
"") {
213 myFilenameTextField->setText(myDefaultValue.c_str());
214 myOption->set(myDefaultValue, myDefaultValue,
false);
215 myOption->resetDefault();
222 const GNEFileDialog xmlFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
227 updateFromDialog(xmlFileDialog);
239 myFilenameTextField->setText(fileDialog.
getFilename().c_str(), TRUE);
247 myOption->resetWritable();
248 if (myFilenameTextField->getText().empty()) {
251 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(),
false);
262 const std::string& useCurrent) :
263 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
265 if (useCurrent.size() > 0) {
282 return myFilenameTextField->getText().text();
291 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
304 myEdgeVectorTextField->setText(myDefaultValue.c_str());
305 myOption->set(myDefaultValue, myDefaultValue,
false);
306 myOption->resetDefault();
312 myOption->resetWritable();
313 if (myEdgeVectorTextField->getText().empty()) {
316 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(),
false);
325 const auto selectedEdges = myToolDialogParent->getApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
327 std::string selectedEdgesStr;
328 for (
const auto& edge : selectedEdges) {
329 selectedEdgesStr.append(edge->getID());
330 if (edge != selectedEdges.back()) {
331 selectedEdgesStr.append(
" ");
334 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
342 const auto viewNet = myToolDialogParent->getApplicationWindow()->getViewNet();
343 if (viewNet ==
nullptr) {
344 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
345 }
else if (viewNet->getNet()->getAttributeCarriers()->getNumberOfSelectedEdges() == 0) {
346 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
348 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
358 return myEdgeVectorTextField->getText().text();
367 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"network")) {
374 const GNEFileDialog networkFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
379 updateFromDialog(networkFileDialog);
393 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
394 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
396 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
398 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
411 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"additional")) {
418 const GNEFileDialog additionalFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
419 TL(
"Additional elements file"),
423 updateFromDialog(additionalFileDialog);
437 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
438 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
440 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
442 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
455 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"route")) {
462 const GNEFileDialog routeFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
463 TL(
"Route elements file"),
467 updateFromDialog(routeFileDialog);
481 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
482 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
484 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
486 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
499 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"data")) {
506 const GNEFileDialog dataFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
507 TL(
"Data elements file"),
511 updateFromDialog(dataFileDialog);
525 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
526 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
528 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
530 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
543 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"sumo config")) {
550 const GNEFileDialog sumoConfigFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
551 TL(
"sumo config file"),
555 updateFromDialog(sumoConfigFileDialog);
569 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
570 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
572 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
574 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
587 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
597 myEdgeTextField->setText(myDefaultValue.c_str());
598 myOption->set(myDefaultValue, myDefaultValue,
false);
599 myOption->resetDefault();
605 myOption->resetWritable();
606 if (myEdgeTextField->getText().empty()) {
609 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(),
false);
617 return myEdgeTextField->getText().text();
626 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
636 myStringTextField->setText(myDefaultValue.c_str());
637 myOption->set(myDefaultValue, myDefaultValue,
false);
638 myOption->resetDefault();
644 myOption->resetWritable();
645 if (myStringTextField->getText().empty()) {
648 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(),
false);
656 return myStringTextField->getText().text();
665 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
675 myIntTextField->setText(myDefaultValue.c_str());
676 if (myDefaultValue.empty()) {
677 myOption->set(INVALID_INT_STR,
"",
false);
679 myOption->set(myDefaultValue, myDefaultValue,
false);
681 myOption->resetDefault();
687 myOption->resetWritable();
688 if (myIntTextField->getText().empty()) {
691 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(),
false);
699 return myIntTextField->getText().text();
708 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
718 myFloatTextField->setText(myDefaultValue.c_str());
719 if (myDefaultValue.empty()) {
720 myOption->set(INVALID_DOUBLE_STR,
"",
false);
722 myOption->set(myDefaultValue, myDefaultValue,
false);
724 myOption->resetDefault();
730 myOption->resetWritable();
731 if (myFloatTextField->getText().empty()) {
734 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(),
false);
742 return myFloatTextField->getText().text();
751 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
767 if (myDefaultValue ==
"True") {
768 myCheckButton->setCheck(TRUE);
769 myCheckButton->setText(
TL(
"true"));
771 myCheckButton->setCheck(FALSE);
772 myCheckButton->setText(
TL(
"false"));
774 myOption->set(myDefaultValue, myDefaultValue,
false);
775 myOption->resetDefault();
781 myOption->resetWritable();
782 if (myCheckButton->getCheck() == TRUE) {
783 myCheckButton->setText(
TL(
"true"));
784 myOption->set(
"True",
"True",
false);
785 if (myDefaultValue ==
"True") {
786 myOption->resetDefault();
789 myCheckButton->setText(
TL(
"false"));
790 myOption->set(
"False",
"False",
false);
791 if (myDefaultValue ==
"False") {
792 myOption->resetDefault();
801 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 GUIDesignTextColorBlue
blue color (for default text)
#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 joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
std::vector< std::string > getFilenames() const
Return empty-string terminated list of selected file names, or NULL if none selected.
std::string getFilename() const
Return file name, if any.
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.
const std::string & getListSeparator() const
retrieve list separator
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
virtual bool getBool() const
Returns the stored boolean value.
const std::string & getSubTopic() const
Returns the subtopic to which this option belongs.
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 StringBijection< SumoConfigFileExtension > SumoConfigFileExtensions
sumo config file extensions
static StringBijection< AdditionalFileExtension > AdditionalFileExtensions
additional file extensions
static StringBijection< RouteFileExtension > RouteFileExtensions
route file extensions
static StringBijection< XMLFileExtension > XMLFileExtensions
XML file Extensions.
static StringBijection< EdgeDataFileExtension > EdgeDataFileExtensions
edgedata file extensions
static StringBijection< NetFileExtension > NetFileExtensions
net file extensions