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 drawRed, 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 if (drawRed) {
81 myNameLabel->setTextColor(GUIDesignTextColorRed);
82 }
83 // create content frame
84 myContentFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
85 // Create reset button
86 myResetButton = GUIDesigns::buildFXButton(this, "", "", TL("Reset value"), GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_RESET, GUIDesignButtonIcon);
87}
88
89
90void
92 const int nameWidth = myNameLabel->getFont()->getTextWidth(myNameLabel->getText().text(), myNameLabel->getText().length() + MARGIN);
93 if (nameWidth > MINNAMEWIDTH) {
94 myNameLabel->setWidth(nameWidth);
95 }
96}
97
98
99const std::string&
101 return myTopic;
102}
103
104
105const std::string
109
110
111const std::string
115
116
117bool
119 return myEditable;
120}
121
122
123void
125 if (getValue() != myDefaultValue) {
126 myResetButton->enable();
127 } else {
128 myResetButton->disable();
129 }
130}
131
132// ---------------------------------------------------------------------------
133// GNEOptionsEditorRow::OptionString - methods
134// ---------------------------------------------------------------------------
135
137 const std::string& topic, const std::string& name, const std::string& description,
138 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
139 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, drawRed, requireSaveNetwork) {
142 if (!editable) {
143 myStringTextField->disable();
144 }
145 updateOption();
146}
147
148
149void
151 myStringTextField->setText(myOptionsEditor->myOptionsContainer.getString(myName).c_str());
152 updateResetButton();
153}
154
155
156void
158 myStringTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getString(myName).c_str());
159 onCmdSetOption(nullptr, 0, nullptr);
160}
161
162
163long
165 myOptionsEditor->myOptionsContainer.resetWritable();
166 // check if reset or set
167 if (myStringTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
168 myOptionsEditor->myOptionsContainer.resetDefault(myName);
169 } else {
170 myOptionsEditor->myOptionsContainer.set(myName, myStringTextField->getText().text());
171 }
172 myOptionsEditor->myOptionsModified = true;
173 if (myRequireSaveNetwork) {
174 myOptionsEditor->myRequireSaveNetwork = true;
175 }
176 updateResetButton();
177 return 1;
178}
179
180
181long
183 myStringTextField->setText(myDefaultValue.c_str());
184 updateResetButton();
185 return 1;
186}
187
188
189std::string
191 return myStringTextField->getText().text();
192}
193
194
196 const std::string& topic, const std::string& name, const std::string& description,
197 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
198 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, drawRed, requireSaveNetwork) {
200 if (!editable) {
201 myStringVectorTextField->disable();
202 }
203 updateOption();
204}
205
206
207void
209 myStringVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
210 updateResetButton();
211}
212
213
214void
216 myStringVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
217 onCmdSetOption(nullptr, 0, nullptr);
218}
219
220
221long
223 myOptionsEditor->myOptionsContainer.resetWritable();
224 // check if reset or set
225 if (myStringVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
226 myOptionsEditor->myOptionsContainer.resetDefault(myName);
227 } else {
228 myOptionsEditor->myOptionsContainer.set(myName, myStringVectorTextField->getText().text());
229 }
230 myOptionsEditor->myOptionsModified = true;
231 if (myRequireSaveNetwork) {
232 myOptionsEditor->myRequireSaveNetwork = true;
233 }
234 updateResetButton();
235 return 1;
236}
237
238
239long
241 myStringVectorTextField->setText(myDefaultValue.c_str());
242 updateResetButton();
243 return 1;
244}
245
246
247std::string
249 return myStringVectorTextField->getText().text();
250}
251
252// ---------------------------------------------------------------------------
253// GNEOptionsEditorRow::OptionBool - methods
254// ---------------------------------------------------------------------------
255
257 const std::string& topic, const std::string& name, const std::string& description,
258 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
259 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, drawRed, requireSaveNetwork) {
261 if (!editable) {
262 myCheckButton->disable();
263 }
264 updateOption();
265}
266
267
268void
270 if (myOptionsEditor->myOptionsContainer.getBool(myName)) {
271 myCheckButton->setCheck(TRUE);
272 myCheckButton->setText(TL("true"));
273 } else {
274 myCheckButton->setCheck(FALSE);
275 myCheckButton->setText(TL("false"));
276 }
277 updateResetButton();
278}
279
280
281void
283 if (myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
284 myCheckButton->setCheck(TRUE);
285 myCheckButton->setText(TL("true"));
286 } else {
287 myCheckButton->setCheck(FALSE);
288 myCheckButton->setText(TL("false"));
289 }
290 onCmdSetOption(nullptr, 0, nullptr);
291}
292
293
294long
296 myOptionsEditor->myOptionsContainer.resetWritable();
297 // check if reset or set
298 const bool check = myCheckButton->getCheck() == TRUE;
299 if (check == myOptionsEditor->myOriginalOptionsContainer.getBool(myName)) {
300 myOptionsEditor->myOptionsContainer.resetDefault(myName);
301 } else if (check) {
302 myOptionsEditor->myOptionsContainer.set(myName, "true");
303 } else {
304 myOptionsEditor->myOptionsContainer.set(myName, "false");
305 }
306 // set text
307 if (check) {
308 myCheckButton->setText(TL("true"));
309 } else {
310 myCheckButton->setText(TL("false"));
311 }
312 myOptionsEditor->myOptionsModified = true;
313 if (myRequireSaveNetwork) {
314 myOptionsEditor->myRequireSaveNetwork = true;
315 }
316 // special checks for Debug flags
317 if ((myName == "gui-testing-debug") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug")) {
318 MsgHandler::enableDebugMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug"));
319 }
320 if ((myName == "gui-testing-debug-gl") && myOptionsEditor->myOptionsContainer.isSet("gui-testing-debug-gl")) {
321 MsgHandler::enableDebugGLMessages(myOptionsEditor->myOptionsContainer.getBool("gui-testing-debug-gl"));
322 }
323 updateResetButton();
324 return 1;
325}
326
327
328long
330 if (myDefaultValue.empty()) {
331 myCheckButton->setCheck(FALSE);
332 myCheckButton->setText(TL("false"));
333 } else if (StringUtils::toBool(myDefaultValue)) {
334 myCheckButton->setCheck(TRUE);
335 myCheckButton->setText(TL("true"));
336 } else {
337 myCheckButton->setCheck(FALSE);
338 myCheckButton->setText(TL("false"));
339 }
340 updateResetButton();
341 return 1;
342}
343
344
345std::string
347 return myCheckButton->getCheck() ? "true" : "false";
348}
349
350// ---------------------------------------------------------------------------
351// GNEOptionsEditorRow::OptionInt - methods
352// ---------------------------------------------------------------------------
353
355 const std::string& topic, const std::string& name, const std::string& description,
356 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
357 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, drawRed, requireSaveNetwork) {
359 if (!editable) {
360 myIntTextField->disable();
361 }
362 updateOption();
363}
364
365
366void
368 myIntTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
369 updateResetButton();
370}
371
372
373void
375 myIntTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
376 onCmdSetOption(nullptr, 0, nullptr);
377}
378
379
380long
382 if (myIntTextField->getText().empty()) {
383 myIntTextField->setText(myDefaultValue.c_str());
384 } else {
385 myOptionsEditor->myOptionsContainer.resetWritable();
386 // check if reset or set
387 if (myIntTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
388 myOptionsEditor->myOptionsContainer.resetDefault(myName);
389 } else {
390 myOptionsEditor->myOptionsContainer.set(myName, myIntTextField->getText().text());
391 }
392 myOptionsEditor->myOptionsModified = true;
393 if (myRequireSaveNetwork) {
394 myOptionsEditor->myRequireSaveNetwork = true;
395 }
396 }
397 updateResetButton();
398 return 1;
399}
400
401
402long
404 myIntTextField->setText(myDefaultValue.c_str());
405 updateResetButton();
406 return 1;
407}
408
409
410std::string
412 return myIntTextField->getText().text();
413}
414
415// ---------------------------------------------------------------------------
416// GNEOptionsEditorRow::OptionIntVector - methods
417// ---------------------------------------------------------------------------
418
420 const std::string& topic, const std::string& name, const std::string& description,
421 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
422 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, drawRed, requireSaveNetwork) {
425 if (!editable) {
426 myIntVectorTextField->disable();
427 }
428 updateOption();
429}
430
431
432void
434 myIntVectorTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
435 updateResetButton();
436}
437
438
439void
441 myIntVectorTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
442 onCmdSetOption(nullptr, 0, nullptr);
443}
444
445
446long
448 try {
449 // check that int vector can be parsed
450 const auto intVector = StringTokenizer(myIntVectorTextField->getText().text()).getVector();
451 for (const auto& intValue : intVector) {
452 StringUtils::toInt(intValue);
453 }
454 myOptionsEditor->myOptionsContainer.resetWritable();
455 // check if reset or set
456 if (myIntVectorTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getString(myName)) {
457 myOptionsEditor->myOptionsContainer.resetDefault(myName);
458 } else {
459 myOptionsEditor->myOptionsContainer.set(myName, myIntVectorTextField->getText().text());
460 }
461 myIntVectorTextField->setTextColor(GUIDesignTextColorBlack);
462 myOptionsEditor->myOptionsModified = true;
463 if (myRequireSaveNetwork) {
464 myOptionsEditor->myRequireSaveNetwork = true;
465 }
466 } catch (...) {
467 myIntVectorTextField->setTextColor(GUIDesignTextColorRed);
468 }
469 updateResetButton();
470 return 1;
471}
472
473
474long
476 myIntVectorTextField->setText(myDefaultValue.c_str());
477 updateResetButton();
478 return 1;
479}
480
481
482std::string
484 return myIntVectorTextField->getText().text();
485}
486
487// ---------------------------------------------------------------------------
488// GNEOptionsEditorRow::OptionFloat - methods
489// ---------------------------------------------------------------------------
490
492 const std::string& topic, const std::string& name, const std::string& description,
493 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
494 OptionRow(optionsEditor, parent, topic, name, description, parseFloat(defaultValue), editable, drawRed, requireSaveNetwork) {
497 if (!editable) {
498 myFloatTextField->disable();
499 }
500 updateOption();
501}
502
503
504void
506 myFloatTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
507 updateResetButton();
508}
509
510
511void
513 myFloatTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
514 onCmdSetOption(nullptr, 0, nullptr);
515}
516
517
518long
520 // avoid empty values
521 if (myFloatTextField->getText().empty()) {
522 myFloatTextField->setText(myDefaultValue.c_str());
523 } else {
524 myOptionsEditor->myOptionsContainer.resetWritable();
525 // check if reset or set
526 if (myFloatTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
527 myOptionsEditor->myOptionsContainer.resetDefault(myName);
528 } else {
529 myOptionsEditor->myOptionsContainer.set(myName, myFloatTextField->getText().text());
530 }
531 myOptionsEditor->myOptionsModified = true;
532 if (myRequireSaveNetwork) {
533 myOptionsEditor->myRequireSaveNetwork = true;
534 }
535 }
536 updateResetButton();
537 return 1;
538}
539
540
541long
543 myFloatTextField->setText(myDefaultValue.c_str());
544 updateResetButton();
545 return 1;
546}
547
548
549std::string
551 return myFloatTextField->getText().text();
552}
553
554
555std::string
556GNEOptionsEditorRow::OptionFloat::parseFloat(const std::string& value) const {
557 try {
558 return toString(StringUtils::toDouble(value));
559 } catch (...) {
560 return value;
561 }
562}
563
564// ---------------------------------------------------------------------------
565// GNEOptionsEditorRow::OptionTime - methods
566// ---------------------------------------------------------------------------
567
569 const std::string& topic, const std::string& name, const std::string& description,
570 const std::string& defaultValue, const bool editable, const bool drawRed, const bool requireSaveNetwork) :
571 OptionRow(optionsEditor, parent, topic, name, description, parseTime(defaultValue), editable, drawRed, requireSaveNetwork) {
574 if (!editable) {
575 myTimeTextField->disable();
576 }
577 updateOption();
578}
579
580
581void
583 myTimeTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
584 updateResetButton();
585}
586
587
588void
590 myTimeTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
591 onCmdSetOption(nullptr, 0, nullptr);
592}
593
594
595long
597 // avoid empty values
598 if (myTimeTextField->getText().empty()) {
599 myTimeTextField->setText(myDefaultValue.c_str());
600 } else {
601 myOptionsEditor->myOptionsContainer.resetWritable();
602 // check if reset or set
603 if (myTimeTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
604 myOptionsEditor->myOptionsContainer.resetDefault(myName);
605 } else {
606 myOptionsEditor->myOptionsContainer.set(myName, myTimeTextField->getText().text());
607 }
608 myOptionsEditor->myOptionsModified = true;
609 if (myRequireSaveNetwork) {
610 myOptionsEditor->myRequireSaveNetwork = true;
611 }
612 }
613 updateResetButton();
614 return 1;
615}
616
617
618long
620 myTimeTextField->setText(myDefaultValue.c_str());
621 updateResetButton();
622 return 1;
623}
624
625
626std::string
628 return myTimeTextField->getText().text();
629}
630
631
632std::string
633GNEOptionsEditorRow::OptionTime::parseTime(const std::string& value) const {
634 try {
635 return time2string(string2time(value));
636 } catch (...) {
637 return value;
638 }
639}
640
641// ---------------------------------------------------------------------------
642// GNEOptionsEditorRow::OptionFilename - methods
643// ---------------------------------------------------------------------------
644
645GNEOptionsEditorRow::OptionFilename::OptionFilename(GNEOptionsEditor* optionsEditor, FXComposite* parent, const std::string& topic,
646 const std::string& name, const std::string& description, const std::string& defaultValue, const bool editable, const bool drawRed,
647 const bool requireSaveNetwork) :
648 OptionRow(optionsEditor, parent, topic, name, description, defaultValue, editable, drawRed, requireSaveNetwork) {
652 if (!editable) {
653 myOpenFilenameButton->disable();
654 myFilenameTextField->disable();
655 }
656 updateOption();
657}
658
659
660void
662 myFilenameTextField->setText(myOptionsEditor->myOptionsContainer.getValueString(myName).c_str());
663 updateResetButton();
664}
665
666
667void
669 myFilenameTextField->setText(myOptionsEditor->myOriginalOptionsContainer.getValueString(myName).c_str());
670 onCmdSetOption(nullptr, 0, nullptr);
671}
672
673
674long
676 // get open mode
678 if (myName.find("output") != std::string::npos || myName.find("log") != std::string::npos) {
680 } else if (myName.find("files") != std::string::npos) {
682 }
683 // open dialog
684 const GNEFileDialog XMLFileDialog(myOptionsEditor->myDialog->getApplicationWindow(), myOptionsEditor->myDialog,
685 TL("XML file"),
686 SUMOXMLDefinitions::XMLFileExtensions.getStrings(), openMode,
688 // check that file is valid
689 if (XMLFileDialog.getResult() == GNEDialog::Result::ACCEPT) {
690 myFilenameTextField->setText((openMode == GNEFileDialog::OpenMode::LOAD_MULTIPLE
691 ? joinToString(XMLFileDialog.getFilenames(), ",").c_str()
692 : XMLFileDialog.getFilename().c_str()), TRUE);
693 }
694 updateResetButton();
695 return 1;
696}
697
698
699long
701 if (SUMOXMLDefinitions::isValidFilename(myFilenameTextField->getText().text())) {
702 myOptionsEditor->myOptionsContainer.resetWritable();
703 // check if reset or set
704 if (myFilenameTextField->getText().text() == myOptionsEditor->myOriginalOptionsContainer.getValueString(myName)) {
705 myOptionsEditor->myOptionsContainer.resetDefault(myName);
706 } else {
707 myOptionsEditor->myOptionsContainer.set(myName, myFilenameTextField->getText().text());
708 }
709 myFilenameTextField->setTextColor(GUIDesignTextColorBlack);
710 myOptionsEditor->myOptionsModified = true;
711 if (myRequireSaveNetwork) {
712 myOptionsEditor->myRequireSaveNetwork = true;
713 }
714 } else {
715 myFilenameTextField->setTextColor(GUIDesignTextColorRed);
716 }
717 updateResetButton();
718 return 1;
719}
720
721
722long
724 myFilenameTextField->setText(myDefaultValue.c_str());
725 updateResetButton();
726 return 1;
727}
728
729
731
732
733std::string
735 return myFilenameTextField->getText().text();
736}
737
738/****************************************************************************/
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 drawRed, 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
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
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 drawRed, const bool requireSaveNetwork)
constructor
FXTextField * myIntTextField
text field
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 drawRed, const bool requireSaveNetwork)
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
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 drawRed, 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
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
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 drawRed, const bool requireSaveNetwork)
constructor
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 drawRed, 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
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 drawRed, const bool requireSaveNetwork)
constructor
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