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.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A abstract class for editing additional elements
16 /****************************************************************************/
17 #ifndef GNEDemandElementDialog_h
18 #define GNEDemandElementDialog_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include <config.h>
25 
26 #include <fx.h>
27 #include <vector>
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 
34 class GNEDemandElement;
35 class GNEUndoList;
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
40 
45 class GNEDemandElementDialog : protected FXTopWindow {
47  FXDECLARE_ABSTRACT(GNEDemandElementDialog)
48 
49 public:
51  GNEDemandElementDialog(GNEDemandElement* parent, bool updatingElement, int width, int height);
52 
55 
58 
62  virtual long onCmdAccept(FXObject* sender, FXSelector sel, void* ptr) = 0;
63 
65  virtual long onCmdCancel(FXObject* sender, FXSelector sel, void* ptr) = 0;
66 
68  virtual long onCmdReset(FXObject*, FXSelector, void*) = 0;
69 
71  long onKeyPress(FXObject* sender, FXSelector sel, void* ptr);
72 
74  long onKeyRelease(FXObject* sender, FXSelector sel, void* ptr);
75 
77 
78 protected:
81 
84 
87 
89  FXVerticalFrame* myContentFrame;
90 
92  FXint openAsModalDialog(FXuint placement = PLACEMENT_CURSOR);
93 
95  void changeDemandElementDialogHeader(const std::string& newHeader);
96 
98  void initChanges();
99 
101  void acceptChanges();
102 
104  void cancelChanges();
105 
107  void resetChanges();
108 
109 private:
111  FXButton* myAcceptButton;
112 
114  FXButton* myCancelButton;
115 
117  FXButton* myResetButton;
118 
120  std::string myChangesDescription;
121 
124 
127 
130 };
131 
132 #endif
void acceptChanges()
Accept changes did in this dialog.
GNEDemandElementDialog & operator=(const GNEDemandElementDialog &)=delete
Invalidated assignment operator.
FXVerticalFrame * myContentFrame
frame for contents
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
int myNumberOfChanges
number of GNEChanges_... in dialog
void cancelChanges()
Cancel changes did in this dialog.
GNEDemandElement * myEditedDemandElement
pointer to edited aditional
long onKeyPress(FXObject *sender, FXSelector sel, void *ptr)
event after press a key
void initChanges()
init a new group of changes that will be do it in dialog
void changeDemandElementDialogHeader(const std::string &newHeader)
change additional dialog header
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
void resetChanges()
reset changes did in this dialog.
GNEDemandElementDialog()
FOX needs this.
FXButton * myResetButton
cancel button
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog) ...
GNEDemandElement * getEditedDemandElement() const
get edited DemandElement
FXButton * myCancelButton
cancel button
long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
event after release a key
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
Dialog to edit sequences, parameters, etc.. of DemandElements.
FXButton * myAcceptButton
accept button
std::string myChangesDescription
description of changes did in this additional dialog
FXint openAsModalDialog(FXuint placement=PLACEMENT_CURSOR)
execute dialog as modal
An Element which don&#39;t belongs to GNENet but has influency in the simulation.