Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDemandElementDialog.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
32class GNEUndoList;
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
42class GNEDemandElementDialog : protected FXTopWindow {
44 FXDECLARE_ABSTRACT(GNEDemandElementDialog)
45
46public:
48 GNEDemandElementDialog(GNEDemandElement* 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 long onCmdFocusOnFrame(FXObject* sender, FXSelector sel, void* ptr);
75
77
78protected:
79 FOX_CONSTRUCTOR(GNEDemandElementDialog)
80
81
83
86
88 FXVerticalFrame* myContentFrame;
89
91 FXint openAsModalDialog(FXuint placement = PLACEMENT_CURSOR);
92
94 void changeDemandElementDialogHeader(const std::string& newHeader);
95
97 void initChanges();
98
100 void acceptChanges();
101
103 void cancelChanges();
104
106 void resetChanges();
107
108private:
111
113 FXButton* myCancelButton;
114
116 FXButton* myResetButton;
117
119 FXButton* myFocusButton;
120
123
126
129
132};
Dialog to edit sequences, parameters, etc.. of DemandElements.
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
void acceptChanges()
Accept changes did in this dialog.
GNEDemandElement * myEditedDemandElement
pointer to edited additional
long onCmdFocusOnFrame(FXObject *sender, FXSelector sel, void *ptr)
focus on frame
FXVerticalFrame * myContentFrame
frame for contents
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
FXint openAsModalDialog(FXuint placement=PLACEMENT_CURSOR)
execute dialog as modal
GNEDemandElement * getEditedDemandElement() const
get edited DemandElement
long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
event after release a key
FXButton * myFocusButton
focus button
void initChanges()
init a new group of changes that will be do it in dialog
FXButton * myResetButton
cancel button
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
FXButton * myKeepOldButton
accept button
void cancelChanges()
Cancel changes did in this dialog.
void changeDemandElementDialogHeader(const std::string &newHeader)
change additional dialog header
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
FXButton * myCancelButton
cancel button
std::string myChangesDescription
description of changes did in this additional dialog
void resetChanges()
reset changes did in this dialog.
int myNumberOfChanges
number of GNEChanges_... in dialog
long onKeyPress(FXObject *sender, FXSelector sel, void *ptr)
event after press a key
Definition json.hpp:4471