Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/options/GNESumoOptionsDialog.cpp
169684 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file GNESumoOptionsDialog.cpp
15
/// @author Pablo Alvarez Lopez
16
/// @date May 2023
17
///
18
// A Dialog for setting options (see OptionsCont)
19
/****************************************************************************/
20
#include <config.h>
21
22
#include <netedit/GNEApplicationWindow.h>
23
#include <netedit/GNEViewNet.h>
24
#include <netedit/GNEViewParent.h>
25
#include <utils/foxtools/MFXGroupBoxModule.h>
26
#include <utils/gui/div/GUIDesigns.h>
27
#include <utils/options/OptionsLoader.h>
28
#include <xercesc/parsers/SAXParser.hpp>
29
#include <utils/foxtools/MFXCheckButtonTooltip.h>
30
31
#include "GNESumoOptionsDialog.h"
32
#include "GNEOptionsEditor.h"
33
34
// ===========================================================================
35
// Defines
36
// ===========================================================================
37
38
#define TREELISTWIDTH 200
39
40
// ===========================================================================
41
// method definitions
42
// ===========================================================================
43
44
GNESumoOptionsDialog::GNESumoOptionsDialog(GNEApplicationWindow* applicationWindow, OptionsCont& optionsContainer,
45
const OptionsCont& originalOptionsContainer) :
46
GNEDialog(applicationWindow, TL("Edit SUMO options"), GUIIcon::SUMO_MINI, DialogType::OPTIONS_SUMO,
47
GNEDialog::Buttons::ACCEPT_CANCEL_RESET, OpenType::MODAL, GNEDialog::ResizeMode::RESIZABLE, 800, 600) {
48
// build options editor
49
myOptionsEditor = new GNEOptionsEditor(this, "SUMO", optionsContainer, originalOptionsContainer);
50
// open modal dialog
51
openDialog();
52
}
53
54
55
GNESumoOptionsDialog::~GNESumoOptionsDialog() { }
56
57
58
void
59
GNESumoOptionsDialog::runInternalTest(const InternalTestStep::DialogArgument* dialogArgument) {
60
myOptionsEditor->runInternalTest(dialogArgument);
61
}
62
63
64
bool
65
GNESumoOptionsDialog::isOptionModified() const {
66
return myOptionsEditor->isOptionModified();
67
}
68
69
70
long
71
GNESumoOptionsDialog::onCmdCancel(FXObject*, FXSelector, void*) {
72
// reset options
73
myOptionsEditor->resetAllOptions();
74
// close dialog canceling
75
return closeDialogCanceling();
76
}
77
78
79
long
80
GNESumoOptionsDialog::onCmdReset(FXObject*, FXSelector, void*) {
81
// reset options
82
myOptionsEditor->resetAllOptions();
83
return 1;
84
}
85
86
/****************************************************************************/
87
88