![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GUIDialog_ChooserAbstract.h>
Public Member Functions | |
int | getMessageId () const |
GUIGlObject * | getObject () const |
Returns the chosen (selected) object. | |
GUIDialog_ChooserAbstract (GUIGlChildWindow *windowsParent, int messageId, FXIcon *icon, const FXString &title, const std::vector< GUIGlID > &ids, GUIGlObjectStorage &glStorage) | |
Constructor. | |
void | loadWindowPos () |
void | saveWindowPos () |
void | show () |
sets the focus after the window is created to work-around bug in libfox | |
virtual | ~GUIDialog_ChooserAbstract () |
Destructor. | |
FOX-callbacks | |
long | onCmdCenter (FXObject *, FXSelector, void *) |
Callback: The selected item shall be centered within the calling view. | |
long | onCmdTrack (FXObject *, FXSelector, void *) |
Callback: The selected vehicle shall be tracked within the calling view. | |
long | onCmdClose (FXObject *, FXSelector, void *) |
Callback: The dialog shall be closed. | |
long | onChgText (FXObject *, FXSelector, void *) |
Callback: Something has been typed into the field. | |
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. | |
long | onChgList (FXObject *, FXSelector, void *) |
Callback: Current list item has changed. | |
long | onChgListSel (FXObject *, FXSelector, void *) |
Callback: Current list item selection has changed. | |
long | onCmdFilter (FXObject *, FXSelector, void *) |
Callback: Hides unselected items if pressed. | |
long | onCmdFilterSubstr (FXObject *, FXSelector, void *) |
Callback: Hides unmatched items if pressed. | |
long | onCmdToggleSelection (FXObject *, FXSelector, void *) |
Callback: Toggle selection status of current object / list. | |
long | onCmdAddListSelection (FXObject *, FXSelector, void *) |
long | onCmdClearListSelection (FXObject *, FXSelector, void *) |
long | onCmdLocateByName (FXObject *, FXSelector, void *) |
Callback: Toggle locator by name. | |
long | onCmdUpdate (FXObject *, FXSelector, void *) |
Callback: Update list. | |
Protected Member Functions | |
virtual void | deselect (int listIndex) |
unset selection (handled differently in netedit) | |
virtual void | filterACs (const std::vector< GUIGlID > &GLIDs) |
filter ACs (needed in netedit) | |
virtual std::string | getObjectName (GUIGlObject *o) const |
retrieve name for the given object | |
void | refreshList (const std::vector< GUIGlID > &ids) |
update the list with the given ids | |
virtual void | select (int listIndex) |
set selection (handled differently in netedit) | |
virtual void | toggleSelection (int listIndex) |
fox need this | |
Protected Attributes | |
int | myDefaultHeight |
int | myDefaultWidth |
int | myDefaultX |
int | myDefaultY |
int | myMinSize |
int | myMinTitlebarHeight |
FXWindow * | myParent |
The window for which the position is being stored. | |
bool | myStoreSize |
whether window size shall be stored | |
std::string | myWindowName |
Name for storing in the registry. | |
Private Attributes | |
FXCheckButton * | myCaseSensitive |
Whether search is case sensitive. | |
FXButton * | myCenterButton |
The button that triggers centering on the select object. | |
FXLabel * | myCountLabel |
label for declaring list size | |
bool | myHaveFilteredSubstring |
whether the list was filter by substring | |
std::set< GUIGlID > | myIDs |
myList contains (void) pointers to elements of myIDs instead of the more volatile pointers to GUIGlObject | |
FXCheckButton * | myInstantCenter |
Whether each change in the list should re-center the view. | |
FXList * | myList |
The list that holds the ids. | |
bool | myLocateByName |
whether to locate by object name instead of id | |
int | myMessageId |
the object type being chosen | |
GUIGlObject * | mySelected |
The chosen id. | |
FXTextField * | myTextEntry |
The text field. | |
FXButton * | myTrackButton |
The button that triggers tracking on the select vehicle. | |
GUIGlChildWindow * | myWindowsParent |
window parent | |
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_ChooserAbstract.h.
GUIDialog_ChooserAbstract::GUIDialog_ChooserAbstract | ( | GUIGlChildWindow * | windowsParent, |
int | messageId, | ||
FXIcon * | icon, | ||
const FXString & | title, | ||
const std::vector< GUIGlID > & | ids, | ||
GUIGlObjectStorage & | glStorage | ||
) |
Constructor.
[in] | windowsParent | The calling view |
[in] | viewParent | The calling view (netedit) |
[in] | icon | The icon to use |
[in] | title | The title to use |
[in] | glStorage | The storage to retrieve ids from |
Definition at line 72 of file GUIDialog_ChooserAbstract.cpp.
References GUIMainWindow::addChild(), GUIDesigns::buildFXButton(), FLAG, GUIGlChildWindow::getGUIMainWindowParent(), GUIIconSubSys::getIcon(), GUIDesignAuxiliarFrame, GUIDesignChooserButtons, GUIDesignChooserLayoutLeft, GUIDesignChooserLayoutList, GUIDesignChooserLayoutRight, GUIDesignChooserListSingle, GUIDesignChooserTextField, GUIDesignHorizontalSeparator, GUIPersistentWindowPos::loadWindowPos(), MID_CANCEL, MID_CHOOSEN_CLEAR, MID_CHOOSEN_INVERT, MID_CHOOSEN_NAME, MID_CHOOSEN_SELECT, MID_CHOOSER_CENTER, MID_CHOOSER_FILTER, MID_CHOOSER_FILTER_SUBSTR, MID_CHOOSER_LIST, MID_CHOOSER_TEXT, MID_CHOOSER_TRACK, MID_UPDATE, myCaseSensitive, myCenterButton, myCountLabel, myInstantCenter, myList, myTextEntry, myTrackButton, myWindowsParent, NO, RECENTERVIEW, refreshList(), RELOAD, show(), and TL.
|
virtual |
Destructor.
Definition at line 123 of file GUIDialog_ChooserAbstract.cpp.
References GUIGlChildWindow::getGUIMainWindowParent(), myCaseSensitive, myInstantCenter, myWindowsParent, and GUIMainWindow::removeChild().
|
protectedvirtual |
unset selection (handled differently in netedit)
Reimplemented in GNEACChooserDialog.
Definition at line 430 of file GUIDialog_ChooserAbstract.cpp.
References GUISelectedStorage::deselect(), gSelected, and myList.
Referenced by onCmdClearListSelection().
|
protectedvirtual |
filter ACs (needed in netedit)
Reimplemented in GNEACChooserDialog.
Definition at line 437 of file GUIDialog_ChooserAbstract.cpp.
Referenced by onCmdFilterSubstr().
|
inline |
Definition at line 124 of file GUIDialog_ChooserAbstract.h.
References myMessageId.
Referenced by GUISUMOViewParent::eraseGLObjChooser().
GUIGlObject * GUIDialog_ChooserAbstract::getObject | ( | ) | const |
Returns the chosen (selected) object.
Definition at line 132 of file GUIDialog_ChooserAbstract.cpp.
References mySelected.
|
protectedvirtual |
retrieve name for the given object
Reimplemented in GNEACChooserDialog.
Definition at line 312 of file GUIDialog_ChooserAbstract.cpp.
References GUIGlObject::getMicrosimID(), GUIGlObject::getOptionalName(), and myLocateByName.
Referenced by GNEACChooserDialog::getObjectName(), onCmdLocateByName(), and refreshList().
|
inherited |
Definition at line 84 of file GUIPersistentWindowPos.cpp.
References MAX2(), MIN2(), GUIPersistentWindowPos::myDefaultHeight, GUIPersistentWindowPos::myDefaultWidth, GUIPersistentWindowPos::myDefaultX, GUIPersistentWindowPos::myDefaultY, GUIPersistentWindowPos::myMinSize, GUIPersistentWindowPos::myMinTitlebarHeight, GUIPersistentWindowPos::myParent, GUIPersistentWindowPos::myStoreSize, and GUIPersistentWindowPos::myWindowName.
Referenced by GUIDialog_ChooserAbstract(), GUIDialog_EditViewport::GUIDialog_EditViewport(), GUIDialog_GLChosenEditor::GUIDialog_GLChosenEditor(), GUIDialog_ViewSettings::GUIDialog_ViewSettings(), and GUIParameterTableWindow::GUIParameterTableWindow().
long GUIDialog_ChooserAbstract::onChgList | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Current list item has changed.
Definition at line 178 of file GUIDialog_ChooserAbstract.cpp.
References myInstantCenter, myList, and onCmdCenter().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onChgListSel | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Current list item selection has changed.
Definition at line 190 of file GUIDialog_ChooserAbstract.cpp.
References myList.
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onChgText | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Something has been typed into the field.
Definition at line 196 of file GUIDialog_ChooserAbstract.cpp.
References myCaseSensitive, myCenterButton, myHaveFilteredSubstring, myList, myLocateByName, myTextEntry, and myTrackButton.
Referenced by FXDEFMAP(), and onCmdFilterSubstr().
long GUIDialog_ChooserAbstract::onCmdAddListSelection | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 359 of file GUIDialog_ChooserAbstract.cpp.
References FLAG, GUIIconSubSys::getIcon(), GUIGlChildWindow::getView(), myList, myWindowsParent, and select().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdCenter | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: The selected item shall be centered within the calling view.
Definition at line 145 of file GUIDialog_ChooserAbstract.cpp.
References GUIGlChildWindow::getView(), myList, myWindowsParent, GUIGlChildWindow::setView(), and GUISUMOAbstractView::stopTrack().
Referenced by FXDEFMAP(), and onChgList().
long GUIDialog_ChooserAbstract::onCmdClearListSelection | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 373 of file GUIDialog_ChooserAbstract.cpp.
References deselect(), GUIGlChildWindow::getView(), myList, and myWindowsParent.
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdClose | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: The dialog shall be closed.
Definition at line 172 of file GUIDialog_ChooserAbstract.cpp.
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdFilter | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Hides unselected items if pressed.
Definition at line 268 of file GUIDialog_ChooserAbstract.cpp.
References FLAG, GUIIconSubSys::getIcon(), myList, and refreshList().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdFilterSubstr | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Hides unmatched items if pressed.
Definition at line 284 of file GUIDialog_ChooserAbstract.cpp.
References filterACs(), myCaseSensitive, myHaveFilteredSubstring, myList, myTextEntry, onChgText(), and refreshList().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdLocateByName | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Toggle locator by name.
Definition at line 386 of file GUIDialog_ChooserAbstract.cpp.
References GUIGlObjectStorage::getObjectBlocking(), getObjectName(), GUIGlObjectStorage::gIDStorage, myList, myLocateByName, myTextEntry, refreshList(), and GUIGlObjectStorage::unblockObject().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdText | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Selects to current item if enter is pressed.
Definition at line 239 of file GUIDialog_ChooserAbstract.cpp.
References myList, myWindowsParent, and GUIGlChildWindow::setView().
Referenced by FXDEFMAP(), and onListKeyPress().
long GUIDialog_ChooserAbstract::onCmdToggleSelection | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Toggle selection status of current object / list.
Definition at line 341 of file GUIDialog_ChooserAbstract.cpp.
References FLAG, GUIIconSubSys::getIcon(), GUIGlChildWindow::getView(), myList, myWindowsParent, and toggleSelection().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdTrack | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: The selected vehicle shall be tracked within the calling view.
Definition at line 156 of file GUIDialog_ChooserAbstract.cpp.
References GUIGlObject::getGlID(), GUIGlObjectStorage::getObjectBlocking(), GUIGlObject::getType(), GUIGlChildWindow::getView(), GUIGlObjectStorage::gIDStorage, GLO_VEHICLE, myList, myWindowsParent, GUIGlChildWindow::setView(), GUISUMOAbstractView::startTrack(), and GUIGlObjectStorage::unblockObject().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onCmdUpdate | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Callback: Update list.
Definition at line 412 of file GUIDialog_ChooserAbstract.cpp.
References GUIGlChildWindow::getObjectIDs(), myMessageId, myWindowsParent, and refreshList().
Referenced by FXDEFMAP().
long GUIDialog_ChooserAbstract::onListKeyPress | ( | FXObject * | , |
FXSelector | , | ||
void * | ptr | ||
) |
Callback: Selects to current item if enter is pressed.
Definition at line 250 of file GUIDialog_ChooserAbstract.cpp.
References myList, myTextEntry, and onCmdText().
Referenced by FXDEFMAP().
|
protected |
update the list with the given ids
Definition at line 321 of file GUIDialog_ChooserAbstract.cpp.
References FLAG, GUIGlObject::getGlID(), GUIIconSubSys::getIcon(), GUIGlObjectStorage::getObjectBlocking(), getObjectName(), GUIGlObjectStorage::gIDStorage, GUIGlChildWindow::isSelected(), myCountLabel, myIDs, myList, myWindowsParent, TLF, toString(), and GUIGlObjectStorage::unblockObject().
Referenced by GNEACChooserDialog::GNEACChooserDialog(), GUIDialog_ChooserAbstract(), onCmdFilter(), onCmdFilterSubstr(), onCmdLocateByName(), and onCmdUpdate().
|
inherited |
Definition at line 71 of file GUIPersistentWindowPos.cpp.
References GUIPersistentWindowPos::myParent, GUIPersistentWindowPos::myStoreSize, and GUIPersistentWindowPos::myWindowName.
Referenced by GUIDialog_ViewSettings::hide(), and GUIPersistentWindowPos::~GUIPersistentWindowPos().
|
protectedvirtual |
set selection (handled differently in netedit)
Reimplemented in GNEACChooserDialog.
Definition at line 424 of file GUIDialog_ChooserAbstract.cpp.
References gSelected, myList, and GUISelectedStorage::select().
Referenced by onCmdAddListSelection().
void GUIDialog_ChooserAbstract::show | ( | ) |
sets the focus after the window is created to work-around bug in libfox
Definition at line 138 of file GUIDialog_ChooserAbstract.cpp.
References myTextEntry.
Referenced by GUIDialog_ChooserAbstract().
|
protectedvirtual |
fox need this
toggle selection (handled differently in netedit)
Reimplemented in GNEACChooserDialog.
Definition at line 418 of file GUIDialog_ChooserAbstract.cpp.
References gSelected, myList, and GUISelectedStorage::toggleSelection().
Referenced by onCmdToggleSelection().
|
private |
Whether search is case sensitive.
Definition at line 185 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), onChgText(), onCmdFilterSubstr(), and ~GUIDialog_ChooserAbstract().
|
private |
The button that triggers centering on the select object.
Definition at line 161 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), and onChgText().
|
private |
label for declaring list size
Definition at line 182 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), and refreshList().
|
protectedinherited |
Definition at line 65 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 64 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 61 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 62 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
private |
whether the list was filter by substring
Definition at line 179 of file GUIDialog_ChooserAbstract.h.
Referenced by onChgText(), and onCmdFilterSubstr().
|
private |
myList contains (void) pointers to elements of myIDs instead of the more volatile pointers to GUIGlObject
Definition at line 173 of file GUIDialog_ChooserAbstract.h.
Referenced by refreshList().
|
private |
Whether each change in the list should re-center the view.
Definition at line 188 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), onChgList(), and ~GUIDialog_ChooserAbstract().
|
private |
The list that holds the ids.
Definition at line 158 of file GUIDialog_ChooserAbstract.h.
Referenced by deselect(), GUIDialog_ChooserAbstract(), onChgList(), onChgListSel(), onChgText(), onCmdAddListSelection(), onCmdCenter(), onCmdClearListSelection(), onCmdFilter(), onCmdFilterSubstr(), onCmdLocateByName(), onCmdText(), onCmdToggleSelection(), onCmdTrack(), onListKeyPress(), refreshList(), select(), and toggleSelection().
|
private |
whether to locate by object name instead of id
Definition at line 176 of file GUIDialog_ChooserAbstract.h.
Referenced by getObjectName(), onChgText(), and onCmdLocateByName().
|
private |
the object type being chosen
Definition at line 155 of file GUIDialog_ChooserAbstract.h.
Referenced by getMessageId(), and onCmdUpdate().
|
protectedinherited |
Definition at line 67 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 68 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
The window for which the position is being stored.
Definition at line 53 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
private |
The chosen id.
Definition at line 167 of file GUIDialog_ChooserAbstract.h.
Referenced by getObject().
|
protectedinherited |
whether window size shall be stored
Definition at line 59 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
private |
The text field.
Definition at line 170 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), onChgText(), onCmdFilterSubstr(), onCmdLocateByName(), onListKeyPress(), and show().
|
private |
The button that triggers tracking on the select vehicle.
Definition at line 164 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), and onChgText().
|
protectedinherited |
Name for storing in the registry.
Definition at line 56 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
private |
window parent
Definition at line 152 of file GUIDialog_ChooserAbstract.h.
Referenced by GUIDialog_ChooserAbstract(), onCmdAddListSelection(), onCmdCenter(), onCmdClearListSelection(), onCmdText(), onCmdToggleSelection(), onCmdTrack(), onCmdUpdate(), refreshList(), and ~GUIDialog_ChooserAbstract().