#include <GUIDialog_GLObjChooser.h>

Definition at line 55 of file GUIDialog_GLObjChooser.h.
Public Member Functions | |
| GUIGlObject * | getObject () const throw () |
| Returns the chosen (selected) object. | |
| GUIDialog_GLObjChooser (GUISUMOViewParent *parent, FXIcon *icon, const FXString &title, GUIGlObjectType type, GUIGlObjectStorage &glStorage) | |
| Constructor. | |
| long | onChgText (FXObject *, FXSelector, void *) |
| Callback: Something has been typed into the the field. | |
| long | onCmdCenter (FXObject *, FXSelector, void *) |
| Callback: The selected item shall be centered within the calling view. | |
| long | onCmdClose (FXObject *, FXSelector, void *) |
| Callback: The dialog shall be closed. | |
| long | onCmdText (FXObject *, FXSelector, void *) |
| Callback: Selects to current item if enter is pressed. | |
| long | onListKeyPress (FXObject *, FXSelector, void *) |
| Callback: Selects to current item if enter is pressed. | |
| ~GUIDialog_GLObjChooser () | |
| Destructor. | |
Protected Member Functions | |
| GUIDialog_GLObjChooser () | |
| FOX needs this. | |
Private Attributes | |
| FXList * | myList |
| The list that holds the ids. | |
| GUIGlObjectType | myObjectType |
| The artifact to choose. | |
| GUISUMOViewParent * | myParent |
| The parent window. | |
| GUIGlObject * | mySelected |
| The chosen id. | |
| FXTextField * | myTextEntry |
| The text field. | |
| GUIDialog_GLObjChooser::GUIDialog_GLObjChooser | ( | GUISUMOViewParent * | parent, | |
| FXIcon * | icon, | |||
| const FXString & | title, | |||
| GUIGlObjectType | type, | |||
| GUIGlObjectStorage & | glStorage | |||
| ) |
Constructor.
| [in] | parent | The calling view |
| [in] | icon | The icon to use |
| [in] | title | The title to use |
| [in] | type | The type of gl-objects to show instances of |
| [in] | glStorage | The storage to retrieve ids from |
| GUIDialog_GLObjChooser::~GUIDialog_GLObjChooser | ( | ) |
Destructor.
Definition at line 154 of file GUIDialog_GLObjChooser.cpp.
References GUISUMOViewParent::getParent(), myParent, and GUIMainWindow::removeChild().
00154 { 00155 myParent->getParent()->removeChild(this); 00156 }
| GUIDialog_GLObjChooser::GUIDialog_GLObjChooser | ( | ) | [inline, protected] |
| GUIGlObject* GUIDialog_GLObjChooser::getObject | ( | ) | const throw () [inline] |
Returns the chosen (selected) object.
Definition at line 78 of file GUIDialog_GLObjChooser.h.
References mySelected.
00078 { 00079 return static_cast<GUIGlObject*>(mySelected); 00080 }
| long GUIDialog_GLObjChooser::onChgText | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ||||
| ) |
Callback: Something has been typed into the the field.
Definition at line 180 of file GUIDialog_GLObjChooser.cpp.
References myList, and myTextEntry.
00180 { 00181 int id = myList->findItem(myTextEntry->getText(), -1, SEARCH_PREFIX); 00182 if (id<0) { 00183 return 1; 00184 } 00185 myList->deselectItem(myList->getCurrentItem()); 00186 myList->makeItemVisible(id); 00187 myList->selectItem(id); 00188 myList->setCurrentItem(id, true); 00189 return 1; 00190 }
| long GUIDialog_GLObjChooser::onCmdCenter | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ||||
| ) |
Callback: The selected item shall be centered within the calling view.
Definition at line 160 of file GUIDialog_GLObjChooser.cpp.
References myList, myParent, mySelected, and GUISUMOViewParent::setView().
00160 { 00161 int selected = myList->getCurrentItem(); 00162 if (selected>=0) { 00163 mySelected = static_cast<GUIGlObject*>(myList->getItemData(selected)); 00164 } else { 00165 mySelected = 0; 00166 } 00167 myParent->setView(mySelected); 00168 return 1; 00169 }
| long GUIDialog_GLObjChooser::onCmdClose | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ||||
| ) |
| long GUIDialog_GLObjChooser::onCmdText | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ||||
| ) |
Callback: Selects to current item if enter is pressed.
Definition at line 194 of file GUIDialog_GLObjChooser.cpp.
References myList, myParent, mySelected, and GUISUMOViewParent::setView().
00194 { 00195 int selected = myList->getCurrentItem(); 00196 if (selected>=0) { 00197 mySelected = static_cast<GUIGlObject*>(myList->getItemData(selected)); 00198 myParent->setView(mySelected); 00199 } 00200 return 1; 00201 }
| long GUIDialog_GLObjChooser::onListKeyPress | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ptr | |||
| ) |
Callback: Selects to current item if enter is pressed.
Definition at line 205 of file GUIDialog_GLObjChooser.cpp.
References myList, myParent, mySelected, and GUISUMOViewParent::setView().
00205 { 00206 FXEvent* event=(FXEvent*)ptr; 00207 switch (event->code) { 00208 case KEY_Return: { 00209 int current = myList->getCurrentItem(); 00210 if (current>=0&&myList->isItemSelected(current)) { 00211 mySelected = static_cast<GUIGlObject*>(myList->getItemData(current)); 00212 myParent->setView(mySelected); 00213 } 00214 } 00215 } 00216 return 1; 00217 }
FXList* GUIDialog_GLObjChooser::myList [private] |
The list that holds the ids.
Definition at line 101 of file GUIDialog_GLObjChooser.h.
Referenced by onChgText(), onCmdCenter(), onCmdText(), and onListKeyPress().
The parent window.
Definition at line 107 of file GUIDialog_GLObjChooser.h.
Referenced by onCmdCenter(), onCmdText(), onListKeyPress(), and ~GUIDialog_GLObjChooser().
GUIGlObject* GUIDialog_GLObjChooser::mySelected [private] |
The chosen id.
Definition at line 110 of file GUIDialog_GLObjChooser.h.
Referenced by getObject(), onCmdCenter(), onCmdText(), and onListKeyPress().
FXTextField* GUIDialog_GLObjChooser::myTextEntry [private] |
1.5.6