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->getListSeparator() != "") {
212 }
213 // get file
214 const auto xmlFileDialog = GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
215 TL("XML file"),
216 SUMOXMLDefinitions::XMLFileExtensions.getStrings(), openMode,
218 // check that file is valid
219 if (xmlFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
220 myFilenameTextField->setText(xmlFileDialog.getFilename().c_str(), TRUE);
221 }
222 return 1;
223}
224
225
226long
228 myOption->resetWritable();
229 if (myFilenameTextField->getText().empty()) {
230 reset();
231 } else {
232 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(), false);
233 }
234 return 1;
235}
236
237
239
240
242 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option,
243 const std::string& useCurrent) :
244 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
245 // check if create current button
246 if (useCurrent.size() > 0) {
249 myCurrentButton->setTipText(TLF("Use current % file", useCurrent).c_str());
250 }
251 // Create Open button
254 myOpenFilenameButton->setTipText(TLF("Select % file", useCurrent).c_str());
255 // create text field for filename
257 // set value
258 myFilenameTextField->setText(option->getValueString().c_str());
259}
260
261const std::string
263 return myFilenameTextField->getText().text();
264}
265
266// ---------------------------------------------------------------------------
267// GNEPythonToolDialogElements::EdgeVectorArgument - methods
268// ---------------------------------------------------------------------------
269
271 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
272 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
275 myCurrentEdgesButton->setTipText(TL("Use current selected edges"));
276 // create text field for string
278 // set value
279 myEdgeVectorTextField->setText(option->getValueString().c_str());
280}
281
282
283void
285 myEdgeVectorTextField->setText(myDefaultValue.c_str());
286 myOption->set(myDefaultValue, myDefaultValue, false);
287 myOption->resetDefault();
288}
289
290
291long
293 myOption->resetWritable();
294 if (myEdgeVectorTextField->getText().empty()) {
295 reset();
296 } else {
297 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(), false);
298 }
299 return 1;
300}
301
302
303long
305 // obtain list of selected edges
306 const auto selectedEdges = myToolDialogParent->getApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
307 // convert list to string
308 std::string selectedEdgesStr;
309 for (const auto& edge : selectedEdges) {
310 selectedEdgesStr.append(edge->getID());
311 if (edge != selectedEdges.back()) {
312 selectedEdgesStr.append(" ");
313 }
314 }
315 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
316 return 1;
317}
318
319
320long
322 // get view net
323 const auto viewNet = myToolDialogParent->getApplicationWindow()->getViewNet();
324 if (viewNet == nullptr) {
325 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
326 } else if (viewNet->getNet()->getAttributeCarriers()->getNumberOfSelectedEdges() == 0) {
327 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
328 } else {
329 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
330 }
331}
332
333
335
336
337const std::string
339 return myEdgeVectorTextField->getText().text();
340}
341
342// ---------------------------------------------------------------------------
343// GNEPythonToolDialogElements::NetworkArgument - methods
344// ---------------------------------------------------------------------------
345
347 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
348 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("network")) {
349}
350
351
352long
354 // get open mode
356 if (myOption->getListSeparator() != "") {
358 }
359 // get network file
360 const auto networkFileDialog = GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
361 TL("network file"),
362 SUMOXMLDefinitions::NetFileExtensions.getStrings(), openMode,
364 // check that file is valid
365 if (networkFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
366 myFilenameTextField->setText(networkFileDialog.getFilename().c_str(), TRUE);
367 }
368 return 1;
369}
370
371
372long
374 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumo-net-file").c_str(), TRUE);
375 return 1;
376}
377
378
379long
381 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
382 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
383 } else if (OptionsCont::getOptions().getString("sumo-net-file").empty()) {
384 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
385 } else {
386 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
387 }
388}
389
390
392
393// ---------------------------------------------------------------------------
394// GNEPythonToolDialogElements::AdditionalArgument - methods
395// ---------------------------------------------------------------------------
396
398 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
399 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("additional")) {
400}
401
402
403long
405 // get open mode
407 if (myOption->getListSeparator() != "") {
409 }
410 // get additional file
411 const auto additionalFileDialog = GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
412 TL("Additional elements file"),
415 // check that file is valid
416 if (additionalFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
417 myFilenameTextField->setText(additionalFileDialog.getFilename().c_str(), TRUE);
418 }
419 return 1;
420}
421
422
423long
425 myFilenameTextField->setText(OptionsCont::getOptions().getString("additional-files").c_str(), TRUE);
426 return 1;
427}
428
429
430long
432 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
433 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
434 } else if (OptionsCont::getOptions().getString("additional-files").empty()) {
435 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
436 } else {
437 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
438 }
439}
440
441
443
444// ---------------------------------------------------------------------------
445// GNEPythonToolDialogElements::RouteArgument - methods
446// ---------------------------------------------------------------------------
447
449 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
450 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("route")) {
451}
452
453
454long
456 // get open mode
458 if (myOption->getListSeparator() != "") {
460 }
461 // get route file
462 const auto routeFileDialog = GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
463 TL("Route elements file"),
464 SUMOXMLDefinitions::RouteFileExtensions.getStrings(), openMode,
466 // check that file is valid
467 if (routeFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
468 myFilenameTextField->setText(routeFileDialog.getFilename().c_str(), TRUE);
469 }
470 return 1;
471}
472
473
474long
476 myFilenameTextField->setText(OptionsCont::getOptions().getString("route-files").c_str(), TRUE);
477 return 1;
478}
479
480
481long
483 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
484 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
485 } else if (OptionsCont::getOptions().getString("route-files").empty()) {
486 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
487 } else {
488 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
489 }
490}
491
492
494
495// ---------------------------------------------------------------------------
496// GNEPythonToolDialogElements::DataArgument - methods
497// ---------------------------------------------------------------------------
498
500 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
501 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("data")) {
502}
503
504
505long
507 // get open mode
509 if (myOption->getListSeparator() != "") {
511 }
512 // get data file
513 const auto dataFileDialog = GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
514 TL("Data elements file"),
515 SUMOXMLDefinitions::EdgeDataFileExtensions.getStrings(), openMode,
517 // check that file is valid
518 if (dataFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
519 myFilenameTextField->setText(dataFileDialog.getFilename().c_str(), TRUE);
520 }
521 return 1;
522}
523
524
525long
527 myFilenameTextField->setText(OptionsCont::getOptions().getString("data-files").c_str(), TRUE);
528 return 1;
529}
530
531
532long
534 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
535 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
536 } else if (OptionsCont::getOptions().getString("data-files").empty()) {
537 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
538 } else {
539 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
540 }
541}
542
543
545
546// ---------------------------------------------------------------------------
547// GNEPythonToolDialogElements::SumoConfigArgument - methods
548// ---------------------------------------------------------------------------
549
551 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
552 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option, TL("sumo config")) {
553}
554
555
556long
558 // get open mode
560 if (myOption->getListSeparator() != "") {
562 }
563 // get sumoConfig file
564 const auto sumoConfigFileDialog = GNEFileDialog(myToolDialogParent, myToolDialogParent->getApplicationWindow(),
565 TL("sumo config file"),
568 // check that file is valid
569 if (sumoConfigFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
570 myFilenameTextField->setText(sumoConfigFileDialog.getFilename().c_str(), TRUE);
571 }
572 return 1;
573}
574
575
576long
578 myFilenameTextField->setText(OptionsCont::getOptions().getString("sumocfg-file").c_str(), TRUE);
579 return 1;
580}
581
582
583long
585 if (myToolDialogParent->getApplicationWindow()->getViewNet() == nullptr) {
586 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
587 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
588 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
589 } else {
590 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
591 }
592}
593
594
596
597// ---------------------------------------------------------------------------
598// GNEPythonToolDialogElements::EdgeArgument - methods
599// ---------------------------------------------------------------------------
600
602 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
603 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
604 // create text field for int
606 // set value
607 myEdgeTextField->setText(option->getValueString().c_str());
608}
609
610
611void
613 myEdgeTextField->setText(myDefaultValue.c_str());
614 myOption->set(myDefaultValue, myDefaultValue, false);
615 myOption->resetDefault();
616}
617
618
619long
621 myOption->resetWritable();
622 if (myEdgeTextField->getText().empty()) {
623 reset();
624 } else {
625 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(), false);
626 }
627 return 1;
628}
629
630
631const std::string
633 return myEdgeTextField->getText().text();
634}
635
636// ---------------------------------------------------------------------------
637// GNEPythonToolDialogElements::StringArgument - methods
638// ---------------------------------------------------------------------------
639
641 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
642 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
643 // create text field for string
645 // set value
646 myStringTextField->setText(option->getValueString().c_str());
647}
648
649
650void
652 myStringTextField->setText(myDefaultValue.c_str());
653 myOption->set(myDefaultValue, myDefaultValue, false);
654 myOption->resetDefault();
655}
656
657
658long
660 myOption->resetWritable();
661 if (myStringTextField->getText().empty()) {
662 reset();
663 } else {
664 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(), false);
665 }
666 return 1;
667}
668
669
670const std::string
672 return myStringTextField->getText().text();
673}
674
675// ---------------------------------------------------------------------------
676// GNEPythonToolDialogElements::IntArgument - methods
677// ---------------------------------------------------------------------------
678
680 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
681 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
682 // create text field for int
684 // set value
685 myIntTextField->setText(option->getValueString().c_str());
686}
687
688
689void
691 myIntTextField->setText(myDefaultValue.c_str());
692 if (myDefaultValue.empty()) {
693 myOption->set(INVALID_INT_STR, "", false);
694 } else {
695 myOption->set(myDefaultValue, myDefaultValue, false);
696 }
697 myOption->resetDefault();
698}
699
700
701long
703 myOption->resetWritable();
704 if (myIntTextField->getText().empty()) {
705 reset();
706 } else {
707 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(), false);
708 }
709 return 1;
710}
711
712
713const std::string
715 return myIntTextField->getText().text();
716}
717
718// ---------------------------------------------------------------------------
719// GNEPythonToolDialogElements::FloatArgument - methods
720// ---------------------------------------------------------------------------
721
723 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
724 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
725 // create text field for float
727 // set value
728 myFloatTextField->setText(option->getValueString().c_str());
729}
730
731
732void
734 myFloatTextField->setText(myDefaultValue.c_str());
735 if (myDefaultValue.empty()) {
736 myOption->set(INVALID_DOUBLE_STR, "", false);
737 } else {
738 myOption->set(myDefaultValue, myDefaultValue, false);
739 }
740 myOption->resetDefault();
741}
742
743
744long
746 myOption->resetWritable();
747 if (myFloatTextField->getText().empty()) {
748 reset();
749 } else {
750 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(), false);
751 }
752 return 1;
753}
754
755
756const std::string
758 return myFloatTextField->getText().text();
759}
760
761// ---------------------------------------------------------------------------
762// GNEPythonToolDialogElements::BoolArgument - methods
763// ---------------------------------------------------------------------------
764
766 GNEApplicationWindow* applicationWindow, FXVerticalFrame* argumentFrame, const std::string name, Option* option) :
767 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
768 // create check button
770 // set value
771 if (option->getBool()) {
772 myCheckButton->setCheck(TRUE);
773 myCheckButton->setText(TL("true"));
774 } else {
775 myCheckButton->setCheck(FALSE);
776 myCheckButton->setText(TL("false"));
777 }
778}
779
780
781void
783 if (myDefaultValue == "True") {
784 myCheckButton->setCheck(TRUE);
785 myCheckButton->setText(TL("true"));
786 } else {
787 myCheckButton->setCheck(FALSE);
788 myCheckButton->setText(TL("false"));
789 }
790 myOption->set(myDefaultValue, myDefaultValue, false);
791 myOption->resetDefault();
792}
793
794
795long
797 myOption->resetWritable();
798 if (myCheckButton->getCheck() == TRUE) {
799 myCheckButton->setText(TL("true"));
800 myOption->set("True", "True", false);
801 if (myDefaultValue == "True") {
802 myOption->resetDefault();
803 }
804 } else {
805 myCheckButton->setText(TL("false"));
806 myOption->set("False", "False", false);
807 if (myDefaultValue == "False") {
808 myOption->resetDefault();
809 }
810 }
811 return 1;
812}
813
814
815const std::string
817 if (myCheckButton->getCheck() == TRUE) {
818 return "True";
819 } else {
820 return "False";
821 }
822}
823
824/****************************************************************************/
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