Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEOptionsEditorRow.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Row used in GNEOptionsEditor to edit options
19/****************************************************************************/
20#include <config.h>
21
28
29#include "GNEOptionsEditorRow.h"
30#include "GNEOptionsEditor.h"
31
32// ===========================================================================
33// Defines
34// ===========================================================================
35
36#define MARGIN 4
37#define MINNAMEWIDTH 200
38
39// ===========================================================================
40// FOX callback mapping
41// ===========================================================================
42
47
51
52// Object implementation
53FXIMPLEMENT_ABSTRACT(GNEOptionsEditorRow::OptionRow, FXHorizontalFrame, OptionRowMap, ARRAYNUMBER(OptionRowMap))
54FXIMPLEMENT_ABSTRACT(GNEOptionsEditorRow::OptionFilename, GNEOptionsEditorRow::OptionRow, OptionFilenameMap, ARRAYNUMBER(OptionFilenameMap))
55
56// ===========================================================================
57// method definitions
58// ===========================================================================
59
60// ---------------------------------------------------------------------------
61// GNEOptionsEditorRow::OptionRow - methods
62// ---------------------------------------------------------------------------
63
64GNEOptionsEditorRow::OptionRow::OptionRow(GNEOptionsEditor* optionsEditor, FXComposite* parent, const std::string& topic,
65 const std::string& name, const std::string& description, const std::string& defaultValue, const bool editable,
66 const bool requireSaveNetwork) :
67 FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame),
68 myOptionsEditor(optionsEditor),
69 myTopic(topic),
70 myName(name),
71 myDescription(description),
72 myDefaultValue(defaultValue),
73 myEditable(editable),
74 myRequireSaveNetwork(requireSaveNetwork) {
75 // build label with name (default width 150)
76 myNameLabel = new MFXLabelTooltip(this, myOptionsEditor->myDialog->getApplicationWindow()->getStaticTooltipMenu(),
77 name.c_str(), nullptr, GUIDesignLabelThickedFixed(MINNAMEWIDTH));
78 // set description as tooltip
79 myNameLabel->setTipText(description.c_str());
80 // create content frame
81 myContentFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
82 // Create reset button
83 myResetButton = GUIDesigns::buildFXButton(this, "", "", TL("Reset value"), GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_RESET, GUIDesignButtonIcon);
84}
85
86
87void
89 const int nameWidth = myNameLabel->getFont()->getTextWidth(myNameLabel->getText().text(), myNameLabel->getText().length() + MARGIN);
90 if (nameWidth > MINNAMEWIDTH) {
91 myNameLabel->setWidth(nameWidth);
92 }
93}
94
95
96const std::string&
98 return myTopic;
99}
100
101
102const std::string
106
107
108const std::string
112
113
114bool
116 return myEditable;
117}
118
119
120void
122 if (getValue() != myDefaultValue) {
123 myResetButton->enable();
124 } else {
125 myResetButton->disable();
126 }
127}
128
129// ---------------------------------------------------------------------------
130// GNEOptionsEditorRow::OptionString - methods
131// ---------------------------------------------------------------------------
132
134 const std::string& topic, const std::string& name, const std::string& description,
135 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
136 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
139 if (!editable) {
140 myStringTextField->disable();
141 }
142 updateOption();
143}
144
145
146void
148 myStringTextField->setText(myOptionsEditor->myOptionsContainer.getString(myName).c_str());
149 updateResetButton();
150}
151
152
153void
155 myStringTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getString(myName).c_str());
156 onCmdSetOption(nullptr, 0, nullptr);
157}
158
159
160long
162 myOptionsEditor->myOptionsContainer.resetWritable();
163 // check if reset or set
164 if (myStringTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
165 myOptionsEditor->myOptionsContainer.resetDefault(myName);
166 } else {
167 myOptionsEditor->myOptionsContainer.set(myName, myStringTextField->getText().text());
168 }
169 myOptionsEditor->myOptionsModified = true;
170 if (myRequireSaveNetwork) {
171 myOptionsEditor->myRequireSaveNetwork = true;
172 }
173 updateResetButton();
174 return 1;
175}
176
177
178long
180 myStringTextField->setText(myDefaultValue.c_str());
181 updateResetButton();
182 return 1;
183}
184
185
186std::string
188 return myStringTextField->getText().text();
189}
190
191
193 const std::string& topic, const std::string& name, const std::string& description,
194 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
195 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
197 if (!editable) {
198 myStringVectorTextField->disable();
199 }
200 updateOption();
201}
202
203
204void
206 myStringVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
207 updateResetButton();
208}
209
210
211void
213 myStringVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
214 onCmdSetOption(nullptr, 0, nullptr);
215}
216
217
218long
220 myOptionsEditor->myOptionsContainer.resetWritable();
221 // check if reset or set
222 if (myStringVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
223 myOptionsEditor->myOptionsContainer.resetDefault(myName);
224 } else {
225 myOptionsEditor->myOptionsContainer.set(myName, myStringVectorTextField->getText().text());
226 }
227 myOptionsEditor->myOptionsModified = true;
228 if (myRequireSaveNetwork) {
229 myOptionsEditor->myRequireSaveNetwork = true;
230 }
231 updateResetButton();
232 return 1;
233}
234
235
236long
238 myStringVectorTextField->setText(myDefaultValue.c_str());
239 updateResetButton();
240 return 1;
241}
242
243
244std::string
246 return myStringVectorTextField->getText().text();
247}
248
249// ---------------------------------------------------------------------------
250// GNEOptionsEditorRow::OptionBool - methods
251// ---------------------------------------------------------------------------
252
254 const std::string& topic, const std::string& name, const std::string& description,
255 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
256 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
258 if (!editable) {
259 myCheckButton->disable();
260 }
261 updateOption();
262}
263
264
265void
267 if (myOptionsEditor->myOptionsContainer.getBool(myName)) {
268 myCheckButton->setCheck(TRUE);
269 myCheckButton->setText(TL("true"));
270 } else {
271 myCheckButton->setCheck(FALSE);
272 myCheckButton->setText(TL("false"));
273 }
274 updateResetButton();
275}
276
277
278void
280 if (myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
281 myCheckButton->setCheck(TRUE);
282 myCheckButton->setText(TL("true"));
283 } else {
284 myCheckButton->setCheck(FALSE);
285 myCheckButton->setText(TL("false"));
286 }
287 onCmdSetOption(nullptr, 0, nullptr);
288}
289
290
291long
293 myOptionsEditor->myOptionsContainer.resetWritable();
294 // check if reset or set
295 if (myCheckButton->getCheck() == myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
296 myOptionsEditor->myOptionsContainer.resetDefault(myName);
297 } else if (myCheckButton->getCheck()) {
298 myOptionsEditor->myOptionsContainer.set(myName, "true");
299 } else {
300 myOptionsEditor->myOptionsContainer.set(myName, "false");
301 }
302 // set text
303 if (myCheckButton->getCheck()) {
304 myCheckButton->setText(TL("true"));
305 } else {
306 myCheckButton->setText(TL("false"));
307 }
308 myOptionsEditor->myOptionsModified = true;
309 if (myRequireSaveNetwork) {
310 myOptionsEditor->myRequireSaveNetwork = true;
311 }
312 // special checks for Debug flags
313 if ((myName == "gui-testing-debug") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug")) {
314 MsgHandler::enableDebugMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug"));
315 }
316 if ((myName == "gui-testing-debug-gl") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug-gl")) {
317 MsgHandler::enableDebugGLMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug-gl"));
318 }
319 updateResetButton();
320 return 1;
321}
322
323
324long
326 if (myDefaultValue.empty()) {
327 myCheckButton->setCheck(FALSE);
328 myCheckButton->setText(TL("false"));
329 } else if (StringUtils::toBool(myDefaultValue)) {
330 myCheckButton->setCheck(TRUE);
331 myCheckButton->setText(TL("true"));
332 } else {
333 myCheckButton->setCheck(FALSE);
334 myCheckButton->setText(TL("false"));
335 }
336 updateResetButton();
337 return 1;
338}
339
340
341std::string
343 return myCheckButton->getCheck() ? "true" : "false";
344}
345
346// ---------------------------------------------------------------------------
347// GNEOptionsEditorRow::OptionInt - methods
348// ---------------------------------------------------------------------------
349
351 const std::string& topic, const std::string& name, const std::string& description,
352 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
353 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
355 if (!editable) {
356 myIntTextField->disable();
357 }
358 updateOption();
359}
360
361
362void
364 myIntTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
365 updateResetButton();
366}
367
368
369void
371 myIntTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
372 onCmdSetOption(nullptr, 0, nullptr);
373}
374
375
376long
378 if (myIntTextField->getText().empty()) {
379 myIntTextField->setText(myDefaultValue.c_str());
380 } else {
381 myOptionsEditor->myOptionsContainer.resetWritable();
382 // check if reset or set
383 if (myIntTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
384 myOptionsEditor->myOptionsContainer.resetDefault(myName);
385 } else {
386 myOptionsEditor->myOptionsContainer.set(myName, myIntTextField->getText().text());
387 }
388 myOptionsEditor->myOptionsModified = true;
389 if (myRequireSaveNetwork) {
390 myOptionsEditor->myRequireSaveNetwork = true;
391 }
392 }
393 updateResetButton();
394 return 1;
395}
396
397
398long
400 myIntTextField->setText(myDefaultValue.c_str());
401 updateResetButton();
402 return 1;
403}
404
405
406std::string
408 return myIntTextField->getText().text();
409}
410
411// ---------------------------------------------------------------------------
412// GNEOptionsEditorRow::OptionIntVector - methods
413// ---------------------------------------------------------------------------
414
416 const std::string& topic, const std::string& name, const std::string& description,
417 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
418 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
421 if (!editable) {
422 myIntVectorTextField->disable();
423 }
424 updateOption();
425}
426
427
428void
430 myIntVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
431 updateResetButton();
432}
433
434
435void
437 myIntVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
438 onCmdSetOption(nullptr, 0, nullptr);
439}
440
441
442long
444 try {
445 // check that int vector can be parsed
446 const auto intVector = StringTokenizer(myIntVectorTextField->getText().text()).getVector();
447 for (const auto& intValue : intVector) {
448 StringUtils::toInt(intValue);
449 }
450 myOptionsEditor->myOptionsContainer.resetWritable();
451 // check if reset or set
452 if (myIntVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
453 myOptionsEditor->myOptionsContainer.resetDefault(myName);
454 } else {
455 myOptionsEditor->myOptionsContainer.set(myName, myIntVectorTextField->getText().text());
456 }
457 myIntVectorTextField->setTextColor(GUIDesignTextColorBlack);
458 myOptionsEditor->myOptionsModified = true;
459 if (myRequireSaveNetwork) {
460 myOptionsEditor->myRequireSaveNetwork = true;
461 }
462 } catch (...) {
463 myIntVectorTextField->setTextColor(GUIDesignTextColorRed);
464 }
465 updateResetButton();
466 return 1;
467}
468
469
470long
472 myIntVectorTextField->setText(myDefaultValue.c_str());
473 updateResetButton();
474 return 1;
475}
476
477
478std::string
480 return myIntVectorTextField->getText().text();
481}
482
483// ---------------------------------------------------------------------------
484// GNEOptionsEditorRow::OptionFloat - methods
485// ---------------------------------------------------------------------------
486
488 const std::string& topic, const std::string& name, const std::string& description,
489 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
490 OptionRow(optionsEditor, parent, topic, name, description, parseFloat(defaultValue), editable, requireSaveNetwork) {
493 if (!editable) {
494 myFloatTextField->disable();
495 }
496 updateOption();
497}
498
499
500void
502 myFloatTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
503 updateResetButton();
504}
505
506
507void
509 myFloatTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
510 onCmdSetOption(nullptr, 0, nullptr);
511}
512
513
514long
516 // avoid empty values
517 if (myFloatTextField->getText().empty()) {
518 myFloatTextField->setText(myDefaultValue.c_str());
519 } else {
520 myOptionsEditor->myOptionsContainer.resetWritable();
521 // check if reset or set
522 if (myFloatTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
523 myOptionsEditor->myOptionsContainer.resetDefault(myName);
524 } else {
525 myOptionsEditor->myOptionsContainer.set(myName, myFloatTextField->getText().text());
526 }
527 myOptionsEditor->myOptionsModified = true;
528 if (myRequireSaveNetwork) {
529 myOptionsEditor->myRequireSaveNetwork = true;
530 }
531 }
532 updateResetButton();
533 return 1;
534}
535
536
537long
539 myFloatTextField->setText(myDefaultValue.c_str());
540 updateResetButton();
541 return 1;
542}
543
544
545std::string
547 return myFloatTextField->getText().text();
548}
549
550
551std::string
552GNEOptionsEditorRow::OptionFloat::parseFloat(const std::string& value) const {
553 try {
554 return toString(StringUtils::toDouble(value));
555 } catch (...) {
556 return value;
557 }
558}
559
560// ---------------------------------------------------------------------------
561// GNEOptionsEditorRow::OptionTime - methods
562// ---------------------------------------------------------------------------
563
565 const std::string& topic, const std::string& name, const std::string& description,
566 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
567 OptionRow(optionsEditor, parent, topic, name, description, parseTime(defaultValue), editable, requireSaveNetwork) {
570 if (!editable) {
571 myTimeTextField->disable();
572 }
573 updateOption();
574}
575
576
577void
579 myTimeTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
580 updateResetButton();
581}
582
583
584void
586 myTimeTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
587 onCmdSetOption(nullptr, 0, nullptr);
588}
589
590
591long
593 // avoid empty values
594 if (myTimeTextField->getText().empty()) {
595 myTimeTextField->setText(myDefaultValue.c_str());
596 } else {
597 myOptionsEditor->myOptionsContainer.resetWritable();
598 // check if reset or set
599 if (myTimeTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
600 myOptionsEditor->myOptionsContainer.resetDefault(myName);
601 } else {
602 myOptionsEditor->myOptionsContainer.set(myName, myTimeTextField->getText().text());
603 }
604 myOptionsEditor->myOptionsModified = true;
605 if (myRequireSaveNetwork) {
606 myOptionsEditor->myRequireSaveNetwork = true;
607 }
608 }
609 updateResetButton();
610 return 1;
611}
612
613
614long
616 myTimeTextField->setText(myDefaultValue.c_str());
617 updateResetButton();
618 return 1;
619}
620
621
622std::string
624 return myTimeTextField->getText().text();
625}
626
627
628std::string
629GNEOptionsEditorRow::OptionTime::parseTime(const std::string& value) const {
630 try {
631 return time2string(string2time(value));
632 } catch (...) {
633 return value;
634 }
635}
636
637// ---------------------------------------------------------------------------
638// GNEOptionsEditorRow::OptionFilename - methods
639// ---------------------------------------------------------------------------
640
641GNEOptionsEditorRow::OptionFilename::OptionFilename(GNEOptionsEditor* optionsEditor, FXComposite* parent, const std::string& topic,
642 const std::string& name, const std::string& description, const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
643 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
647 if (!editable) {
648 myOpenFilenameButton->disable();
649 myFilenameTextField->disable();
650 }
651 updateOption();
652}
653
654
655void
657 myFilenameTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
658 updateResetButton();
659}
660
661
662void
664 myFilenameTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
665 onCmdSetOption(nullptr, 0, nullptr);
666}
667
668
669long
671 // get open mode
673 if (myName.find("output") != std::string::npos || myName.find("log") != std::string::npos) {
675 } else if (myName.find("files") != std::string::npos) {
677 }
678 // open dialog
679 const GNEFileDialog XMLFileDialog(myOptionsEditor->myDialog->getApplicationWindow(), myOptionsEditor->myDialog,
680 TL("XML file"),
681 SUMOXMLDefinitions::XMLFileExtensions.getStrings(), openMode,
683 // check that file is valid
684 if (XMLFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
685 myFilenameTextField->setText((openMode == GNEFileDialog::OpenMode::LOAD_MULTIPLE
686 ? joinToString(XMLFileDialog.getFilenames(), ",").c_str()
687 : XMLFileDialog.getFilename().c_str()), TRUE);
688 }
689 updateResetButton();
690 return 1;
691}
692
693
694long
696 if (SUMOXMLDefinitions::isValidFilename(myFilenameTextField->getText().text())) {
697 myOptionsEditor->myOptionsContainer.resetWritable();
698 // check if reset or set
699 if (myFilenameTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
700 myOptionsEditor->myOptionsContainer.resetDefault(myName);
701 } else {
702 myOptionsEditor->myOptionsContainer.set(myName, myFilenameTextField->getText().text());
703 }
704 myFilenameTextField->setTextColor(GUIDesignTextColorBlack);
705 myOptionsEditor->myOptionsModified = true;
706 if (myRequireSaveNetwork) {
707 myOptionsEditor->myRequireSaveNetwork = true;
708 }
709 } else {
710 myFilenameTextField->setTextColor(GUIDesignTextColorRed);
711 }
712 updateResetButton();
713 return 1;
714}
715
716
717long
719 myFilenameTextField->setText(myDefaultValue.c_str());
720 updateResetButton();
721 return 1;
722}
723
724
726
727
728std::string
730 return myFilenameTextField->getText().text();
731}
732
733/****************************************************************************/
FXDEFMAP(GNEOptionsEditorRow::OptionRow) OptionRowMap[]
#define MINNAMEWIDTH
#define MARGIN
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trough dialog
@ MID_GNE_RESET
reset element
#define GUIDesignTextColorRed
red color (for invalid text)
Definition GUIDesigns.h:44
#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 GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:92
#define GUIDesignTextColorBlack
black color (for correct text)
Definition GUIDesigns.h:38
#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 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
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition SUMOTime.cpp:46
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition ToString.h:313
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
std::vector< std::string > getFilenames() const
Return empty-string terminated list of selected file names, or NULL if none selected.
OpenMode
file open mode
std::string getFilename() const
Return file name, if any.
OptionsCont & myOptionsContainer
reference to edited Option container
std::string getValue() const
get value
OptionBool(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
constructor
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
FXCheckButton * myCheckButton
menu check
FXButton * myOpenFilenameButton
open filename button
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
std::string getValue() const
get value
long onCmdOpenDialog(FXObject *, FXSelector, void *)
called when user press open dialog button
FXTextField * myFilenameTextField
text field
OptionFloat(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
constructor
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
std::string parseFloat(const std::string &value) const
parse float xx to xx.00
std::string getValue() const
get value
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
FXTextField * myFloatTextField
text field
FXTextField * myIntTextField
text field
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
OptionInt(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
std::string getValue() const
get value
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
OptionIntVector(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
GNEOptionsEditor * myOptionsEditor
FOX needs this.
MFXLabelTooltip * myNameLabel
tooltip label for name
const std::string getDescriptionLower() const
get description (Lower)
const std::string & getTopic() const
get topic
void updateResetButton()
update reset button
bool isEditable() const
check if option is editable
virtual long onCmdSetOption(FXObject *, FXSelector, void *)=0
called when user set value in textField/button/checkBox
const std::string getNameLower() const
get name (Lower)
FXHorizontalFrame * myContentFrame
content frame
void adjustNameSize()
adjust input name size
virtual long onCmdResetOption(FXObject *, FXSelector, void *)=0
called when user press reset button
OptionString(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
constructor
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
std::string getValue() const
get value
FXTextField * myStringTextField
text field
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
OptionStringVector(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
constructor
OptionTime(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable, const bool requireSaveNetwork)
constructor
FXTextField * myTimeTextField
text field
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
std::string getValue() const
get value
std::string parseTime(const std::string &value) const
parse float xx to xx.00
long onCmdResetOption(FXObject *, FXSelector, void *)
called when user press reset button
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
static void enableDebugGLMessages(bool enable)
enable/disable gl-debug messages
static void enableDebugMessages(bool enable)
enable/disable debug messages
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::string getValueString(const std::string &name) const
Returns the string-value of the named option (all options)
static StringBijection< XMLFileExtension > XMLFileExtensions
XML file Extensions.
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
std::vector< std::string > getVector()
return vector of strings
static std::string to_lower_case(const std::string &str)
Transfers the content to lower case.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
Definition json.hpp:4471