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-2024 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
23#include <netedit/GNEViewNet.h>
24#include <netedit/GNENet.h>
29
31#include "GNEPythonToolDialog.h"
32
33// ===========================================================================
34// static members
35// ===========================================================================
36
39
40// ===========================================================================
41// FOX callback mapping
42// ===========================================================================
43
49
53
58
64
70
76
82
88
89// Object implementation
90FXIMPLEMENT_ABSTRACT(GNEPythonToolDialogElements::Argument, FXHorizontalFrame, ArgumentMap, ARRAYNUMBER(ArgumentMap))
91FXIMPLEMENT(GNEPythonToolDialogElements::EdgeVectorArgument, GNEPythonToolDialogElements::Argument, EdgeVectorArgumentMap, ARRAYNUMBER(EdgeVectorArgumentMap))
92FXIMPLEMENT(GNEPythonToolDialogElements::FileNameArgument, GNEPythonToolDialogElements::Argument, FileNameArgumentMap, ARRAYNUMBER(FileNameArgumentMap))
93FXIMPLEMENT(GNEPythonToolDialogElements::NetworkArgument, GNEPythonToolDialogElements::FileNameArgument, NetworkArgumentMap, ARRAYNUMBER(NetworkArgumentMap))
94FXIMPLEMENT(GNEPythonToolDialogElements::AdditionalArgument, GNEPythonToolDialogElements::FileNameArgument, AdditionalArgumentMap, ARRAYNUMBER(AdditionalArgumentMap))
95FXIMPLEMENT(GNEPythonToolDialogElements::RouteArgument, GNEPythonToolDialogElements::FileNameArgument, RouteArgumentMap, ARRAYNUMBER(RouteArgumentMap))
96FXIMPLEMENT(GNEPythonToolDialogElements::DataArgument, GNEPythonToolDialogElements::FileNameArgument, DataArgumentMap, ARRAYNUMBER(DataArgumentMap))
97FXIMPLEMENT(GNEPythonToolDialogElements::SumoConfigArgument, GNEPythonToolDialogElements::FileNameArgument, SumoConfigArgumentMap, ARRAYNUMBER(SumoConfigArgumentMap))
98
99
100// ===========================================================================
101// member method definitions
102// ===========================================================================
103
104// ---------------------------------------------------------------------------
105// GNEPythonToolDialogElements::Category - methods
106// ---------------------------------------------------------------------------
107
108GNEPythonToolDialogElements::Category::Category(FXVerticalFrame* argumentFrame, const std::string& category) :
109 FXHorizontalFrame(argumentFrame, GUIDesignAuxiliarHorizontalFrame) {
110 // create category label
111 new FXLabel(this, category.c_str(), nullptr, GUIDesignLabel(JUSTIFY_NORMAL));
112 // create category
113 create();
114}
115
116
118
119// ---------------------------------------------------------------------------
120// GNEPythonToolDialogElements::Argument - methods
121// ---------------------------------------------------------------------------
122
123GNEPythonToolDialogElements::Argument::Argument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string& parameter, Option* option) :
124 FXHorizontalFrame(argumentFrame, GUIDesignAuxiliarHorizontalFrame),
125 myToolDialogParent(toolDialogParent),
126 myOption(option),
127 myDefaultValue(toolDialogParent->getPythonTool()->getDefaultValue(parameter)) {
128 // create parameter label
129 myParameterLabel = new MFXLabelTooltip(this, toolDialogParent->myGNEApp->getStaticTooltipMenu(), parameter.c_str(), nullptr, GUIDesignLabelThickedFixed(0));
130 myParameterLabel->setTipText((option->getTypeName() + ": " + option->getDescription()).c_str());
131 // set color if is required
132 if (option->isRequired()) {
133 myParameterLabel->setTextColor(FXRGB(0, 0, 255));
134 }
135 // create horizontal frame for textField
136 myElementsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarFrame);
137 // Create reset button
139 // create argument
140 create();
141}
142
143
145
146
149 return myParameterLabel;
150}
151
152
153const std::string
155 if (getValue() != myDefaultValue) {
156 return ("-" + std::string(myParameterLabel->getText().text()) + " " + getValue() + " ");
157 } else {
158 return "";
159 }
160}
161
162
163bool
165 if (myOption->isRequired()) {
166 return getValue() != myDefaultValue;
167 } else {
168 return true;
169 }
170}
171
172
173long
175 // just reset value
176 reset();
177 return 1;
178}
179
180
181long
183 if (getValue() == myDefaultValue) {
184 return myResetButton->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
185 } else {
186 return myResetButton->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
187 }
188}
189
190
192
193// ---------------------------------------------------------------------------
194// GNEPythonToolDialogElements::FileNameArgument - methods
195// ---------------------------------------------------------------------------
196
198 const std::string name, Option* option) :
199 FileNameArgument(toolDialogParent, argumentFrame, name, option, "") {
200}
201
202
203void
205 myFilenameTextField->setText(myDefaultValue.c_str());
206 myOption->set(myDefaultValue, myDefaultValue, false);
207 myOption->resetDefault();
208}
209
210
211long
213 // get file
214 const auto file = GNEApplicationWindowHelper::openFileDialog(this, (myOption->getSubTopic() == "output"), myOption->getListSeparator() != "");
215 // check that file is valid
216 if (file.size() > 0) {
217 myFilenameTextField->setText(file.c_str(), TRUE);
218 }
219 return 1;
220}
221
222
223long
225 myOption->resetWritable();
226 if (myFilenameTextField->getText().empty()) {
227 reset();
228 } else {
229 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(), false);
230 }
231 return 1;
232}
233
234
236
237
239 const std::string name, Option* option, const std::string& useCurrent) :
240 Argument(toolDialogParent, argumentFrame, name, option) {
241 // check if create current button
242 if (useCurrent.size() > 0) {
245 myCurrentButton->setTipText(TLF("Use current % file", useCurrent).c_str());
246 myCurrentButton->create();
247 }
248 // Create Open button
251 myOpenFilenameButton->setTipText(TLF("Select % file", useCurrent).c_str());
252 myOpenFilenameButton->create();
253 // create text field for filename
255 myFilenameTextField->create();
256 // set value
257 myFilenameTextField->setText(option->getValueString().c_str());
258}
259
260const std::string
262 return myFilenameTextField->getText().text();
263}
264
265// ---------------------------------------------------------------------------
266// GNEPythonToolDialogElements::EdgeVectorArgument - methods
267// ---------------------------------------------------------------------------
268
270 const std::string name, Option* option) :
271 Argument(toolDialogParent, argumentFrame, name, option) {
274 myCurrentEdgesButton->setTipText(TL("Use current selected edges"));
275 myCurrentEdgesButton->create();
276 // create text field for string
278 myEdgeVectorTextField->create();
279 // set value
280 myEdgeVectorTextField->setText(option->getValueString().c_str());
281}
282
283
284void
286 myEdgeVectorTextField->setText(myDefaultValue.c_str());
287 myOption->set(myDefaultValue, myDefaultValue, false);
288 myOption->resetDefault();
289}
290
291
292long
294 myOption->resetWritable();
295 if (myEdgeVectorTextField->getText().empty()) {
296 reset();
297 } else {
298 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(), false);
299 }
300 return 1;
301}
302
303
304long
306 // obtain list of selected edges
307 const auto selectedEdges = myToolDialogParent->getGNEApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
308 // convert list to string
309 std::string selectedEdgesStr;
310 for (const auto& edge : selectedEdges) {
311 selectedEdgesStr.append(edge->getID());
312 if (edge != selectedEdges.back()) {
313 selectedEdgesStr.append(" ");
314 }
315 }
316 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
317 return 1;
318}
319
320
321long
323 // get view net
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);
329 } else {
330 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
331 }
332}
333
334
336
337
338const std::string
340 return myEdgeVectorTextField->getText().text();
341}
342
343// ---------------------------------------------------------------------------
344// GNEPythonToolDialogElements::NetworkArgument - methods
345// ---------------------------------------------------------------------------
346
348 const std::string name, Option* option) :
349 FileNameArgument(toolDialogParent, argumentFrame, name, option, TL("network")) {
350}
351
352
353long
355 // get network file
356 const auto networkFile = GNEApplicationWindowHelper::openNetworkFileDialog(this, (myOption->getSubTopic() == "output"), myOption->getListSeparator() != "");
357 // check that file is valid
358 if (networkFile.size() > 0) {
359 myFilenameTextField->setText(networkFile.c_str(), TRUE);
360 }
361 return 1;
362}
363
364
365long
367 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumo-net-file").c_str(), TRUE);
368 return 1;
369}
370
371
372long
374 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() == nullptr) {
375 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
376 } else if (OptionsCont::getOptions().getString("sumo-net-file").empty()) {
377 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
378 } else {
379 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
380 }
381}
382
383
385
386// ---------------------------------------------------------------------------
387// GNEPythonToolDialogElements::AdditionalArgument - methods
388// ---------------------------------------------------------------------------
389
391 const std::string name, Option* option) :
392 FileNameArgument(toolDialogParent, argumentFrame, name, option, TL("additional")) {
393}
394
395
396long
398 // get additional file
399 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, (myOption->getSubTopic() == "output"), myOption->getListSeparator() != "");
400 // check that file is valid
401 if (additionalFile.size() > 0) {
402 myFilenameTextField->setText(additionalFile.c_str(), TRUE);
403 }
404 return 1;
405}
406
407
408long
410 myFilenameTextField->setText(OptionsCont::getOptions().getString("additional-files").c_str(), TRUE);
411 return 1;
412}
413
414
415long
417 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() == nullptr) {
418 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
419 } else if (OptionsCont::getOptions().getString("additional-files").empty()) {
420 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
421 } else {
422 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
423 }
424}
425
426
428
429// ---------------------------------------------------------------------------
430// GNEPythonToolDialogElements::RouteArgument - methods
431// ---------------------------------------------------------------------------
432
434 const std::string name, Option* option) :
435 FileNameArgument(toolDialogParent, argumentFrame, name, option, TL("route")) {
436}
437
438
439long
441 // get route file
442 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, (myOption->getSubTopic() == "output"), myOption->getListSeparator() != "");
443 // check that file is valid
444 if (routeFile.size() > 0) {
445 myFilenameTextField->setText(routeFile.c_str(), TRUE);
446 }
447 return 1;
448}
449
450
451long
453 myFilenameTextField->setText(OptionsCont::getOptions().getString("route-files").c_str(), TRUE);
454 return 1;
455}
456
457
458long
460 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() == nullptr) {
461 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
462 } else if (OptionsCont::getOptions().getString("route-files").empty()) {
463 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
464 } else {
465 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
466 }
467}
468
469
471
472// ---------------------------------------------------------------------------
473// GNEPythonToolDialogElements::DataArgument - methods
474// ---------------------------------------------------------------------------
475
476GNEPythonToolDialogElements::DataArgument::DataArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame,
477 const std::string name, Option* option) :
478 FileNameArgument(toolDialogParent, argumentFrame, name, option, TL("data")) {
479}
480
481
482long
484 // get data file
485 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, (myOption->getSubTopic() == "output"), myOption->getListSeparator() != "");
486 // check that file is valid
487 if (dataFile.size() > 0) {
488 myFilenameTextField->setText(dataFile.c_str(), TRUE);
489 }
490 return 1;
491}
492
493
494long
496 myFilenameTextField->setText(OptionsCont::getOptions().getString("data-files").c_str(), TRUE);
497 return 1;
498}
499
500
501long
503 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() == nullptr) {
504 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
505 } else if (OptionsCont::getOptions().getString("data-files").empty()) {
506 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
507 } else {
508 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
509 }
510}
511
512
514
515// ---------------------------------------------------------------------------
516// GNEPythonToolDialogElements::SumoConfigArgument - methods
517// ---------------------------------------------------------------------------
518
520 const std::string name, Option* option) :
521 FileNameArgument(toolDialogParent, argumentFrame, name, option, TL("sumo config")) {
522}
523
524
525long
527 // get sumoConfig file
528 const auto sumoConfigFile = GNEApplicationWindowHelper::openSumoConfigFileDialog(this, (myOption->getSubTopic() == "output"), myOption->getListSeparator() != "");
529 // check that file is valid
530 if (sumoConfigFile.size() > 0) {
531 myFilenameTextField->setText(sumoConfigFile.c_str(), TRUE);
532 }
533 return 1;
534}
535
536
537long
539 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumocfg-file").c_str(), TRUE);
540 return 1;
541}
542
543
544long
546 if (myToolDialogParent->getGNEApplicationWindow()->getViewNet() == nullptr) {
547 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
548 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
549 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
550 } else {
551 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
552 }
553}
554
555
557
558// ---------------------------------------------------------------------------
559// GNEPythonToolDialogElements::EdgeArgument - methods
560// ---------------------------------------------------------------------------
561
562GNEPythonToolDialogElements::EdgeArgument::EdgeArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
563 Argument(toolDialogParent, argumentFrame, name, option) {
564 // create text field for int
566 myEdgeTextField->create();
567 // set value
568 myEdgeTextField->setText(option->getValueString().c_str());
569}
570
571
572void
574 myEdgeTextField->setText(myDefaultValue.c_str());
575 myOption->set(myDefaultValue, myDefaultValue, false);
576 myOption->resetDefault();
577}
578
579
580long
582 myOption->resetWritable();
583 if (myEdgeTextField->getText().empty()) {
584 reset();
585 } else {
586 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(), false);
587 }
588 return 1;
589}
590
591
592const std::string
594 return myEdgeTextField->getText().text();
595}
596
597// ---------------------------------------------------------------------------
598// GNEPythonToolDialogElements::StringArgument - methods
599// ---------------------------------------------------------------------------
600
601GNEPythonToolDialogElements::StringArgument::StringArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
602 Argument(toolDialogParent, argumentFrame, name, option) {
603 // create text field for string
605 myStringTextField->create();
606 // set value
607 myStringTextField->setText(option->getValueString().c_str());
608}
609
610
611void
613 myStringTextField->setText(myDefaultValue.c_str());
614 myOption->set(myDefaultValue, myDefaultValue, false);
615 myOption->resetDefault();
616}
617
618
619long
621 myOption->resetWritable();
622 if (myStringTextField->getText().empty()) {
623 reset();
624 } else {
625 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(), false);
626 }
627 return 1;
628}
629
630
631const std::string
633 return myStringTextField->getText().text();
634}
635
636// ---------------------------------------------------------------------------
637// GNEPythonToolDialogElements::IntArgument - methods
638// ---------------------------------------------------------------------------
639
640GNEPythonToolDialogElements::IntArgument::IntArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
641 Argument(toolDialogParent, argumentFrame, name, option) {
642 // create text field for int
644 myIntTextField->create();
645 // set value
646 myIntTextField->setText(option->getValueString().c_str());
647}
648
649
650void
652 myIntTextField->setText(myDefaultValue.c_str());
653 if (myDefaultValue.empty()) {
654 myOption->set(INVALID_INT_STR, "", false);
655 } else {
656 myOption->set(myDefaultValue, myDefaultValue, false);
657 }
658 myOption->resetDefault();
659}
660
661
662long
664 myOption->resetWritable();
665 if (myIntTextField->getText().empty()) {
666 reset();
667 } else {
668 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(), false);
669 }
670 return 1;
671}
672
673
674const std::string
676 return myIntTextField->getText().text();
677}
678
679// ---------------------------------------------------------------------------
680// GNEPythonToolDialogElements::FloatArgument - methods
681// ---------------------------------------------------------------------------
682
683GNEPythonToolDialogElements::FloatArgument::FloatArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
684 Argument(toolDialogParent, argumentFrame, name, option) {
685 // create text field for float
687 myFloatTextField->create();
688 // set value
689 myFloatTextField->setText(option->getValueString().c_str());
690}
691
692
693void
695 myFloatTextField->setText(myDefaultValue.c_str());
696 if (myDefaultValue.empty()) {
697 myOption->set(INVALID_DOUBLE_STR, "", false);
698 } else {
699 myOption->set(myDefaultValue, myDefaultValue, false);
700 }
701 myOption->resetDefault();
702}
703
704
705long
707 myOption->resetWritable();
708 if (myFloatTextField->getText().empty()) {
709 reset();
710 } else {
711 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(), false);
712 }
713 return 1;
714}
715
716
717const std::string
719 return myFloatTextField->getText().text();
720}
721
722// ---------------------------------------------------------------------------
723// GNEPythonToolDialogElements::BoolArgument - methods
724// ---------------------------------------------------------------------------
725
726GNEPythonToolDialogElements::BoolArgument::BoolArgument(GNEPythonToolDialog* toolDialogParent, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
727 Argument(toolDialogParent, argumentFrame, name, option) {
728 // create check button
730 myCheckButton->create();
731 // set value
732 if (option->getBool()) {
733 myCheckButton->setCheck(TRUE);
734 myCheckButton->setText(TL("true"));
735 } else {
736 myCheckButton->setCheck(FALSE);
737 myCheckButton->setText(TL("false"));
738 }
739}
740
741
742void
744 if (myDefaultValue == "True") {
745 myCheckButton->setCheck(TRUE);
746 myCheckButton->setText(TL("true"));
747 } else {
748 myCheckButton->setCheck(FALSE);
749 myCheckButton->setText(TL("false"));
750 }
751 myOption->set(myDefaultValue, myDefaultValue, false);
752 myOption->resetDefault();
753}
754
755
756long
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();
764 }
765 } else {
766 myCheckButton->setText(TL("false"));
767 myOption->set("False", "False", false);
768 if (myDefaultValue == "False") {
769 myOption->resetDefault();
770 }
771 }
772 return 1;
773}
774
775
776const std::string
778 if (myCheckButton->getCheck() == TRUE) {
779 return "True";
780 } else {
781 return "False";
782 }
783}
784
785/****************************************************************************/
FXDEFMAP(GNEPythonToolDialogElements::Argument) ArgumentMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:935
@ MID_GNE_SELECT
select element
Definition GUIAppEnum.h:953
@ MID_GNE_USE_CURRENT
use current network/additional/route/edgedata
@ MID_GNE_RESET
reset element
Definition GUIAppEnum.h:943
#define GUIDesignButtonIcon
button only with icon
Definition GUIDesigns.h:97
#define GUIDesignTextField
Definition GUIDesigns.h:65
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignLabel(justify)
Definition GUIDesigns.h:249
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:198
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
Definition GUIDesigns.h:68
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
Definition GUIDesigns.h:396
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:258
@ OPEN
open icons
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:64
const int INVALID_INT
invalid int
Definition StdDefs.h:61
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
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, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
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, 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.
FloatArgument(GNEPythonToolDialog *toolDialogParent, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
static const std::string INVALID_DOUBLE_STR
invalid float in string format
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set float value.
static const std::string INVALID_INT_STR
invalid int in string format
IntArgument(GNEPythonToolDialog *toolDialogParent, FXVerticalFrame *argumentFrame, const std::string name, Option *option)
constructor
long onCmdSetValue(FXObject *, FXSelector, void *)
Called when user set int value.
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, 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
elements used in Tool Dialogs
Dialog for python tool dialog.
GNEApplicationWindow * myGNEApp
pointer to GNEApplicationWindow
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:72
const std::string & getDescription() const
Returns the description of what this option does.
Definition Option.cpp:202
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
Definition Option.cpp:257
virtual bool getBool() const
Returns the stored boolean value.
Definition Option.cpp:77
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.
Definition json.hpp:4471
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