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-2025 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
101// ---------------------------------------------------------------------------
102// GNEPythonToolDialogElements::Category - methods
103// ---------------------------------------------------------------------------
104
105GNEPythonToolDialogElements::Category::Category(FXVerticalFrame* argumentFrame, const std::string& category) :
106 FXHorizontalFrame(argumentFrame, GUIDesignAuxiliarHorizontalFrame) {
107 // create category label
108 new FXLabel(this, category.c_str(), nullptr, GUIDesignLabel(JUSTIFY_NORMAL));
109}
110
111
113
114// ---------------------------------------------------------------------------
115// GNEPythonToolDialogElements::Argument - methods
116// ---------------------------------------------------------------------------
117
119 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame,
120 const std::string& parameter, Option* option) :
121 FXHorizontalFrame(argumentFrame, GUIDesignAuxiliarHorizontalFrame),
122 myToolDialogParent(toolDialogParent),
123 myOption(option),
124 myDefaultValue(pythonTool->getDefaultValue(parameter)) {
125 // create parameter label
126 myParameterLabel = new MFXLabelTooltip(this, applicationWindow->getStaticTooltipMenu(), parameter.c_str(), nullptr, GUIDesignLabelThickedFixed(0));
127 myParameterLabel->setTipText((option->getTypeName() + ": " + option->getDescription()).c_str());
128 // set color if is required
129 if (option->isRequired()) {
131 }
132 // create horizontal frame for textField
133 myElementsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarFrame);
134 // Create reset button
136}
137
138
140
141
144 return myParameterLabel;
145}
146
147
148const std::string
150 if (getValue() != myDefaultValue) {
151 return ("-" + std::string(myParameterLabel->getText().text()) + " " + getValue() + " ");
152 } else {
153 return "";
154 }
155}
156
157
158bool
160 if (myOption->isRequired()) {
161 return getValue() != myDefaultValue;
162 } else {
163 return true;
164 }
165}
166
167
168long
170 // just reset value
171 reset();
172 return 1;
173}
174
175
176long
178 if (getValue() == myDefaultValue) {
179 return myResetButton->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
180 } else {
181 return myResetButton->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
182 }
183}
184
185
187
188// ---------------------------------------------------------------------------
189// GNEPythonToolDialogElements::FileNameArgument - methods
190// ---------------------------------------------------------------------------
191
193 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
194 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, "") {
195}
196
197
198void
200 myFilenameTextField->setText(myDefaultValue.c_str());
201 myOption->set(myDefaultValue, myDefaultValue, false);
202 myOption->resetDefault();
203}
204
205
206long
208 // get open mode
210 if (myOption->getSubTopic() == "output") {
211 if (myOption->getListSeparator() != "") {
213 } else {
215 }
216 }
217 // get file
218 const auto xmlFileDialog = GNEFileDialog(myToolDialogParent->getApplicationWindow(), TL("XML file"),
219 SUMOXMLDefinitions::XMLFileExtensions.getStrings(), openMode,
221 // check that file is valid
222 if (xmlFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
223 myFilenameTextField->setText(xmlFileDialog.getFilename().c_str(), TRUE);
224 }
225 return 1;
226}
227
228
229long
231 myOption->resetWritable();
232 if (myFilenameTextField->getText().empty()) {
233 reset();
234 } else {
235 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(), false);
236 }
237 return 1;
238}
239
240
242
243
245 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option,
246 const std::string& useCurrent) :
247 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
248 // check if create current button
249 if (useCurrent.size() > 0) {
252 myCurrentButton->setTipText(TLF("Use current % file", useCurrent).c_str());
253 }
254 // Create Open button
257 myOpenFilenameButton->setTipText(TLF("Select % file", useCurrent).c_str());
258 // create text field for filename
260 // set value
261 myFilenameTextField->setText(option->getValueString().c_str());
262}
263
264const std::string
266 return myFilenameTextField->getText().text();
267}
268
269// ---------------------------------------------------------------------------
270// GNEPythonToolDialogElements::EdgeVectorArgument - methods
271// ---------------------------------------------------------------------------
272
274 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
275 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
278 myCurrentEdgesButton->setTipText(TL("Use current selected edges"));
279 // create text field for string
281 // set value
282 myEdgeVectorTextField->setText(option->getValueString().c_str());
283}
284
285
286void
288 myEdgeVectorTextField->setText(myDefaultValue.c_str());
289 myOption->set(myDefaultValue, myDefaultValue, false);
290 myOption->resetDefault();
291}
292
293
294long
296 myOption->resetWritable();
297 if (myEdgeVectorTextField->getText().empty()) {
298 reset();
299 } else {
300 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(), false);
301 }
302 return 1;
303}
304
305
306long
308 // obtain list of selected edges
309 const auto selectedEdges = myToolDialogParent->getApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
310 // convert list to string
311 std::string selectedEdgesStr;
312 for (const auto& edge : selectedEdges) {
313 selectedEdgesStr.append(edge->getID());
314 if (edge != selectedEdges.back()) {
315 selectedEdgesStr.append(" ");
316 }
317 }
318 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
319 return 1;
320}
321
322
323long
325 // get view net
326 const auto viewNet = myToolDialogParent->getApplicationWindow()->getViewNet();
327 if (viewNet == nullptr) {
328 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
329 } else if (viewNet->getNet()->getAttributeCarriers()->getNumberOfSelectedEdges() == 0) {
330 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
331 } else {
332 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
333 }
334}
335
336
338
339
340const std::string
342 return myEdgeVectorTextField->getText().text();
343}
344
345// ---------------------------------------------------------------------------
346// GNEPythonToolDialogElements::NetworkArgument - methods
347// ---------------------------------------------------------------------------
348
350 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
351 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("network")) {
352}
353
354
355long
357 // get open mode
359 if (myOption->getSubTopic() == "output") {
360 if (myOption->getListSeparator() != "") {
362 } else {
364 }
365 }
366 // get network file
367 const auto networkFileDialog = GNEFileDialog(myToolDialogParent->getApplicationWindow(), TL("network file"),
368 SUMOXMLDefinitions::NetFileExtensions.getStrings(), openMode,
370 // check that file is valid
371 if (networkFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
372 myFilenameTextField->setText(networkFileDialog.getFilename().c_str(), TRUE);
373 }
374 return 1;
375}
376
377
378long
380 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumo-net-file").c_str(), TRUE);
381 return 1;
382}
383
384
385long
387 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
388 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
389 } else if (OptionsCont::getOptions().getString("sumo-net-file").empty()) {
390 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
391 } else {
392 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
393 }
394}
395
396
398
399// ---------------------------------------------------------------------------
400// GNEPythonToolDialogElements::AdditionalArgument - methods
401// ---------------------------------------------------------------------------
402
404 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
405 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("additional")) {
406}
407
408
409long
411 // get open mode
413 if (myOption->getSubTopic() == "output") {
414 if (myOption->getListSeparator() != "") {
416 } else {
418 }
419 }
420 // get additional file
421 const auto additionalFileDialog = GNEFileDialog(myToolDialogParent->getApplicationWindow(), TL("Additional elements file"),
424 // check that file is valid
425 if (additionalFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
426 myFilenameTextField->setText(additionalFileDialog.getFilename().c_str(), TRUE);
427 }
428 return 1;
429}
430
431
432long
434 myFilenameTextField->setText(OptionsCont::getOptions().getString("additional-files").c_str(), TRUE);
435 return 1;
436}
437
438
439long
441 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
442 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
443 } else if (OptionsCont::getOptions().getString("additional-files").empty()) {
444 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
445 } else {
446 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
447 }
448}
449
450
452
453// ---------------------------------------------------------------------------
454// GNEPythonToolDialogElements::RouteArgument - methods
455// ---------------------------------------------------------------------------
456
458 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
459 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("route")) {
460}
461
462
463long
465 // get open mode
467 if (myOption->getSubTopic() == "output") {
468 if (myOption->getListSeparator() != "") {
470 } else {
472 }
473 }
474 // get route file
475 const auto routeFileDialog = GNEFileDialog(myToolDialogParent->getApplicationWindow(), TL("Route elements file"),
476 SUMOXMLDefinitions::RouteFileExtensions.getStrings(), openMode,
478 // check that file is valid
479 if (routeFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
480 myFilenameTextField->setText(routeFileDialog.getFilename().c_str(), TRUE);
481 }
482 return 1;
483}
484
485
486long
488 myFilenameTextField->setText(OptionsCont::getOptions().getString("route-files").c_str(), TRUE);
489 return 1;
490}
491
492
493long
495 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
496 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
497 } else if (OptionsCont::getOptions().getString("route-files").empty()) {
498 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
499 } else {
500 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
501 }
502}
503
504
506
507// ---------------------------------------------------------------------------
508// GNEPythonToolDialogElements::DataArgument - methods
509// ---------------------------------------------------------------------------
510
512 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
513 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("data")) {
514}
515
516
517long
519 // get open mode
521 if (myOption->getSubTopic() == "output") {
522 if (myOption->getListSeparator() != "") {
524 } else {
526 }
527 }
528 // get data file
529 const auto dataFileDialog = GNEFileDialog(myToolDialogParent->getApplicationWindow(), TL("Data elements file"),
530 SUMOXMLDefinitions::EdgeDataFileExtensions.getStrings(), openMode,
532 // check that file is valid
533 if (dataFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
534 myFilenameTextField->setText(dataFileDialog.getFilename().c_str(), TRUE);
535 }
536 return 1;
537}
538
539
540long
542 myFilenameTextField->setText(OptionsCont::getOptions().getString("data-files").c_str(), TRUE);
543 return 1;
544}
545
546
547long
549 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
550 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
551 } else if (OptionsCont::getOptions().getString("data-files").empty()) {
552 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
553 } else {
554 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
555 }
556}
557
558
560
561// ---------------------------------------------------------------------------
562// GNEPythonToolDialogElements::SumoConfigArgument - methods
563// ---------------------------------------------------------------------------
564
566 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
567 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("sumo config")) {
568}
569
570
571long
573 // get open mode
575 if (myOption->getSubTopic() == "output") {
576 if (myOption->getListSeparator() != "") {
578 } else {
580 }
581 }
582 // get sumoConfig file
583 const auto sumoConfigFileDialog = GNEFileDialog(myToolDialogParent->getApplicationWindow(), TL("sumo config file"),
586 // check that file is valid
587 if (sumoConfigFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
588 myFilenameTextField->setText(sumoConfigFileDialog.getFilename().c_str(), TRUE);
589 }
590 return 1;
591}
592
593
594long
596 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumocfg-file").c_str(), TRUE);
597 return 1;
598}
599
600
601long
603 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
604 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
605 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
606 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
607 } else {
608 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
609 }
610}
611
612
614
615// ---------------------------------------------------------------------------
616// GNEPythonToolDialogElements::EdgeArgument - methods
617// ---------------------------------------------------------------------------
618
620 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
621 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
622 // create text field for int
624 // set value
625 myEdgeTextField->setText(option->getValueString().c_str());
626}
627
628
629void
631 myEdgeTextField->setText(myDefaultValue.c_str());
632 myOption->set(myDefaultValue, myDefaultValue, false);
633 myOption->resetDefault();
634}
635
636
637long
639 myOption->resetWritable();
640 if (myEdgeTextField->getText().empty()) {
641 reset();
642 } else {
643 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(), false);
644 }
645 return 1;
646}
647
648
649const std::string
651 return myEdgeTextField->getText().text();
652}
653
654// ---------------------------------------------------------------------------
655// GNEPythonToolDialogElements::StringArgument - methods
656// ---------------------------------------------------------------------------
657
659 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
660 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
661 // create text field for string
663 // set value
664 myStringTextField->setText(option->getValueString().c_str());
665}
666
667
668void
670 myStringTextField->setText(myDefaultValue.c_str());
671 myOption->set(myDefaultValue, myDefaultValue, false);
672 myOption->resetDefault();
673}
674
675
676long
678 myOption->resetWritable();
679 if (myStringTextField->getText().empty()) {
680 reset();
681 } else {
682 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(), false);
683 }
684 return 1;
685}
686
687
688const std::string
690 return myStringTextField->getText().text();
691}
692
693// ---------------------------------------------------------------------------
694// GNEPythonToolDialogElements::IntArgument - methods
695// ---------------------------------------------------------------------------
696
698 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
699 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
700 // create text field for int
702 // set value
703 myIntTextField->setText(option->getValueString().c_str());
704}
705
706
707void
709 myIntTextField->setText(myDefaultValue.c_str());
710 if (myDefaultValue.empty()) {
711 myOption->set(INVALID_INT_STR, "", false);
712 } else {
713 myOption->set(myDefaultValue, myDefaultValue, false);
714 }
715 myOption->resetDefault();
716}
717
718
719long
721 myOption->resetWritable();
722 if (myIntTextField->getText().empty()) {
723 reset();
724 } else {
725 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(), false);
726 }
727 return 1;
728}
729
730
731const std::string
733 return myIntTextField->getText().text();
734}
735
736// ---------------------------------------------------------------------------
737// GNEPythonToolDialogElements::FloatArgument - methods
738// ---------------------------------------------------------------------------
739
741 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
742 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
743 // create text field for float
745 // set value
746 myFloatTextField->setText(option->getValueString().c_str());
747}
748
749
750void
752 myFloatTextField->setText(myDefaultValue.c_str());
753 if (myDefaultValue.empty()) {
754 myOption->set(INVALID_DOUBLE_STR, "", false);
755 } else {
756 myOption->set(myDefaultValue, myDefaultValue, false);
757 }
758 myOption->resetDefault();
759}
760
761
762long
764 myOption->resetWritable();
765 if (myFloatTextField->getText().empty()) {
766 reset();
767 } else {
768 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(), false);
769 }
770 return 1;
771}
772
773
774const std::string
776 return myFloatTextField->getText().text();
777}
778
779// ---------------------------------------------------------------------------
780// GNEPythonToolDialogElements::BoolArgument - methods
781// ---------------------------------------------------------------------------
782
784 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
785 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
786 // create check button
788 // set value
789 if (option->getBool()) {
790 myCheckButton->setCheck(TRUE);
791 myCheckButton->setText(TL("true"));
792 } else {
793 myCheckButton->setCheck(FALSE);
794 myCheckButton->setText(TL("false"));
795 }
796}
797
798
799void
801 if (myDefaultValue == "True") {
802 myCheckButton->setCheck(TRUE);
803 myCheckButton->setText(TL("true"));
804 } else {
805 myCheckButton->setCheck(FALSE);
806 myCheckButton->setText(TL("false"));
807 }
808 myOption->set(myDefaultValue, myDefaultValue, false);
809 myOption->resetDefault();
810}
811
812
813long
815 myOption->resetWritable();
816 if (myCheckButton->getCheck() == TRUE) {
817 myCheckButton->setText(TL("true"));
818 myOption->set("True", "True", false);
819 if (myDefaultValue == "True") {
820 myOption->resetDefault();
821 }
822 } else {
823 myCheckButton->setText(TL("false"));
824 myOption->set("False", "False", false);
825 if (myDefaultValue == "False") {
826 myOption->resetDefault();
827 }
828 }
829 return 1;
830}
831
832
833const std::string
835 if (myCheckButton->getCheck() == TRUE) {
836 return "True";
837 } else {
838 return "False";
839 }
840}
841
842/****************************************************************************/
FXDEFMAP(GNEPythonToolDialogElements::Argument) ArgumentMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:993
@ 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 toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
The main window of Netedit.
OpenMode
file open mode
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
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.
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
elements used in Tool Dialogs
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
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.
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
Definition json.hpp:4471