Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPythonToolDialogElements.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Elements used in GNEPythonToolDialog
19/****************************************************************************/
20
22#include <netedit/GNENet.h>
26
28#include "GNEPythonToolDialog.h"
29
30// ===========================================================================
31// static members
32// ===========================================================================
33
36
37// ===========================================================================
38// FOX callback mapping
39// ===========================================================================
40
46
50
55
61
67
73
79
85
86// Object implementation
87FXIMPLEMENT_ABSTRACT(GNEPythonToolDialogElements::Argument, FXHorizontalFrame, ArgumentMap, ARRAYNUMBER(ArgumentMap))
88FXIMPLEMENT(GNEPythonToolDialogElements::EdgeVectorArgument, GNEPythonToolDialogElements::Argument, EdgeVectorArgumentMap, ARRAYNUMBER(EdgeVectorArgumentMap))
89FXIMPLEMENT(GNEPythonToolDialogElements::FileNameArgument, GNEPythonToolDialogElements::Argument, FileNameArgumentMap, ARRAYNUMBER(FileNameArgumentMap))
90FXIMPLEMENT(GNEPythonToolDialogElements::NetworkArgument, GNEPythonToolDialogElements::FileNameArgument, NetworkArgumentMap, ARRAYNUMBER(NetworkArgumentMap))
91FXIMPLEMENT(GNEPythonToolDialogElements::AdditionalArgument, GNEPythonToolDialogElements::FileNameArgument, AdditionalArgumentMap, ARRAYNUMBER(AdditionalArgumentMap))
92FXIMPLEMENT(GNEPythonToolDialogElements::RouteArgument, GNEPythonToolDialogElements::FileNameArgument, RouteArgumentMap, ARRAYNUMBER(RouteArgumentMap))
93FXIMPLEMENT(GNEPythonToolDialogElements::DataArgument, GNEPythonToolDialogElements::FileNameArgument, DataArgumentMap, ARRAYNUMBER(DataArgumentMap))
94FXIMPLEMENT(GNEPythonToolDialogElements::SumoConfigArgument, GNEPythonToolDialogElements::FileNameArgument, SumoConfigArgumentMap, ARRAYNUMBER(SumoConfigArgumentMap))
95
96
97// ===========================================================================
98// member method definitions
99// ===========================================================================
100
104 if (o->getListSeparator() != "") {
106 }
107 if (o->getSubTopic() == "output") {
109 }
110 return openMode;
111}
112
113
114// ---------------------------------------------------------------------------
115// GNEPythonToolDialogElements::Category - methods
116// ---------------------------------------------------------------------------
117
118GNEPythonToolDialogElements::Category::Category(FXVerticalFrame* argumentFrame, const std::string& category) :
119 FXHorizontalFrame(argumentFrame, GUIDesignAuxiliarHorizontalFrame) {
120 // create category label
121 new FXLabel(this, category.c_str(), nullptr, GUIDesignLabel(JUSTIFY_NORMAL));
122}
123
124
126
127// ---------------------------------------------------------------------------
128// GNEPythonToolDialogElements::Argument - methods
129// ---------------------------------------------------------------------------
130
132 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame,
133 const std::string& parameter, Option* option) :
134 FXHorizontalFrame(argumentFrame, GUIDesignAuxiliarHorizontalFrame),
135 myToolDialogParent(toolDialogParent),
136 myOption(option),
137 myDefaultValue(pythonTool->getDefaultValue(parameter)) {
138 // create parameter label
139 myParameterLabel = new MFXLabelTooltip(this, applicationWindow->getStaticTooltipMenu(), parameter.c_str(), nullptr, GUIDesignLabelThickedFixed(0));
140 myParameterLabel->setTipText((option->getTypeName() + ": " + option->getDescription()).c_str());
141 // set color if is required
142 if (option->isRequired()) {
144 }
145 // create horizontal frame for textField
146 myElementsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarFrame);
147 // Create reset button
149}
150
151
153
154
157 return myParameterLabel;
158}
159
160
161const std::string
163 if (getValue() != myDefaultValue) {
164 return ("-" + std::string(myParameterLabel->getText().text()) + " " + getValue() + " ");
165 } else {
166 return "";
167 }
168}
169
170
171bool
173 if (myOption->isRequired()) {
174 return getValue() != myDefaultValue;
175 } else {
176 return true;
177 }
178}
179
180
181long
183 // just reset value
184 reset();
185 return 1;
186}
187
188
189long
191 if (getValue() == myDefaultValue) {
192 return myResetButton->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
193 } else {
194 return myResetButton->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
195 }
196}
197
198
200
201// ---------------------------------------------------------------------------
202// GNEPythonToolDialogElements::FileNameArgument - methods
203// ---------------------------------------------------------------------------
204
206 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
207 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, "") {
208}
209
210
211void
213 myFilenameTextField->setText(myDefaultValue.c_str());
214 myOption->set(myDefaultValue, myDefaultValue, false);
215 myOption->resetDefault();
216}
217
218
219long
221 // get file
222 const GNEFileDialog xmlFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
223 TL("XML file"),
225 getOpenMode(myOption),
227 updateFromDialog(xmlFileDialog);
228 return 1;
229}
230
231
232void
234 // check that file is valid
235 if (fileDialog.getResult() == GNEDialog::Result::ACCEPT) {
237 myFilenameTextField->setText(joinToString(fileDialog.getFilenames(), myOption->getListSeparator()).c_str(), TRUE);
238 } else {
239 myFilenameTextField->setText(fileDialog.getFilename().c_str(), TRUE);
240 }
241 }
242}
243
244
245long
247 myOption->resetWritable();
248 if (myFilenameTextField->getText().empty()) {
249 reset();
250 } else {
251 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(), false);
252 }
253 return 1;
254}
255
256
258
259
261 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option,
262 const std::string& useCurrent) :
263 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
264 // check if create current button
265 if (useCurrent.size() > 0) {
268 myCurrentButton->setTipText(TLF("Use current % file", useCurrent).c_str());
269 }
270 // Create Open button
273 myOpenFilenameButton->setTipText(TLF("Select % file", useCurrent).c_str());
274 // create text field for filename
276 // set value
277 myFilenameTextField->setText(option->getValueString().c_str());
278}
279
280const std::string
282 return myFilenameTextField->getText().text();
283}
284
285// ---------------------------------------------------------------------------
286// GNEPythonToolDialogElements::EdgeVectorArgument - methods
287// ---------------------------------------------------------------------------
288
290 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
291 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
294 myCurrentEdgesButton->setTipText(TL("Use current selected edges"));
295 // create text field for string
297 // set value
298 myEdgeVectorTextField->setText(option->getValueString().c_str());
299}
300
301
302void
304 myEdgeVectorTextField->setText(myDefaultValue.c_str());
305 myOption->set(myDefaultValue, myDefaultValue, false);
306 myOption->resetDefault();
307}
308
309
310long
312 myOption->resetWritable();
313 if (myEdgeVectorTextField->getText().empty()) {
314 reset();
315 } else {
316 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(), false);
317 }
318 return 1;
319}
320
321
322long
324 // obtain list of selected edges
325 const auto selectedEdges = myToolDialogParent->getApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
326 // convert list to string
327 std::string selectedEdgesStr;
328 for (const auto& edge : selectedEdges) {
329 selectedEdgesStr.append(edge->getID());
330 if (edge != selectedEdges.back()) {
331 selectedEdgesStr.append(" ");
332 }
333 }
334 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
335 return 1;
336}
337
338
339long
341 // get view net
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);
347 } else {
348 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
349 }
350}
351
352
354
355
356const std::string
358 return myEdgeVectorTextField->getText().text();
359}
360
361// ---------------------------------------------------------------------------
362// GNEPythonToolDialogElements::NetworkArgument - methods
363// ---------------------------------------------------------------------------
364
366 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
367 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("network")) {
368}
369
370
371long
373 // get network file
374 const GNEFileDialog networkFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
375 TL("network file"),
377 getOpenMode(myOption),
379 updateFromDialog(networkFileDialog);
380 return 1;
381}
382
383
384long
386 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumo-net-file").c_str(), TRUE);
387 return 1;
388}
389
390
391long
393 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
394 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
395 } else if (OptionsCont::getOptions().getString("sumo-net-file").empty()) {
396 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
397 } else {
398 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
399 }
400}
401
402
404
405// ---------------------------------------------------------------------------
406// GNEPythonToolDialogElements::AdditionalArgument - methods
407// ---------------------------------------------------------------------------
408
410 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
411 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("additional")) {
412}
413
414
415long
417 // get additional file
418 const GNEFileDialog additionalFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
419 TL("Additional elements file"),
421 getOpenMode(myOption),
423 updateFromDialog(additionalFileDialog);
424 return 1;
425}
426
427
428long
430 myFilenameTextField->setText(OptionsCont::getOptions().getString("additional-files").c_str(), TRUE);
431 return 1;
432}
433
434
435long
437 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
438 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
439 } else if (OptionsCont::getOptions().getString("additional-files").empty()) {
440 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
441 } else {
442 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
443 }
444}
445
446
448
449// ---------------------------------------------------------------------------
450// GNEPythonToolDialogElements::RouteArgument - methods
451// ---------------------------------------------------------------------------
452
454 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
455 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("route")) {
456}
457
458
459long
461 // get route file
462 const GNEFileDialog routeFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
463 TL("Route elements file"),
465 getOpenMode(myOption),
467 updateFromDialog(routeFileDialog);
468 return 1;
469}
470
471
472long
474 myFilenameTextField->setText(OptionsCont::getOptions().getString("route-files").c_str(), TRUE);
475 return 1;
476}
477
478
479long
481 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
482 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
483 } else if (OptionsCont::getOptions().getString("route-files").empty()) {
484 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
485 } else {
486 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
487 }
488}
489
490
492
493// ---------------------------------------------------------------------------
494// GNEPythonToolDialogElements::DataArgument - methods
495// ---------------------------------------------------------------------------
496
498 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
499 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("data")) {
500}
501
502
503long
505 // get data file
506 const GNEFileDialog dataFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
507 TL("Data elements file"),
509 getOpenMode(myOption),
511 updateFromDialog(dataFileDialog);
512 return 1;
513}
514
515
516long
518 myFilenameTextField->setText(OptionsCont::getOptions().getString("data-files").c_str(), TRUE);
519 return 1;
520}
521
522
523long
525 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
526 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
527 } else if (OptionsCont::getOptions().getString("data-files").empty()) {
528 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
529 } else {
530 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
531 }
532}
533
534
536
537// ---------------------------------------------------------------------------
538// GNEPythonToolDialogElements::SumoConfigArgument - methods
539// ---------------------------------------------------------------------------
540
542 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
543 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("sumo config")) {
544}
545
546
547long
549 // get sumoConfig file
550 const GNEFileDialog sumoConfigFileDialog(myToolDialogParent->getApplicationWindow(), myToolDialogParent,
551 TL("sumo config file"),
553 getOpenMode(myOption),
555 updateFromDialog(sumoConfigFileDialog);
556 return 1;
557}
558
559
560long
562 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumocfg-file").c_str(), TRUE);
563 return 1;
564}
565
566
567long
569 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
570 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
571 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
572 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
573 } else {
574 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
575 }
576}
577
578
580
581// ---------------------------------------------------------------------------
582// GNEPythonToolDialogElements::EdgeArgument - methods
583// ---------------------------------------------------------------------------
584
586 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
587 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
588 // create text field for int
590 // set value
591 myEdgeTextField->setText(option->getValueString().c_str());
592}
593
594
595void
597 myEdgeTextField->setText(myDefaultValue.c_str());
598 myOption->set(myDefaultValue, myDefaultValue, false);
599 myOption->resetDefault();
600}
601
602
603long
605 myOption->resetWritable();
606 if (myEdgeTextField->getText().empty()) {
607 reset();
608 } else {
609 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(), false);
610 }
611 return 1;
612}
613
614
615const std::string
617 return myEdgeTextField->getText().text();
618}
619
620// ---------------------------------------------------------------------------
621// GNEPythonToolDialogElements::StringArgument - methods
622// ---------------------------------------------------------------------------
623
625 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
626 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
627 // create text field for string
629 // set value
630 myStringTextField->setText(option->getValueString().c_str());
631}
632
633
634void
636 myStringTextField->setText(myDefaultValue.c_str());
637 myOption->set(myDefaultValue, myDefaultValue, false);
638 myOption->resetDefault();
639}
640
641
642long
644 myOption->resetWritable();
645 if (myStringTextField->getText().empty()) {
646 reset();
647 } else {
648 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(), false);
649 }
650 return 1;
651}
652
653
654const std::string
656 return myStringTextField->getText().text();
657}
658
659// ---------------------------------------------------------------------------
660// GNEPythonToolDialogElements::IntArgument - methods
661// ---------------------------------------------------------------------------
662
664 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
665 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
666 // create text field for int
668 // set value
669 myIntTextField->setText(option->getValueString().c_str());
670}
671
672
673void
675 myIntTextField->setText(myDefaultValue.c_str());
676 if (myDefaultValue.empty()) {
677 myOption->set(INVALID_INT_STR, "", false);
678 } else {
679 myOption->set(myDefaultValue, myDefaultValue, false);
680 }
681 myOption->resetDefault();
682}
683
684
685long
687 myOption->resetWritable();
688 if (myIntTextField->getText().empty()) {
689 reset();
690 } else {
691 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(), false);
692 }
693 return 1;
694}
695
696
697const std::string
699 return myIntTextField->getText().text();
700}
701
702// ---------------------------------------------------------------------------
703// GNEPythonToolDialogElements::FloatArgument - methods
704// ---------------------------------------------------------------------------
705
707 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
708 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
709 // create text field for float
711 // set value
712 myFloatTextField->setText(option->getValueString().c_str());
713}
714
715
716void
718 myFloatTextField->setText(myDefaultValue.c_str());
719 if (myDefaultValue.empty()) {
720 myOption->set(INVALID_DOUBLE_STR, "", false);
721 } else {
722 myOption->set(myDefaultValue, myDefaultValue, false);
723 }
724 myOption->resetDefault();
725}
726
727
728long
730 myOption->resetWritable();
731 if (myFloatTextField->getText().empty()) {
732 reset();
733 } else {
734 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(), false);
735 }
736 return 1;
737}
738
739
740const std::string
742 return myFloatTextField->getText().text();
743}
744
745// ---------------------------------------------------------------------------
746// GNEPythonToolDialogElements::BoolArgument - methods
747// ---------------------------------------------------------------------------
748
750 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
751 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
752 // create check button
754 // set value
755 if (option->getBool()) {
756 myCheckButton->setCheck(TRUE);
757 myCheckButton->setText(TL("true"));
758 } else {
759 myCheckButton->setCheck(FALSE);
760 myCheckButton->setText(TL("false"));
761 }
762}
763
764
765void
767 if (myDefaultValue == "True") {
768 myCheckButton->setCheck(TRUE);
769 myCheckButton->setText(TL("true"));
770 } else {
771 myCheckButton->setCheck(FALSE);
772 myCheckButton->setText(TL("false"));
773 }
774 myOption->set(myDefaultValue, myDefaultValue, false);
775 myOption->resetDefault();
776}
777
778
779long
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();
787 }
788 } else {
789 myCheckButton->setText(TL("false"));
790 myOption->set("False", "False", false);
791 if (myDefaultValue == "False") {
792 myOption->resetDefault();
793 }
794 }
795 return 1;
796}
797
798
799const std::string
801 if (myCheckButton->getCheck() == TRUE) {
802 return "True";
803 } else {
804 return "False";
805 }
806}
807
808/****************************************************************************/
FXDEFMAP(GNEPythonToolDialogElements::Argument) ArgumentMap[]
@ 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
Definition GUIDesigns.h:109
#define GUIDesignTextField
Definition GUIDesigns.h:74
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:430
#define GUIDesignLabel(justify)
Definition GUIDesigns.h:245
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:92
#define GUIDesignTextColorBlue
blue color (for default text)
Definition GUIDesigns.h:41
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:194
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
Definition GUIDesigns.h:77
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition GUIDesigns.h:409
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:254
@ OPEN
open icons
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:68
const int INVALID_INT
invalid int
Definition StdDefs.h:65
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition ToString.h:289
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
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.
OpenMode
file open mode
std::string getFilename() const
Return file name, if any.
long onUpdUseCurrentAdditionalFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
long onCmdUseCurrentAdditionalFile(FXObject *, FXSelector, void *)
Called when user press use current button.
virtual long onCmdSetValue(FXObject *, FXSelector, void *)=0
Called when user changes argument value.
MFXLabelTooltip * myParameterLabel
parameter label
bool requiredAttributeSet() const
check if required attribute is set
long onUpdResetValue(FXObject *, FXSelector, void *)
Called when user press reset button.
MFXLabelTooltip * getParameterLabel() const
get parameter label
long onCmdResetValue(FXObject *, FXSelector, void *)
Called when user press reset button.
FXHorizontalFrame * myElementsFrame
auxiliar elements frame
const std::string getArgument() const
get argument
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set bool value.
BoolArgument(GNEPythonToolDialog *toolDialogParent, const GNEPythonTool *pythonTool, GNEApplicationWindow *applicationWindow, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
Category(FXVerticalFrame *argumentFrame, const std::string &category)
constructor
long onUpdUseCurrentDataFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
long onCmdUseCurrentDataFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
EdgeArgument(GNEPythonToolDialog *toolDialogParent, const GNEPythonTool *pythonTool, GNEApplicationWindow *applicationWindow, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set int value.
long onCmdUseCurrent(FXObject *, FXSelector, void *)
Called when user press use seleted edges button.
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user changes argument value.
MFXButtonTooltip * myCurrentEdgesButton
current edges button
long onUpdUseCurrent(FXObject *sender, FXSelector, void *)
enable or disable use selected edges button
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set filename.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
void updateFromDialog(const GNEFileDialog &fileDialog)
update text field depending on openMode
static const std::string INVALID_DOUBLE_STR
invalid float in string format
FloatArgument(GNEPythonToolDialog *toolDialogParent, const GNEPythonTool *pythonTool, GNEApplicationWindow *applicationWindow, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set float value.
static const std::string INVALID_INT_STR
invalid int in string format
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set int value.
IntArgument(GNEPythonToolDialog *toolDialogParent, const GNEPythonTool *pythonTool, GNEApplicationWindow *applicationWindow, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
long onCmdUseCurrentNetworkFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onUpdUseCurrentNetworkFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
long onCmdUseCurrentRouteFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
long onUpdUseCurrentRouteFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
StringArgument(GNEPythonToolDialog *toolDialogParent, const GNEPythonTool *pythonTool, GNEApplicationWindow *applicationWindow, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set string value.
long onCmdOpenFilename(FXObject *, FXSelector, void *)
Called when user press open filename button.
long onCmdUseCurrentSumoConfigFile(FXObject *, FXSelector, void *)
Called when user press use current button.
long onUpdUseCurrentSumoConfigFile(FXObject *sender, FXSelector, void *)
enable or disable use current button
static GNEFileDialog::OpenMode getOpenMode(const Option *o)
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.
Definition Option.h:74
const std::string & getDescription() const
Returns the description of what this option does.
Definition Option.cpp:202
const std::string & getListSeparator() const
retrieve list separator
Definition Option.cpp:247
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
Definition Option.cpp:269
virtual bool getBool() const
Returns the stored boolean value.
Definition Option.cpp:77
const std::string & getSubTopic() const
Returns the subtopic to which this option belongs.
Definition Option.cpp:257
bool isRequired() const
check if option is required
Definition Option.cpp:214
const std::string & getValueString() const
Returns the string-representation of the value.
Definition Option.cpp:106
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