![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GUIDialog_GLObjChooser.h>
Public Member Functions | |
GUIGlObject * | getObject () const |
Returns the chosen (selected) object. More... | |
GUIDialog_GLObjChooser (GUIGlChildWindow *parent, FXIcon *icon, const FXString &title, const std::vector< GUIGlID > &ids, GUIGlObjectStorage &glStorage) | |
Constructor. More... | |
void | show () |
sets the focus after the window is created to work-around bug in libfox More... | |
virtual | ~GUIDialog_GLObjChooser () |
Destructor. More... | |
FOX-callbacks | |
long | onCmdCenter (FXObject *, FXSelector, void *) |
Callback: The selected item shall be centered within the calling view. More... | |
long | onCmdTrack (FXObject *, FXSelector, void *) |
Callback: The selected vehicle shall be tracked within the calling view. More... | |
long | onCmdClose (FXObject *, FXSelector, void *) |
Callback: The dialog shall be closed. More... | |
long | onChgText (FXObject *, FXSelector, void *) |
Callback: Something has been typed into the the field. More... | |
long | onCmdText (FXObject *, FXSelector, void *) |
Callback: Selects to current item if enter is pressed. More... | |
long | onListKeyPress (FXObject *, FXSelector, void *) |
Callback: Selects to current item if enter is pressed. More... | |
long | onCmdFilter (FXObject *, FXSelector, void *) |
Callback: Hides unselected items if pressed. More... | |
long | onCmdFilterSubstr (FXObject *, FXSelector, void *) |
Callback: Hides unmatched items if pressed. More... | |
long | onCmdToggleSelection (FXObject *, FXSelector, void *) |
Callback: Toggle selection status of current object. More... | |
long | onCmdLocateByName (FXObject *, FXSelector, void *) |
Callback: Toggle locator by name. More... | |
Protected Member Functions | |
virtual std::string | getObjectName (GUIGlObject *o) const |
@bbrief retrieve name for the given object More... | |
void | refreshList (const std::vector< GUIGlID > &ids) |
update the list with the given ids More... | |
virtual void | toggleSelection (int listIndex) |
toggle selection (handled differently in NETEDIT) More... | |
Private Attributes | |
FXButton * | myCenterButton |
The button that triggers centering on the select object. More... | |
std::set< GUIGlID > | myIDs |
myList contains (void) pointers to elements of myIDs instead of the more More... | |
FXList * | myList |
The list that holds the ids. More... | |
bool | myLocateByName |
whether to locate by object name instead of id More... | |
GUIGlChildWindow * | myParent |
The parent window. More... | |
GUIGlObject * | mySelected |
The chosen id. More... | |
FXTextField * | myTextEntry |
The text field. More... | |
FXButton * | myTrackButton |
The button that triggers tracking on the select vehicle. More... | |
Instances of this class are windows that display the list of instances from a given artifact like vehicles, edges or junctions and allow one of their items
Definition at line 51 of file GUIDialog_GLObjChooser.h.
GUIDialog_GLObjChooser::GUIDialog_GLObjChooser | ( | GUIGlChildWindow * | parent, |
FXIcon * | icon, | ||
const FXString & | title, | ||
const std::vector< GUIGlID > & | ids, | ||
GUIGlObjectStorage & | glStorage | ||
) |
Constructor.
[in] | parent | The calling view |
[in] | icon | The icon to use |
[in] | title | The title to use |
[in] | glStorage | The storage to retrieve ids from |
Definition at line 62 of file GUIDialog_GLObjChooser.cpp.
References GUIIconSubSys::getIcon(), GUIDesignAuxiliarFrame, GUIDesignChooserButtons, GUIDesignChooserLayoutLeft, GUIDesignChooserLayoutList, GUIDesignChooserLayoutRight, GUIDesignChooserListSingle, GUIDesignChooserTextField, GUIDesignHorizontalSeparator, ICON_FLAG, ICON_NO, ICON_RECENTERVIEW, MID_CANCEL, MID_CHOOSEN_INVERT, MID_CHOOSEN_NAME, MID_CHOOSER_CENTER, MID_CHOOSER_FILTER, MID_CHOOSER_FILTER_SUBSTR, MID_CHOOSER_LIST, MID_CHOOSER_TEXT, and MID_CHOOSER_TRACK.
|
virtual |
Destructor.
Definition at line 97 of file GUIDialog_GLObjChooser.cpp.
References GUIGlChildWindow::getParent(), myParent, and GUIMainWindow::removeChild().
|
inline |
Returns the chosen (selected) object.
Definition at line 74 of file GUIDialog_GLObjChooser.h.
References mySelected.
|
protectedvirtual |
@bbrief retrieve name for the given object
Reimplemented in GNEDialogACChooser.
Definition at line 235 of file GUIDialog_GLObjChooser.cpp.
References GUIGlObject::getMicrosimID(), GUIGlObject::getOptionalName(), and myLocateByName.
Referenced by GNEDialogACChooser::getObjectName(), onCmdLocateByName(), and refreshList().
long GUIDialog_GLObjChooser::onChgText | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Something has been typed into the the field.
Definition at line 144 of file GUIDialog_GLObjChooser.cpp.
References myCenterButton, myList, myLocateByName, myTextEntry, and myTrackButton.
long GUIDialog_GLObjChooser::onCmdCenter | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: The selected item shall be centered within the calling view.
Definition at line 110 of file GUIDialog_GLObjChooser.cpp.
References GUIGlChildWindow::getView(), myList, myParent, GUIGlChildWindow::setView(), and GUISUMOAbstractView::stopTrack().
long GUIDialog_GLObjChooser::onCmdClose | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: The dialog shall be closed.
Definition at line 137 of file GUIDialog_GLObjChooser.cpp.
long GUIDialog_GLObjChooser::onCmdFilter | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Hides unselected items if pressed.
Definition at line 203 of file GUIDialog_GLObjChooser.cpp.
References flag, GUIIconSubSys::getIcon(), ICON_FLAG, myList, and refreshList().
long GUIDialog_GLObjChooser::onCmdFilterSubstr | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Hides unmatched items if pressed.
Definition at line 219 of file GUIDialog_GLObjChooser.cpp.
References myList, myTextEntry, and refreshList().
long GUIDialog_GLObjChooser::onCmdLocateByName | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Toggle locator by name.
Definition at line 281 of file GUIDialog_GLObjChooser.cpp.
References GUIGlObjectStorage::getObjectBlocking(), getObjectName(), GUIGlObjectStorage::gIDStorage, myList, myLocateByName, myTextEntry, refreshList(), and GUIGlObjectStorage::unblockObject().
long GUIDialog_GLObjChooser::onCmdText | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Selects to current item if enter is pressed.
Definition at line 178 of file GUIDialog_GLObjChooser.cpp.
References myList, myParent, and GUIGlChildWindow::setView().
Referenced by onListKeyPress().
long GUIDialog_GLObjChooser::onCmdToggleSelection | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Toggle selection status of current object.
Definition at line 263 of file GUIDialog_GLObjChooser.cpp.
References flag, GUIIconSubSys::getIcon(), GUIGlChildWindow::getView(), ICON_FLAG, myList, myParent, and toggleSelection().
long GUIDialog_GLObjChooser::onCmdTrack | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: The selected vehicle shall be tracked within the calling view.
Definition at line 121 of file GUIDialog_GLObjChooser.cpp.
References GUIGlObjectStorage::getObjectBlocking(), GUIGlChildWindow::getView(), GUIGlObjectStorage::gIDStorage, GLO_VEHICLE, myList, myParent, GUIGlChildWindow::setView(), GUISUMOAbstractView::startTrack(), and GUIGlObjectStorage::unblockObject().
long GUIDialog_GLObjChooser::onListKeyPress | ( | FXObject * | , |
FXSelector | , | ||
void * | ptr | ||
) |
Callback: Selects to current item if enter is pressed.
Definition at line 189 of file GUIDialog_GLObjChooser.cpp.
References onCmdText().
|
protected |
update the list with the given ids
Definition at line 244 of file GUIDialog_GLObjChooser.cpp.
References GUIGlObject::getGlID(), GUIIconSubSys::getIcon(), GUIGlObjectStorage::getObjectBlocking(), getObjectName(), GUIGlObjectStorage::gIDStorage, ICON_FLAG, GUIGlChildWindow::isSelected(), myIDs, myList, myParent, and GUIGlObjectStorage::unblockObject().
Referenced by GNEDialogACChooser::GNEDialogACChooser(), onCmdFilter(), onCmdFilterSubstr(), and onCmdLocateByName().
void GUIDialog_GLObjChooser::show | ( | ) |
sets the focus after the window is created to work-around bug in libfox
Definition at line 103 of file GUIDialog_GLObjChooser.cpp.
References myTextEntry.
|
protectedvirtual |
toggle selection (handled differently in NETEDIT)
Reimplemented in GNEDialogACChooser.
Definition at line 306 of file GUIDialog_GLObjChooser.cpp.
References gSelected, myList, and GUISelectedStorage::toggleSelection().
Referenced by onCmdToggleSelection().
|
private |
The button that triggers centering on the select object.
Definition at line 133 of file GUIDialog_GLObjChooser.h.
Referenced by onChgText().
|
private |
myList contains (void) pointers to elements of myIDs instead of the more
Definition at line 149 of file GUIDialog_GLObjChooser.h.
Referenced by refreshList().
|
private |
The list that holds the ids.
Definition at line 130 of file GUIDialog_GLObjChooser.h.
Referenced by onChgText(), onCmdCenter(), onCmdFilter(), onCmdFilterSubstr(), onCmdLocateByName(), onCmdText(), onCmdToggleSelection(), onCmdTrack(), refreshList(), and toggleSelection().
|
private |
whether to locate by object name instead of id
Definition at line 152 of file GUIDialog_GLObjChooser.h.
Referenced by getObjectName(), onChgText(), and onCmdLocateByName().
|
private |
The parent window.
Definition at line 139 of file GUIDialog_GLObjChooser.h.
Referenced by onCmdCenter(), onCmdText(), onCmdToggleSelection(), onCmdTrack(), refreshList(), and ~GUIDialog_GLObjChooser().
|
private |
|
private |
The text field.
Definition at line 145 of file GUIDialog_GLObjChooser.h.
Referenced by onChgText(), onCmdFilterSubstr(), onCmdLocateByName(), and show().
|
private |
The button that triggers tracking on the select vehicle.
Definition at line 136 of file GUIDialog_GLObjChooser.h.
Referenced by onChgText().