108 new FXLabel(
this, category.c_str(),
nullptr,
GUIDesignLabel(JUSTIFY_NORMAL));
120 const std::string& parameter,
Option* option) :
122 myToolDialogParent(toolDialogParent),
124 myDefaultValue(pythonTool->getDefaultValue(parameter)) {
144 return myParameterLabel;
150 if (getValue() != myDefaultValue) {
151 return (
"-" + std::string(myParameterLabel->getText().text()) +
" " + getValue() +
" ");
160 if (myOption->isRequired()) {
161 return getValue() != myDefaultValue;
178 if (getValue() == myDefaultValue) {
179 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
181 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
194 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
"") {
200 myFilenameTextField->setText(myDefaultValue.c_str());
201 myOption->set(myDefaultValue, myDefaultValue,
false);
202 myOption->resetDefault();
210 if (myOption->getListSeparator() !=
"") {
214 const auto xmlFileDialog =
GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
220 myFilenameTextField->setText(xmlFileDialog.getFilename().c_str(), TRUE);
228 myOption->resetWritable();
229 if (myFilenameTextField->getText().empty()) {
232 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(),
false);
243 const std::string& useCurrent) :
244 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
246 if (useCurrent.size() > 0) {
263 return myFilenameTextField->getText().text();
272 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
285 myEdgeVectorTextField->setText(myDefaultValue.c_str());
286 myOption->set(myDefaultValue, myDefaultValue,
false);
287 myOption->resetDefault();
293 myOption->resetWritable();
294 if (myEdgeVectorTextField->getText().empty()) {
297 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(),
false);
306 const auto selectedEdges = myToolDialogParent->getApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
308 std::string selectedEdgesStr;
309 for (
const auto& edge : selectedEdges) {
310 selectedEdgesStr.append(edge->getID());
311 if (edge != selectedEdges.back()) {
312 selectedEdgesStr.append(
" ");
315 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
323 const auto viewNet = myToolDialogParent->getApplicationWindow()->getViewNet();
324 if (viewNet ==
nullptr) {
325 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
326 }
else if (viewNet->getNet()->getAttributeCarriers()->getNumberOfSelectedEdges() == 0) {
327 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
329 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
339 return myEdgeVectorTextField->getText().text();
348 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"network")) {
356 if (myOption->getListSeparator() !=
"") {
360 const auto networkFileDialog =
GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
366 myFilenameTextField->setText(networkFileDialog.getFilename().c_str(), TRUE);
381 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
382 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
384 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
386 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
399 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"additional")) {
407 if (myOption->getListSeparator() !=
"") {
411 const auto additionalFileDialog =
GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
412 TL(
"Additional elements file"),
417 myFilenameTextField->setText(additionalFileDialog.getFilename().c_str(), TRUE);
432 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
433 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
435 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
437 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
450 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"route")) {
458 if (myOption->getListSeparator() !=
"") {
462 const auto routeFileDialog =
GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
463 TL(
"Route elements file"),
468 myFilenameTextField->setText(routeFileDialog.getFilename().c_str(), TRUE);
483 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
484 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
486 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
488 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
501 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"data")) {
509 if (myOption->getListSeparator() !=
"") {
513 const auto dataFileDialog =
GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
514 TL(
"Data elements file"),
519 myFilenameTextField->setText(dataFileDialog.getFilename().c_str(), TRUE);
534 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
535 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
537 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
539 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
552 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"sumo config")) {
560 if (myOption->getListSeparator() !=
"") {
564 const auto sumoConfigFileDialog =
GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
565 TL(
"sumo config file"),
570 myFilenameTextField->setText(sumoConfigFileDialog.getFilename().c_str(), TRUE);
585 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
586 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
588 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
590 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
603 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
613 myEdgeTextField->setText(myDefaultValue.c_str());
614 myOption->set(myDefaultValue, myDefaultValue,
false);
615 myOption->resetDefault();
621 myOption->resetWritable();
622 if (myEdgeTextField->getText().empty()) {
625 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(),
false);
633 return myEdgeTextField->getText().text();
642 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
652 myStringTextField->setText(myDefaultValue.c_str());
653 myOption->set(myDefaultValue, myDefaultValue,
false);
654 myOption->resetDefault();
660 myOption->resetWritable();
661 if (myStringTextField->getText().empty()) {
664 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(),
false);
672 return myStringTextField->getText().text();
681 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
691 myIntTextField->setText(myDefaultValue.c_str());
692 if (myDefaultValue.empty()) {
693 myOption->set(INVALID_INT_STR,
"",
false);
695 myOption->set(myDefaultValue, myDefaultValue,
false);
697 myOption->resetDefault();
703 myOption->resetWritable();
704 if (myIntTextField->getText().empty()) {
707 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(),
false);
715 return myIntTextField->getText().text();
724 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
734 myFloatTextField->setText(myDefaultValue.c_str());
735 if (myDefaultValue.empty()) {
736 myOption->set(INVALID_DOUBLE_STR,
"",
false);
738 myOption->set(myDefaultValue, myDefaultValue,
false);
740 myOption->resetDefault();
746 myOption->resetWritable();
747 if (myFloatTextField->getText().empty()) {
750 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(),
false);
758 return myFloatTextField->getText().text();
767 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
783 if (myDefaultValue ==
"True") {
784 myCheckButton->setCheck(TRUE);
785 myCheckButton->setText(
TL(
"true"));
787 myCheckButton->setCheck(FALSE);
788 myCheckButton->setText(
TL(
"false"));
790 myOption->set(myDefaultValue, myDefaultValue,
false);
791 myOption->resetDefault();
797 myOption->resetWritable();
798 if (myCheckButton->getCheck() == TRUE) {
799 myCheckButton->setText(
TL(
"true"));
800 myOption->set(
"True",
"True",
false);
801 if (myDefaultValue ==
"True") {
802 myOption->resetDefault();
805 myCheckButton->setText(
TL(
"false"));
806 myOption->set(
"False",
"False",
false);
807 if (myDefaultValue ==
"False") {
808 myOption->resetDefault();
817 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 toString(const T &t, std::streamsize accuracy=gPrecision)
The main window of Netedit.
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 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