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 FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame),
67 myOptionsEditor(optionsEditor),
68 myTopic(topic),
69 myName(name),
70 myDescription(description),
71 myDefaultValue(defaultValue),
72 myEditable(editable) {
73 // build label with name (default width 150)
74 myNameLabel = new MFXLabelTooltip(this, myOptionsEditor->myDialog->getApplicationWindow()->getStaticTooltipMenu(),
75 name.c_str(), nullptr, GUIDesignLabelThickedFixed(MINNAMEWIDTH));
76 // set description as tooltip
77 myNameLabel->setTipText(description.c_str());
78 // create content frame
79 myContentFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
80 // Create reset button
81 myResetButton = GUIDesigns::buildFXButton(this, "", "", TL("Reset value"), GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_RESET, GUIDesignButtonIcon);
82}
83
84
85void
87 const int nameWidth = myNameLabel->getFont()->getTextWidth(myNameLabel->getText().text(), myNameLabel->getText().length() + MARGIN);
88 if (nameWidth > MINNAMEWIDTH) {
89 myNameLabel->setWidth(nameWidth);
90 }
91}
92
93
94const std::string&
96 return myTopic;
97}
98
99
100const std::string
104
105
106const std::string
110
111
112bool
114 return myEditable;
115}
116
117
118void
120 if (getValue() != myDefaultValue) {
121 myResetButton->enable();
122 } else {
123 myResetButton->disable();
124 }
125}
126
127// ---------------------------------------------------------------------------
128// GNEOptionsEditorRow::OptionString - methods
129// ---------------------------------------------------------------------------
130
132 const std::string& topic, const std::string& name, const std::string& description,
133 const std::string& defaultValue, const bool editable) :
134 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable) {
137 if (!editable) {
138 myStringTextField->disable();
139 }
140 updateOption();
141}
142
143
144void
146 myStringTextField->setText(myOptionsEditor->myOptionsContainer.getString(myName).c_str());
147 updateResetButton();
148}
149
150
151void
153 myStringTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getString(myName).c_str());
154 onCmdSetOption(nullptr, 0, nullptr);
155}
156
157
158long
160 myOptionsEditor->myOptionsContainer.resetWritable();
161 // check if reset or set
162 if (myStringTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
163 myOptionsEditor->myOptionsContainer.resetDefault(myName);
164 } else {
165 myOptionsEditor->myOptionsContainer.set(myName, myStringTextField->getText().text());
166 }
167 myOptionsEditor->myOptionsModified = true;
168 updateResetButton();
169 return 1;
170}
171
172
173long
175 myStringTextField->setText(myDefaultValue.c_str());
176 updateResetButton();
177 return 1;
178}
179
180
181std::string
183 return myStringTextField->getText().text();
184}
185
186
188 const std::string& topic, const std::string& name, const std::string& description,
189 const std::string& defaultValue, const bool editable) :
190 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable) {
192 if (!editable) {
193 myStringVectorTextField->disable();
194 }
195 updateOption();
196}
197
198
199void
201 myStringVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
202 updateResetButton();
203}
204
205
206void
208 myStringVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
209 onCmdSetOption(nullptr, 0, nullptr);
210}
211
212
213long
215 myOptionsEditor->myOptionsContainer.resetWritable();
216 // check if reset or set
217 if (myStringVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
218 myOptionsEditor->myOptionsContainer.resetDefault(myName);
219 } else {
220 myOptionsEditor->myOptionsContainer.set(myName, myStringVectorTextField->getText().text());
221 }
222 myOptionsEditor->myOptionsModified = true;
223 updateResetButton();
224 return 1;
225}
226
227
228long
230 myStringVectorTextField->setText(myDefaultValue.c_str());
231 updateResetButton();
232 return 1;
233}
234
235
236std::string
238 return myStringVectorTextField->getText().text();
239}
240
241// ---------------------------------------------------------------------------
242// GNEOptionsEditorRow::OptionBool - methods
243// ---------------------------------------------------------------------------
244
246 const std::string& topic, const std::string& name, const std::string& description,
247 const std::string& defaultValue, const bool editable) :
248 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable) {
250 if (!editable) {
251 myCheckButton->disable();
252 }
253 updateOption();
254}
255
256
257void
259 if (myOptionsEditor->myOptionsContainer.getBool(myName)) {
260 myCheckButton->setCheck(TRUE);
261 myCheckButton->setText(TL("true"));
262 } else {
263 myCheckButton->setCheck(FALSE);
264 myCheckButton->setText(TL("false"));
265 }
266 updateResetButton();
267}
268
269
270void
272 if (myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
273 myCheckButton->setCheck(TRUE);
274 myCheckButton->setText(TL("true"));
275 } else {
276 myCheckButton->setCheck(FALSE);
277 myCheckButton->setText(TL("false"));
278 }
279 onCmdSetOption(nullptr, 0, nullptr);
280}
281
282
283long
285 myOptionsEditor->myOptionsContainer.resetWritable();
286 // check if reset or set
287 if (myCheckButton->getCheck() == myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
288 myOptionsEditor->myOptionsContainer.resetDefault(myName);
289 } else if (myCheckButton->getCheck()) {
290 myOptionsEditor->myOptionsContainer.set(myName, "true");
291 } else {
292 myOptionsEditor->myOptionsContainer.set(myName, "false");
293 }
294 // set text
295 if (myCheckButton->getCheck()) {
296 myCheckButton->setText(TL("true"));
297 } else {
298 myCheckButton->setText(TL("false"));
299 }
300 myOptionsEditor->myOptionsModified = true;
301 // special checks for Debug flags
302 if ((myName == "gui-testing-debug") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug")) {
303 MsgHandler::enableDebugMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug"));
304 }
305 if ((myName == "gui-testing-debug-gl") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug-gl")) {
306 MsgHandler::enableDebugGLMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug-gl"));
307 }
308 updateResetButton();
309 return 1;
310}
311
312
313long
315 if (myDefaultValue.empty()) {
316 myCheckButton->setCheck(FALSE);
317 myCheckButton->setText(TL("false"));
318 } else if (StringUtils::toBool(myDefaultValue)) {
319 myCheckButton->setCheck(TRUE);
320 myCheckButton->setText(TL("true"));
321 } else {
322 myCheckButton->setCheck(FALSE);
323 myCheckButton->setText(TL("false"));
324 }
325 updateResetButton();
326 return 1;
327}
328
329
330std::string
332 return myCheckButton->getCheck() ? "true" : "false";
333}
334
335// ---------------------------------------------------------------------------
336// GNEOptionsEditorRow::OptionInt - methods
337// ---------------------------------------------------------------------------
338
340 const std::string& topic, const std::string& name, const std::string& description,
341 const std::string& defaultValue, const bool editable) :
342 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable) {
344 if (!editable) {
345 myIntTextField->disable();
346 }
347 updateOption();
348}
349
350
351void
353 myIntTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
354 updateResetButton();
355}
356
357
358void
360 myIntTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
361 onCmdSetOption(nullptr, 0, nullptr);
362}
363
364
365long
367 if (myIntTextField->getText().empty()) {
368 myIntTextField->setText(myDefaultValue.c_str());
369 } else {
370 myOptionsEditor->myOptionsContainer.resetWritable();
371 // check if reset or set
372 if (myIntTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
373 myOptionsEditor->myOptionsContainer.resetDefault(myName);
374 } else {
375 myOptionsEditor->myOptionsContainer.set(myName, myIntTextField->getText().text());
376 }
377 myOptionsEditor->myOptionsModified = true;
378 }
379 updateResetButton();
380 return 1;
381}
382
383
384long
386 myIntTextField->setText(myDefaultValue.c_str());
387 updateResetButton();
388 return 1;
389}
390
391
392std::string
394 return myIntTextField->getText().text();
395}
396
397// ---------------------------------------------------------------------------
398// GNEOptionsEditorRow::OptionIntVector - methods
399// ---------------------------------------------------------------------------
400
402 const std::string& topic, const std::string& name, const std::string& description,
403 const std::string& defaultValue, const bool editable) :
404 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable) {
407 if (!editable) {
408 myIntVectorTextField->disable();
409 }
410 updateOption();
411}
412
413
414void
416 myIntVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
417 updateResetButton();
418}
419
420
421void
423 myIntVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
424 onCmdSetOption(nullptr, 0, nullptr);
425}
426
427
428long
430 try {
431 // check that int vector can be parsed
432 const auto intVector = StringTokenizer(myIntVectorTextField->getText().text()).getVector();
433 for (const auto& intValue : intVector) {
434 StringUtils::toInt(intValue);
435 }
436 myOptionsEditor->myOptionsContainer.resetWritable();
437 // check if reset or set
438 if (myIntVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
439 myOptionsEditor->myOptionsContainer.resetDefault(myName);
440 } else {
441 myOptionsEditor->myOptionsContainer.set(myName, myIntVectorTextField->getText().text());
442 }
443 myIntVectorTextField->setTextColor(GUIDesignTextColorBlack);
444 myOptionsEditor->myOptionsModified = true;
445 } catch (...) {
446 myIntVectorTextField->setTextColor(GUIDesignTextColorRed);
447 }
448 updateResetButton();
449 return 1;
450}
451
452
453long
455 myIntVectorTextField->setText(myDefaultValue.c_str());
456 updateResetButton();
457 return 1;
458}
459
460
461std::string
463 return myIntVectorTextField->getText().text();
464}
465
466// ---------------------------------------------------------------------------
467// GNEOptionsEditorRow::OptionFloat - methods
468// ---------------------------------------------------------------------------
469
471 const std::string& topic, const std::string& name, const std::string& description,
472 const std::string& defaultValue, const bool editable) :
473 OptionRow(optionsEditor, parent, topic, name, description, parseFloat(defaultValue), editable) {
476 if (!editable) {
477 myFloatTextField->disable();
478 }
479 updateOption();
480}
481
482
483void
485 myFloatTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
486 updateResetButton();
487}
488
489
490void
492 myFloatTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
493 onCmdSetOption(nullptr, 0, nullptr);
494}
495
496
497long
499 // avoid empty values
500 if (myFloatTextField->getText().empty()) {
501 myFloatTextField->setText(myDefaultValue.c_str());
502 } else {
503 myOptionsEditor->myOptionsContainer.resetWritable();
504 // check if reset or set
505 if (myFloatTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
506 myOptionsEditor->myOptionsContainer.resetDefault(myName);
507 } else {
508 myOptionsEditor->myOptionsContainer.set(myName, myFloatTextField->getText().text());
509 }
510 myOptionsEditor->myOptionsModified = true;
511 }
512 updateResetButton();
513 return 1;
514}
515
516
517long
519 myFloatTextField->setText(myDefaultValue.c_str());
520 updateResetButton();
521 return 1;
522}
523
524
525std::string
527 return myFloatTextField->getText().text();
528}
529
530
531std::string
532GNEOptionsEditorRow::OptionFloat::parseFloat(const std::string& value) const {
533 try {
534 return toString(StringUtils::toDouble(value));
535 } catch (...) {
536 return value;
537 }
538}
539
540// ---------------------------------------------------------------------------
541// GNEOptionsEditorRow::OptionTime - methods
542// ---------------------------------------------------------------------------
543
545 const std::string& topic, const std::string& name, const std::string& description,
546 const std::string& defaultValue, const bool editable) :
547 OptionRow(optionsEditor, parent, topic, name, description, parseTime(defaultValue), editable) {
550 if (!editable) {
551 myTimeTextField->disable();
552 }
553 updateOption();
554}
555
556
557void
559 myTimeTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
560 updateResetButton();
561}
562
563
564void
566 myTimeTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
567 onCmdSetOption(nullptr, 0, nullptr);
568}
569
570
571long
573 // avoid empty values
574 if (myTimeTextField->getText().empty()) {
575 myTimeTextField->setText(myDefaultValue.c_str());
576 } else {
577 myOptionsEditor->myOptionsContainer.resetWritable();
578 // check if reset or set
579 if (myTimeTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
580 myOptionsEditor->myOptionsContainer.resetDefault(myName);
581 } else {
582 myOptionsEditor->myOptionsContainer.set(myName, myTimeTextField->getText().text());
583 }
584 myOptionsEditor->myOptionsModified = true;
585 }
586 updateResetButton();
587 return 1;
588}
589
590
591long
593 myTimeTextField->setText(myDefaultValue.c_str());
594 updateResetButton();
595 return 1;
596}
597
598
599std::string
601 return myTimeTextField->getText().text();
602}
603
604
605std::string
606GNEOptionsEditorRow::OptionTime::parseTime(const std::string& value) const {
607 try {
608 return time2string(string2time(value));
609 } catch (...) {
610 return value;
611 }
612}
613
614// ---------------------------------------------------------------------------
615// GNEOptionsEditorRow::OptionFilename - methods
616// ---------------------------------------------------------------------------
617
618GNEOptionsEditorRow::OptionFilename::OptionFilename(GNEOptionsEditor* optionsEditor, FXComposite* parent, const std::string& topic,
619 const std::string& name, const std::string& description, const std::string& defaultValue, const bool editable) :
620 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable) {
624 if (!editable) {
625 myOpenFilenameButton->disable();
626 myFilenameTextField->disable();
627 }
628 updateOption();
629}
630
631
632void
634 myFilenameTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
635 updateResetButton();
636}
637
638
639void
641 myFilenameTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
642 onCmdSetOption(nullptr, 0, nullptr);
643}
644
645
646long
648 // get open mode
650 if (myName.find("output") != std::string::npos || myName.find("log") != std::string::npos) {
652 } else if (myName.find("files") != std::string::npos) {
654 }
655 // open dialog
656 const GNEFileDialog XMLFileDialog(myOptionsEditor->myDialog->getApplicationWindow(), myOptionsEditor->myDialog,
657 TL("XML file"),
658 SUMOXMLDefinitions::XMLFileExtensions.getStrings(), openMode,
660 // check that file is valid
661 if (XMLFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
662 myFilenameTextField->setText((openMode == GNEFileDialog::OpenMode::LOAD_MULTIPLE
663 ? joinToString(XMLFileDialog.getFilenames(), ",").c_str()
664 : XMLFileDialog.getFilename().c_str()), TRUE);
665 }
666 updateResetButton();
667 return 1;
668}
669
670
671long
673 if (SUMOXMLDefinitions::isValidFilename(myFilenameTextField->getText().text())) {
674 myOptionsEditor->myOptionsContainer.resetWritable();
675 // check if reset or set
676 if (myFilenameTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
677 myOptionsEditor->myOptionsContainer.resetDefault(myName);
678 } else {
679 myOptionsEditor->myOptionsContainer.set(myName, myFilenameTextField->getText().text());
680 }
681 myFilenameTextField->setTextColor(GUIDesignTextColorBlack);
682 myOptionsEditor->myOptionsModified = true;
683 } else {
684 myFilenameTextField->setTextColor(GUIDesignTextColorRed);
685 }
686 updateResetButton();
687 return 1;
688}
689
690
691long
693 myFilenameTextField->setText(myDefaultValue.c_str());
694 updateResetButton();
695 return 1;
696}
697
698
700
701
702std::string
704 return myFilenameTextField->getText().text();
705}
706
707/****************************************************************************/
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
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
OptionBool(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable)
constructor
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)
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)
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)
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
long onCmdSetOption(FXObject *, FXSelector, void *)
called when user set value in textField/button/checkBox
OptionString(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable)
constructor
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)
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
OptionTime(GNEOptionsEditor *optionsEditor, FXComposite *parent, const std::string &topic, const std::string &name, const std::string &description, const std::string &defaultValue, const bool editable)
constructor
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