Eclipse SUMO - Simulation of Urban MObility
GNETypeFrame.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-2022 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 // The Widget for edit Type elements (vehicle, person and container)
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 
25 // ===========================================================================
26 // class declarations
27 // ===========================================================================
28 
29 class GNEVehicle;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
37 class GNETypeFrame : public GNEFrame {
38 
39 public:
40 
41  // ===========================================================================
42  // class TypeSelector
43  // ===========================================================================
44 
45  class TypeSelector : public FXGroupBoxModule {
48 
49  public:
51  TypeSelector(GNETypeFrame* typeFrameParent);
52 
54  ~TypeSelector();
55 
58 
60  void setCurrentType(GNEDemandElement* vType);
61 
63  void refreshTypeSelector();
64 
67 
71  long onCmdSelectItem(FXObject*, FXSelector, void*);
73 
74  protected:
75  FOX_CONSTRUCTOR(TypeSelector)
76 
77  private:
80 
83 
85  FXComboBox* myTypeMatchBox;
86  };
87 
88  // ===========================================================================
89  // class TypeEditor
90  // ===========================================================================
91 
92  class TypeEditor : public FXGroupBoxModule {
94  FXDECLARE(GNETypeFrame::TypeEditor)
95 
96  public:
98  TypeEditor(GNETypeFrame* typeFrameParent);
99 
101  ~TypeEditor();
102 
104  void showTypeEditorModule();
105 
107  void hideTypeEditorModule();
108 
111 
115  long onCmdCreateType(FXObject*, FXSelector, void*);
116 
118  long onCmdDeleteResetType(FXObject*, FXSelector, void*);
119 
121  long onCmdCopyType(FXObject*, FXSelector, void*);
123 
124  protected:
125  FOX_CONSTRUCTOR(TypeEditor)
126 
127 
128  void resetType();
129 
131  void deleteType();
132 
133  private:
136 
139 
142 
144  FXButton* myCopyTypeButton;
145  };
146 
151  GNETypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
152 
154  ~GNETypeFrame();
155 
157  void show();
158 
160  TypeSelector* getTypeSelector() const;
161 
162 protected:
164  void attributeUpdated();
165 
168 
169 private:
172 
175 
178 
181 };
FXGroupBoxModule (based on FXGroupBox)
An Element which don't belongs to GNENet but has influency in the simulation.
void resetType()
reset type
long onCmdDeleteResetType(FXObject *, FXSelector, void *)
Called when "Delete/Reset Vehicle Type" button is clicked.
void deleteType()
delete type
void showTypeEditorModule()
show TypeEditor modul
FXButton * myCreateTypeButton
"create vehicle type" button
Definition: GNETypeFrame.h:138
long onCmdCreateType(FXObject *, FXSelector, void *)
FXButton * myDeleteResetTypeButton
"delete/reset vehicle type" button
Definition: GNETypeFrame.h:141
GNETypeFrame * myTypeFrameParent
pointer to vehicle type Frame Parent
Definition: GNETypeFrame.h:135
FXButton * myCopyTypeButton
"copy vehicle type"
Definition: GNETypeFrame.h:144
TypeEditor(GNETypeFrame *typeFrameParent)
FOX-declaration.
void hideTypeEditorModule()
hide TypeEditor box
void refreshTypeEditorModule()
update TypeEditor modul
long onCmdCopyType(FXObject *, FXSelector, void *)
Called when "Copy Vehicle Type" button is clicked.
TypeSelector(GNETypeFrame *typeFrameParent)
FOX-declaration.
void setCurrentType(GNEDemandElement *vType)
set current Vehicle Type
GNETypeFrame * myTypeFrameParent
pointer to Frame Parent
Definition: GNETypeFrame.h:79
GNEDemandElement * myCurrentType
pointer to current vehicle type
Definition: GNETypeFrame.h:82
void refreshTypeSelectorIDs()
refresh vehicle type selector (only IDs, without refreshing attributes)
long onCmdSelectItem(FXObject *, FXSelector, void *)
FXComboBox * myTypeMatchBox
comboBox with the list of vTypes
Definition: GNETypeFrame.h:85
GNEDemandElement * getCurrentType() const
get current Vehicle Type
void refreshTypeSelector()
refresh vehicle type selector
GNEFrameAttributeModules::AttributesEditorExtended * myAttributesEditorExtended
modul for open extended attributes dialog
Definition: GNETypeFrame.h:177
void attributesEditorExtendedDialogOpened()
open AttributesCreator extended dialog (used for editing advance attributes of Vehicle Types)
void show()
show Frame
TypeSelector * getTypeSelector() const
get vehicle type selector
void attributeUpdated()
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
GNETypeFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
GNEFrameAttributeModules::AttributesEditor * myTypeAttributesEditor
editorinternal vehicle type attributes
Definition: GNETypeFrame.h:174
TypeEditor * myTypeEditor
Vehicle Type editor (Create, copy, etc.)
Definition: GNETypeFrame.h:180
~GNETypeFrame()
Destructor.
TypeSelector * myTypeSelector
vehicle type selector
Definition: GNETypeFrame.h:171