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
GNEDemandElementDialog::getEditedDemandElement
GNEDemandElement * getEditedDemandElement() const
get edited DemandElement
Definition: GNEDemandElementDialog.cpp:91
GNEDemandElementDialog::acceptChanges
void acceptChanges()
Accept changes did in this dialog.
Definition: GNEDemandElementDialog.cpp:125
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:54
GNEDemandElementDialog::operator=
GNEDemandElementDialog & operator=(const GNEDemandElementDialog &)=delete
Invalidated assignment operator.
GNEDemandElementDialog::myAcceptButton
FXButton * myAcceptButton
accept button
Definition: GNEDemandElementDialog.h:111
GNEDemandElementDialog::cancelChanges
void cancelChanges()
Cancel changes did in this dialog.
Definition: GNEDemandElementDialog.cpp:136
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:45
GNEDemandElementDialog::myNumberOfChanges
int myNumberOfChanges
number of GNEChanges_... in dialog
Definition: GNEDemandElementDialog.h:123
GNEDemandElementDialog::myContentFrame
FXVerticalFrame * myContentFrame
frame for contents
Definition: GNEDemandElementDialog.h:89
GNEDemandElementDialog::myResetButton
FXButton * myResetButton
cancel button
Definition: GNEDemandElementDialog.h:117
GNEDemandElementDialog::initChanges
void initChanges()
init a new group of changes that will be do it in dialog
Definition: GNEDemandElementDialog.cpp:116
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:86
GNEDemandElementDialog::myCancelButton
FXButton * myCancelButton
cancel button
Definition: GNEDemandElementDialog.h:114
GNEDemandElementDialog::myEditedDemandElement
GNEDemandElement * myEditedDemandElement
pointer to edited aditional
Definition: GNEDemandElementDialog.h:83
GNEDemandElementDialog::onKeyPress
long onKeyPress(FXObject *sender, FXSelector sel, void *ptr)
event after press a key
Definition: GNEDemandElementDialog.cpp:97
GNEDemandElementDialog::myChangesDescription
std::string myChangesDescription
description of changes did in this additional dialog
Definition: GNEDemandElementDialog.h:120
GNEDemandElementDialog::~GNEDemandElementDialog
~GNEDemandElementDialog()
destructor
Definition: GNEDemandElementDialog.cpp:71
GNEDemandElementDialog::GNEDemandElementDialog
GNEDemandElementDialog()
FOX needs this.
Definition: GNEDemandElementDialog.h:80
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:78
GNEDemandElementDialog::resetChanges
void resetChanges()
reset changes did in this dialog.
Definition: GNEDemandElementDialog.cpp:142
config.h
GNEUndoList
Definition: GNEUndoList.h:49
GNEDemandElementDialog::changeDemandElementDialogHeader
void changeDemandElementDialogHeader(const std::string &newHeader)
change additional dialog header
Definition: GNEDemandElementDialog.cpp:109
SUMOXMLDefinitions.h
GNEDemandElementDialog::onKeyRelease
long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
event after release a key
Definition: GNEDemandElementDialog.cpp:103