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 const bool check = myCheckButton->getCheck() == TRUE;
296 if (check == myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
297 myOptionsEditor->myOptionsContainer.resetDefault(myName);
298 } else if (check) {
299 myOptionsEditor->myOptionsContainer.set(myName, "true");
300 } else {
301 myOptionsEditor->myOptionsContainer.set(myName, "false");
302 }
303 // set text
304 if (check) {
305 myCheckButton->setText(TL("true"));
306 } else {
307 myCheckButton->setText(TL("false"));
308 }
309 myOptionsEditor->myOptionsModified = true;
310 if (myRequireSaveNetwork) {
311 myOptionsEditor->myRequireSaveNetwork = true;
312 }
313 // special checks for Debug flags
314 if ((myName == "gui-testing-debug") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug")) {
315 MsgHandler::enableDebugMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug"));
316 }
317 if ((myName == "gui-testing-debug-gl") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug-gl")) {
318 MsgHandler::enableDebugGLMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug-gl"));
319 }
320 updateResetButton();
321 return 1;
322}
323
324
325long
327 if (myDefaultValue.empty()) {
328 myCheckButton->setCheck(FALSE);
329 myCheckButton->setText(TL("false"));
330 } else if (StringUtils::toBool(myDefaultValue)) {
331 myCheckButton->setCheck(TRUE);
332 myCheckButton->setText(TL("true"));
333 } else {
334 myCheckButton->setCheck(FALSE);
335 myCheckButton->setText(TL("false"));
336 }
337 updateResetButton();
338 return 1;
339}
340
341
342std::string
344 return myCheckButton->getCheck() ? "true" : "false";
345}
346
347// ---------------------------------------------------------------------------
348// GNEOptionsEditorRow::OptionInt - methods
349// ---------------------------------------------------------------------------
350
352 const std::string& topic, const std::string& name, const std::string& description,
353 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
354 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
356 if (!editable) {
357 myIntTextField->disable();
358 }
359 updateOption();
360}
361
362
363void
365 myIntTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
366 updateResetButton();
367}
368
369
370void
372 myIntTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
373 onCmdSetOption(nullptr, 0, nullptr);
374}
375
376
377long
379 if (myIntTextField->getText().empty()) {
380 myIntTextField->setText(myDefaultValue.c_str());
381 } else {
382 myOptionsEditor->myOptionsContainer.resetWritable();
383 // check if reset or set
384 if (myIntTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
385 myOptionsEditor->myOptionsContainer.resetDefault(myName);
386 } else {
387 myOptionsEditor->myOptionsContainer.set(myName, myIntTextField->getText().text());
388 }
389 myOptionsEditor->myOptionsModified = true;
390 if (myRequireSaveNetwork) {
391 myOptionsEditor->myRequireSaveNetwork = true;
392 }
393 }
394 updateResetButton();
395 return 1;
396}
397
398
399long
401 myIntTextField->setText(myDefaultValue.c_str());
402 updateResetButton();
403 return 1;
404}
405
406
407std::string
409 return myIntTextField->getText().text();
410}
411
412// ---------------------------------------------------------------------------
413// GNEOptionsEditorRow::OptionIntVector - methods
414// ---------------------------------------------------------------------------
415
417 const std::string& topic, const std::string& name, const std::string& description,
418 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
419 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
422 if (!editable) {
423 myIntVectorTextField->disable();
424 }
425 updateOption();
426}
427
428
429void
431 myIntVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
432 updateResetButton();
433}
434
435
436void
438 myIntVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
439 onCmdSetOption(nullptr, 0, nullptr);
440}
441
442
443long
445 try {
446 // check that int vector can be parsed
447 const auto intVector = StringTokenizer(myIntVectorTextField->getText().text()).getVector();
448 for (const auto& intValue : intVector) {
449 StringUtils::toInt(intValue);
450 }
451 myOptionsEditor->myOptionsContainer.resetWritable();
452 // check if reset or set
453 if (myIntVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
454 myOptionsEditor->myOptionsContainer.resetDefault(myName);
455 } else {
456 myOptionsEditor->myOptionsContainer.set(myName, myIntVectorTextField->getText().text());
457 }
458 myIntVectorTextField->setTextColor(GUIDesignTextColorBlack);
459 myOptionsEditor->myOptionsModified = true;
460 if (myRequireSaveNetwork) {
461 myOptionsEditor->myRequireSaveNetwork = true;
462 }
463 } catch (...) {
464 myIntVectorTextField->setTextColor(GUIDesignTextColorRed);
465 }
466 updateResetButton();
467 return 1;
468}
469
470
471long
473 myIntVectorTextField->setText(myDefaultValue.c_str());
474 updateResetButton();
475 return 1;
476}
477
478
479std::string
481 return myIntVectorTextField->getText().text();
482}
483
484// ---------------------------------------------------------------------------
485// GNEOptionsEditorRow::OptionFloat - methods
486// ---------------------------------------------------------------------------
487
489 const std::string& topic, const std::string& name, const std::string& description,
490 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
491 OptionRow(optionsEditor, parent, topic, name, description, parseFloat(defaultValue), editable, requireSaveNetwork) {
494 if (!editable) {
495 myFloatTextField->disable();
496 }
497 updateOption();
498}
499
500
501void
503 myFloatTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
504 updateResetButton();
505}
506
507
508void
510 myFloatTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
511 onCmdSetOption(nullptr, 0, nullptr);
512}
513
514
515long
517 // avoid empty values
518 if (myFloatTextField->getText().empty()) {
519 myFloatTextField->setText(myDefaultValue.c_str());
520 } else {
521 myOptionsEditor->myOptionsContainer.resetWritable();
522 // check if reset or set
523 if (myFloatTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
524 myOptionsEditor->myOptionsContainer.resetDefault(myName);
525 } else {
526 myOptionsEditor->myOptionsContainer.set(myName, myFloatTextField->getText().text());
527 }
528 myOptionsEditor->myOptionsModified = true;
529 if (myRequireSaveNetwork) {
530 myOptionsEditor->myRequireSaveNetwork = true;
531 }
532 }
533 updateResetButton();
534 return 1;
535}
536
537
538long
540 myFloatTextField->setText(myDefaultValue.c_str());
541 updateResetButton();
542 return 1;
543}
544
545
546std::string
548 return myFloatTextField->getText().text();
549}
550
551
552std::string
553GNEOptionsEditorRow::OptionFloat::parseFloat(const std::string& value) const {
554 try {
555 return toString(StringUtils::toDouble(value));
556 } catch (...) {
557 return value;
558 }
559}
560
561// ---------------------------------------------------------------------------
562// GNEOptionsEditorRow::OptionTime - methods
563// ---------------------------------------------------------------------------
564
566 const std::string& topic, const std::string& name, const std::string& description,
567 const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
568 OptionRow(optionsEditor, parent, topic, name, description, parseTime(defaultValue), editable, requireSaveNetwork) {
571 if (!editable) {
572 myTimeTextField->disable();
573 }
574 updateOption();
575}
576
577
578void
580 myTimeTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
581 updateResetButton();
582}
583
584
585void
587 myTimeTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
588 onCmdSetOption(nullptr, 0, nullptr);
589}
590
591
592long
594 // avoid empty values
595 if (myTimeTextField->getText().empty()) {
596 myTimeTextField->setText(myDefaultValue.c_str());
597 } else {
598 myOptionsEditor->myOptionsContainer.resetWritable();
599 // check if reset or set
600 if (myTimeTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
601 myOptionsEditor->myOptionsContainer.resetDefault(myName);
602 } else {
603 myOptionsEditor->myOptionsContainer.set(myName, myTimeTextField->getText().text());
604 }
605 myOptionsEditor->myOptionsModified = true;
606 if (myRequireSaveNetwork) {
607 myOptionsEditor->myRequireSaveNetwork = true;
608 }
609 }
610 updateResetButton();
611 return 1;
612}
613
614
615long
617 myTimeTextField->setText(myDefaultValue.c_str());
618 updateResetButton();
619 return 1;
620}
621
622
623std::string
625 return myTimeTextField->getText().text();
626}
627
628
629std::string
630GNEOptionsEditorRow::OptionTime::parseTime(const std::string& value) const {
631 try {
632 return time2string(string2time(value));
633 } catch (...) {
634 return value;
635 }
636}
637
638// ---------------------------------------------------------------------------
639// GNEOptionsEditorRow::OptionFilename - methods
640// ---------------------------------------------------------------------------
641
642GNEOptionsEditorRow::OptionFilename::OptionFilename(GNEOptionsEditor* optionsEditor, FXComposite* parent, const std::string& topic,
643 const std::string& name, const std::string& description, const std::string& defaultValue, const bool editable, const bool requireSaveNetwork) :
644 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, requireSaveNetwork) {
648 if (!editable) {
649 myOpenFilenameButton->disable();
650 myFilenameTextField->disable();
651 }
652 updateOption();
653}
654
655
656void
658 myFilenameTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
659 updateResetButton();
660}
661
662
663void
665 myFilenameTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
666 onCmdSetOption(nullptr, 0, nullptr);
667}
668
669
670long
672 // get open mode
674 if (myName.find("output") != std::string::npos || myName.find("log") != std::string::npos) {
676 } else if (myName.find("files") != std::string::npos) {
678 }
679 // open dialog
680 const GNEFileDialog XMLFileDialog(myOptionsEditor->myDialog->getApplicationWindow(), myOptionsEditor->myDialog,
681 TL("XML file"),
682 SUMOXMLDefinitions::XMLFileExtensions.getStrings(), openMode,
684 // check that file is valid
685 if (XMLFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
686 myFilenameTextField->setText((openMode == GNEFileDialog::OpenMode::LOAD_MULTIPLE
687 ? joinToString(XMLFileDialog.getFilenames(), ",").c_str()
688 : XMLFileDialog.getFilename().c_str()), TRUE);
689 }
690 updateResetButton();
691 return 1;
692}
693
694
695long
697 if (SUMOXMLDefinitions::isValidFilename(myFilenameTextField->getText().text())) {
698 myOptionsEditor->myOptionsContainer.resetWritable();
699 // check if reset or set
700 if (myFilenameTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
701 myOptionsEditor->myOptionsContainer.resetDefault(myName);
702 } else {
703 myOptionsEditor->myOptionsContainer.set(myName, myFilenameTextField->getText().text());
704 }
705 myFilenameTextField->setTextColor(GUIDesignTextColorBlack);
706 myOptionsEditor->myOptionsModified = true;
707 if (myRequireSaveNetwork) {
708 myOptionsEditor->myRequireSaveNetwork = true;
709 }
710 } else {
711 myFilenameTextField->setTextColor(GUIDesignTextColorRed);
712 }
713 updateResetButton();
714 return 1;
715}
716
717
718long
720 myFilenameTextField->setText(myDefaultValue.c_str());
721 updateResetButton();
722 return 1;
723}
724
725
727
728
729std::string
731 return myFilenameTextField->getText().text();
732}
733
734/****************************************************************************/
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:314
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