Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAdditionalDialog.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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// A abstract class for editing additional elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24#include <vector>
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30
31class GNEAdditional;
32class GNEUndoList;
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
42class GNEAdditionalDialog : protected FXTopWindow {
44 FXDECLARE_ABSTRACT(GNEAdditionalDialog)
45
46public:
48 GNEAdditionalDialog(GNEAdditional* parent, bool updatingElement, int width, int height);
49
52
55
59 virtual long onCmdAccept(FXObject* sender, FXSelector sel, void* ptr) = 0;
60
62 virtual long onCmdCancel(FXObject* sender, FXSelector sel, void* ptr) = 0;
63
65 virtual long onCmdReset(FXObject*, FXSelector, void*) = 0;
66
68 long onKeyPress(FXObject* sender, FXSelector sel, void* ptr);
69
71 long onKeyRelease(FXObject* sender, FXSelector sel, void* ptr);
72
74
75protected:
76 FOX_CONSTRUCTOR(GNEAdditionalDialog)
77
78
80
83
85 FXVerticalFrame* myContentFrame;
86
88 FXint openAsModalDialog(FXuint placement = PLACEMENT_CURSOR);
89
91 void changeAdditionalDialogHeader(const std::string& newHeader);
92
94 void initChanges();
95
97 void acceptChanges();
98
100 void cancelChanges();
101
103 void resetChanges();
104
105private:
108
110 FXButton* myCancelButton;
111
113 FXButton* myResetButton;
114
117
120
123
125 GNEAdditionalDialog& operator=(const GNEAdditionalDialog&) = delete;
126};
Dialog to edit sequences, parameters, etc.. of Additionals.
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
void changeAdditionalDialogHeader(const std::string &newHeader)
change additional dialog header
FXButton * myCancelButton
cancel button
FXVerticalFrame * myContentFrame
frame for contents
int myNumberOfChanges
number of GNEChanges_... in dialog
GNEAdditional * getEditedAdditional() const
get edited Additional
void acceptChanges()
Accept changes did in this dialog.
std::string myChangesDescription
description of changes did in this additional dialog
long onKeyPress(FXObject *sender, FXSelector sel, void *ptr)
event after press a key
void cancelChanges()
Cancel changes did in this dialog.
FXButton * myKeepOldButton
accept button
FXButton * myResetButton
cancel button
FXint openAsModalDialog(FXuint placement=PLACEMENT_CURSOR)
execute dialog as modal
GNEAdditional * myEditedAdditional
pointer to edited additional
void initChanges()
init a new group of changes that will be do it in dialog
void resetChanges()
reset changes did in this dialog.
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
event after release a key
An Element which don't belong to GNENet but has influence in the simulation.
Definition json.hpp:4471