SUMO - Simulation of Urban MObility
GUIDialog_GLObjChooser.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Class for the window that allows to choose a street, junction or vehicle
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIDialog_GLObjChooser_h
23 #define GUIDialog_GLObjChooser_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <vector>
37 #include <set>
38 #include <fx.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class GUIGlChildWindow;
46 class GUIGlObjectStorage;
47 class GUIGlObject;
48 
49 
50 // ===========================================================================
51 // class definition
52 // ===========================================================================
59 class GUIDialog_GLObjChooser : public FXMainWindow {
60  // FOX-declarations
61  FXDECLARE(GUIDialog_GLObjChooser)
62 
63 public:
70  GUIDialog_GLObjChooser(GUIGlChildWindow* parent, FXIcon* icon, const FXString& title,
71  const std::vector<GUIGlID>& ids,
72  GUIGlObjectStorage& glStorage);
73 
74 
77 
78 
83  return static_cast<GUIGlObject*>(mySelected);
84  }
85 
86 
87 
90 
92  long onCmdCenter(FXObject*, FXSelector, void*);
93 
95  long onCmdClose(FXObject*, FXSelector, void*);
96 
98  long onChgText(FXObject*, FXSelector, void*);
99 
101  long onCmdText(FXObject*, FXSelector, void*);
102 
104  long onListKeyPress(FXObject*, FXSelector, void*);
105 
107  long onCmdFilter(FXObject*, FXSelector, void*);
109 
111  void show();
112 
113 private:
115  FXList* myList;
116 
118  FXButton* myCenterButton;
119 
122 
125 
127  FXTextField* myTextEntry;
128 
130  //volatile pointers to GUIGlObject
131  std::set<GUIGlID> myIDs;
132 
133 
134 protected:
137 
138 };
139 
140 
141 #endif
142 
143 /****************************************************************************/
144 
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.
GUIGlObject * getObject() const
Returns the chosen (selected) 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
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.