Eclipse SUMO - Simulation of Urban MObility
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 
31 class GNEDemandElement;
32 class GNEUndoList;
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
37 
42 class GNEDemandElementDialog : protected FXTopWindow {
44  FXDECLARE_ABSTRACT(GNEDemandElementDialog)
45 
46 public:
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 
78 protected:
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 
108 private:
110  FXButton* myAcceptButton;
111 
113  FXButton* myCancelButton;
114 
116  FXButton* myResetButton;
117 
119  FXButton* myFocusButton;
120 
123 
126 
129 
131  GNEDemandElementDialog& operator=(const GNEDemandElementDialog&) = delete;
132 };
Dialog to edit sequences, parameters, etc.. of DemandElements.
FXButton * myAcceptButton
accept button
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
GNEDemandElementDialog(GNEDemandElement *parent, bool updatingElement, int width, int height)
FOX-declaration abstract.
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
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