SUMO - Simulation of Urban MObility
GUIDialog_GLObjChooser.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Class for the window that allows to choose a street, junction or vehicle
20 /****************************************************************************/
21 #ifndef GUIDialog_GLObjChooser_h
22 #define GUIDialog_GLObjChooser_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
36 #include <set>
37 #include <fx.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class GUIGlChildWindow;
45 class GUIGlObjectStorage;
46 class GUIGlObject;
47 
48 
49 // ===========================================================================
50 // class definition
51 // ===========================================================================
58 class GUIDialog_GLObjChooser : public FXMainWindow {
59  // FOX-declarations
60  FXDECLARE(GUIDialog_GLObjChooser)
61 
62 public:
69  GUIDialog_GLObjChooser(GUIGlChildWindow* parent, FXIcon* icon, const FXString& title,
70  const std::vector<GUIGlID>& ids,
71  GUIGlObjectStorage& glStorage);
72 
73 
76 
77 
82  return static_cast<GUIGlObject*>(mySelected);
83  }
84 
85 
86 
89 
91  long onCmdCenter(FXObject*, FXSelector, void*);
92 
94  long onCmdClose(FXObject*, FXSelector, void*);
95 
97  long onChgText(FXObject*, FXSelector, void*);
98 
100  long onCmdText(FXObject*, FXSelector, void*);
101 
103  long onListKeyPress(FXObject*, FXSelector, void*);
104 
106  long onCmdFilter(FXObject*, FXSelector, void*);
107 
109  long onCmdToggleSelection(FXObject*, FXSelector, void*);
111 
113  void show();
114 
115 private:
117  FXList* myList;
118 
120  FXButton* myCenterButton;
121 
124 
127 
129  FXTextField* myTextEntry;
130 
132  //volatile pointers to GUIGlObject
133  std::set<GUIGlID> myIDs;
134 
135 
136 protected:
139 
140 };
141 
142 
143 #endif
144 
145 /****************************************************************************/
146 
void show()
sets the focus after the window is created to work-around bug in libfox
long onCmdFilter(FXObject *, FXSelector, void *)
Callback: Hides unselected items if pressed.
long onCmdCenter(FXObject *, FXSelector, void *)
Callback: The selected item shall be centered within the calling view.
long onCmdText(FXObject *, FXSelector, void *)
Callback: Selects to current item if enter is pressed.
long onCmdToggleSelection(FXObject *, FXSelector, void *)
Callback: Toggle selection status of current object.
FXList * myList
The list that holds the ids.
GUIGlChildWindow * myParent
The parent window.
A storage for of displayed objects via their numerical id.
long onCmdClose(FXObject *, FXSelector, void *)
Callback: The dialog shall be closed.
FXButton * myCenterButton
The button that triggers centering on the select object.
std::set< GUIGlID > myIDs
myList contains (void) pointers to elements of myIDs instead of the more
GUIGlObject * getObject() const
Returns the chosen (selected) object.
long onListKeyPress(FXObject *, FXSelector, void *)
Callback: Selects to current item if enter is pressed.
GUIGlObject * mySelected
The chosen id.
FXTextField * myTextEntry
The text field.
long onChgText(FXObject *, FXSelector, void *)
Callback: Something has been typed into the the field.
GUIDialog_GLObjChooser()
FOX needs this.