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 /****************************************************************************/
14 // A abstract class for editing additional elements
15 /****************************************************************************/
16 #ifndef GNEDemandElementDialog_h
17 #define GNEDemandElementDialog_h
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 
23 #include <config.h>
24 
25 #include <fx.h>
26 #include <vector>
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 
33 class GNEDemandElement;
34 class GNEUndoList;
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
39 
44 class GNEDemandElementDialog : protected FXTopWindow {
46  FXDECLARE_ABSTRACT(GNEDemandElementDialog)
47 
48 public:
50  GNEDemandElementDialog(GNEDemandElement* parent, bool updatingElement, int width, int height);
51 
54 
57 
61  virtual long onCmdAccept(FXObject* sender, FXSelector sel, void* ptr) = 0;
62 
64  virtual long onCmdCancel(FXObject* sender, FXSelector sel, void* ptr) = 0;
65 
67  virtual long onCmdReset(FXObject*, FXSelector, void*) = 0;
68 
70  long onKeyPress(FXObject* sender, FXSelector sel, void* ptr);
71 
73  long onKeyRelease(FXObject* sender, FXSelector sel, void* ptr);
74 
76 
77 protected:
79 
80 
82 
85 
87  FXVerticalFrame* myContentFrame;
88 
90  FXint openAsModalDialog(FXuint placement = PLACEMENT_CURSOR);
91 
93  void changeDemandElementDialogHeader(const std::string& newHeader);
94 
96  void initChanges();
97 
99  void acceptChanges();
100 
102  void cancelChanges();
103 
105  void resetChanges();
106 
107 private:
109  FXButton* myAcceptButton;
110 
112  FXButton* myCancelButton;
113 
115  FXButton* myResetButton;
116 
118  std::string myChangesDescription;
119 
122 
125 
127  GNEDemandElementDialog& operator=(const GNEDemandElementDialog&) = delete;
128 };
129 
130 #endif
GNEDemandElementDialog::getEditedDemandElement
GNEDemandElement * getEditedDemandElement() const
get edited DemandElement
Definition: GNEDemandElementDialog.cpp:90
GNEDemandElementDialog::acceptChanges
void acceptChanges()
Accept changes did in this dialog.
Definition: GNEDemandElementDialog.cpp:124
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNEDemandElementDialog::myAcceptButton
FXButton * myAcceptButton
accept button
Definition: GNEDemandElementDialog.h:109
GNEDemandElementDialog::cancelChanges
void cancelChanges()
Cancel changes did in this dialog.
Definition: GNEDemandElementDialog.cpp:135
GNEDemandElementDialog::onCmdCancel
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
GNEDemandElementDialog
Dialog to edit sequences, parameters, etc.. of DemandElements.
Definition: GNEDemandElementDialog.h:44
GNEDemandElementDialog::myNumberOfChanges
int myNumberOfChanges
number of GNEChanges_... in dialog
Definition: GNEDemandElementDialog.h:121
GNEDemandElementDialog::myContentFrame
FXVerticalFrame * myContentFrame
frame for contents
Definition: GNEDemandElementDialog.h:87
GNEDemandElementDialog::myResetButton
FXButton * myResetButton
cancel button
Definition: GNEDemandElementDialog.h:115
FOX_CONSTRUCTOR
#define FOX_CONSTRUCTOR(classname)
Definition: config.h:13
GNEDemandElementDialog::initChanges
void initChanges()
init a new group of changes that will be do it in dialog
Definition: GNEDemandElementDialog.cpp:115
GNEDemandElementDialog::onCmdAccept
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
GNEDemandElementDialog::myUpdatingElement
bool myUpdatingElement
flag to indicate if additional are being created or modified (cannot be changed after open dialog)
Definition: GNEDemandElementDialog.h:84
GNEDemandElementDialog::myCancelButton
FXButton * myCancelButton
cancel button
Definition: GNEDemandElementDialog.h:112
GNEDemandElementDialog::myEditedDemandElement
GNEDemandElement * myEditedDemandElement
pointer to edited aditional
Definition: GNEDemandElementDialog.h:81
GNEDemandElementDialog::onKeyPress
long onKeyPress(FXObject *sender, FXSelector sel, void *ptr)
event after press a key
Definition: GNEDemandElementDialog.cpp:96
GNEDemandElementDialog::myChangesDescription
std::string myChangesDescription
description of changes did in this additional dialog
Definition: GNEDemandElementDialog.h:118
GNEDemandElementDialog::~GNEDemandElementDialog
~GNEDemandElementDialog()
destructor
Definition: GNEDemandElementDialog.cpp:70
GNEDemandElementDialog::onCmdReset
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
GNEDemandElementDialog::openAsModalDialog
FXint openAsModalDialog(FXuint placement=PLACEMENT_CURSOR)
execute dialog as modal
Definition: GNEDemandElementDialog.cpp:77
GNEDemandElementDialog::GNEDemandElementDialog
GNEDemandElementDialog(GNEDemandElement *parent, bool updatingElement, int width, int height)
FOX-declaration abstract.
Definition: GNEDemandElementDialog.cpp:50
GNEDemandElementDialog::resetChanges
void resetChanges()
reset changes did in this dialog.
Definition: GNEDemandElementDialog.cpp:141
config.h
GNEUndoList
Definition: GNEUndoList.h:48
GNEDemandElementDialog::changeDemandElementDialogHeader
void changeDemandElementDialogHeader(const std::string &newHeader)
change additional dialog header
Definition: GNEDemandElementDialog.cpp:108
SUMOXMLDefinitions.h
GNEDemandElementDialog::onKeyRelease
long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
event after release a key
Definition: GNEDemandElementDialog.cpp:102