Eclipse SUMO - Simulation of Urban MObility
GUIDialog_GLObjChooser Class Reference

#include <GUIDialog_GLObjChooser.h>

Inheritance diagram for GUIDialog_GLObjChooser:
[legend]
Collaboration diagram for GUIDialog_GLObjChooser:
[legend]

Public Member Functions

int getMessageId () const
 
GUIGlObjectgetObject () const
 Returns the chosen (selected) object. More...
 
 GUIDialog_GLObjChooser (GUISUMOViewParent *SUMOViewParent, int messageId, FXIcon *icon, const FXString &title, const std::vector< GUIGlID > &ids, GUIGlObjectStorage &glStorage)
 Constructor. More...
 
void loadWindowPos ()
 
void saveWindowPos ()
 
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 onChgList (FXObject *, FXSelector, void *)
 Callback: Current list item has changed. More...
 
long onChgListSel (FXObject *, FXSelector, void *)
 Callback: Current list item selection has changed. 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 / list. More...
 
long onCmdAddListSelection (FXObject *, FXSelector, void *)
 
long onCmdClearListSelection (FXObject *, FXSelector, void *)
 
long onCmdLocateByName (FXObject *, FXSelector, void *)
 Callback: Toggle locator by name. More...
 
long onCmdUpdate (FXObject *, FXSelector, void *)
 Callback: Update list. More...
 

Protected Member Functions

virtual void deselect (int listIndex)
 unset selection (handled differently in netedit) More...
 
virtual void filterACs (const std::vector< GUIGlID > &GLIDs)
 filter ACs (needed in netedit) More...
 
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 select (int listIndex)
 set selection (handled differently in netedit) More...
 
virtual void toggleSelection (int listIndex)
 fox need this More...
 

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. More...
 
bool myStoreSize
 whether window size shall be stored More...
 
std::string myWindowName
 Name for storing in the registry. More...
 

Private Attributes

FXCheckButton * myCaseSensitive
 Whether search is case sensitive. More...
 
FXButton * myCenterButton
 The button that triggers centering on the select object. More...
 
FXLabel * myCountLabel
 label for declaring list size More...
 
bool myHaveFilteredSubstring
 whether the list was filter by substring More...
 
std::set< GUIGlIDmyIDs
 myList contains (void) pointers to elements of myIDs instead of the more volatile pointers to GUIGlObject More...
 
FXCheckButton * myInstantCenter
 Whether each change in the list should re-center the view. More...
 
FXList * myList
 The list that holds the ids. More...
 
bool myLocateByName
 whether to locate by object name instead of id More...
 
int myMessageId
 the object type being chosen More...
 
GUIGlObjectmySelected
 The chosen id. More...
 
GUISUMOViewParentmySUMOViewParent
 SUMO-GUI View parent. More...
 
FXTextField * myTextEntry
 The text field. More...
 
FXButton * myTrackButton
 The button that triggers tracking on the select vehicle. More...
 
GUIGlChildWindowmyWindowsParent
 window parent More...
 

Detailed Description

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 46 of file GUIDialog_GLObjChooser.h.

Constructor & Destructor Documentation

◆ GUIDialog_GLObjChooser()

GUIDialog_GLObjChooser::GUIDialog_GLObjChooser ( GUISUMOViewParent SUMOViewParent,
int  messageId,
FXIcon *  icon,
const FXString &  title,
const std::vector< GUIGlID > &  ids,
GUIGlObjectStorage glStorage 
)

Constructor.

Parameters
[in]SUMOViewParentThe calling view (SUMO-GUI)
[in]viewParentThe calling view (netedit)
[in]iconThe icon to use
[in]titleThe title to use
[in]glStorageThe storage to retrieve ids from

Definition at line 43 of file GUIDialog_GLObjChooser.cpp.

◆ ~GUIDialog_GLObjChooser()

GUIDialog_GLObjChooser::~GUIDialog_GLObjChooser ( )
virtual

Destructor.

Definition at line 50 of file GUIDialog_GLObjChooser.cpp.

References GUISUMOViewParent::eraseGLObjChooser(), and mySUMOViewParent.

Member Function Documentation

◆ deselect()

void GUIDialog_ChooserAbstract::deselect ( int  listIndex)
protectedvirtualinherited

unset selection (handled differently in netedit)

Reimplemented in GNEDialogACChooser.

Definition at line 423 of file GUIDialog_ChooserAbstract.cpp.

References GUISelectedStorage::deselect(), gSelected, and GUIDialog_ChooserAbstract::myList.

Referenced by GUIDialog_ChooserAbstract::onCmdClearListSelection().

Here is the caller graph for this function:

◆ filterACs()

void GUIDialog_ChooserAbstract::filterACs ( const std::vector< GUIGlID > &  GLIDs)
protectedvirtualinherited

filter ACs (needed in netedit)

Reimplemented in GNEDialogACChooser.

Definition at line 430 of file GUIDialog_ChooserAbstract.cpp.

Referenced by GUIDialog_ChooserAbstract::onCmdFilterSubstr().

Here is the caller graph for this function:

◆ getMessageId()

int GUIDialog_ChooserAbstract::getMessageId ( ) const
inlineinherited

Definition at line 123 of file GUIDialog_ChooserAbstract.h.

References GUIDialog_ChooserAbstract::myMessageId.

Referenced by GUISUMOViewParent::eraseGLObjChooser().

Here is the caller graph for this function:

◆ getObject()

GUIGlObject * GUIDialog_ChooserAbstract::getObject ( ) const
inherited

Returns the chosen (selected) object.

Returns
The selected object

Definition at line 125 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::mySelected.

◆ getObjectName()

std::string GUIDialog_ChooserAbstract::getObjectName ( GUIGlObject o) const
protectedvirtualinherited

@bbrief retrieve name for the given object

Reimplemented in GNEDialogACChooser.

Definition at line 305 of file GUIDialog_ChooserAbstract.cpp.

References GUIGlObject::getMicrosimID(), GUIGlObject::getOptionalName(), and GUIDialog_ChooserAbstract::myLocateByName.

Referenced by GNEDialogACChooser::getObjectName(), GUIDialog_ChooserAbstract::onCmdLocateByName(), and GUIDialog_ChooserAbstract::refreshList().

Here is the caller graph for this function:

◆ loadWindowPos()

void GUIPersistentWindowPos::loadWindowPos ( )
inherited

◆ onChgList()

long GUIDialog_ChooserAbstract::onChgList ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Current list item has changed.

Definition at line 171 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::myInstantCenter, GUIDialog_ChooserAbstract::myList, and GUIDialog_ChooserAbstract::onCmdCenter().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onChgListSel()

long GUIDialog_ChooserAbstract::onChgListSel ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Current list item selection has changed.

Definition at line 183 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::myList.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onChgText()

long GUIDialog_ChooserAbstract::onChgText ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Something has been typed into the the field.

Definition at line 189 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::myCaseSensitive, GUIDialog_ChooserAbstract::myCenterButton, GUIDialog_ChooserAbstract::myHaveFilteredSubstring, GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myLocateByName, GUIDialog_ChooserAbstract::myTextEntry, and GUIDialog_ChooserAbstract::myTrackButton.

Referenced by FXDEFMAP(), and GUIDialog_ChooserAbstract::onCmdFilterSubstr().

Here is the caller graph for this function:

◆ onCmdAddListSelection()

long GUIDialog_ChooserAbstract::onCmdAddListSelection ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Definition at line 352 of file GUIDialog_ChooserAbstract.cpp.

References FLAG, GUIIconSubSys::getIcon(), GUIGlChildWindow::getView(), GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myWindowsParent, and GUIDialog_ChooserAbstract::select().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdCenter()

long GUIDialog_ChooserAbstract::onCmdCenter ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: The selected item shall be centered within the calling view.

Definition at line 138 of file GUIDialog_ChooserAbstract.cpp.

References GUIGlChildWindow::getView(), GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myWindowsParent, GUIGlChildWindow::setView(), and GUISUMOAbstractView::stopTrack().

Referenced by FXDEFMAP(), and GUIDialog_ChooserAbstract::onChgList().

Here is the caller graph for this function:

◆ onCmdClearListSelection()

long GUIDialog_ChooserAbstract::onCmdClearListSelection ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Definition at line 366 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::deselect(), GUIGlChildWindow::getView(), GUIDialog_ChooserAbstract::myList, and GUIDialog_ChooserAbstract::myWindowsParent.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdClose()

long GUIDialog_ChooserAbstract::onCmdClose ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: The dialog shall be closed.

Definition at line 165 of file GUIDialog_ChooserAbstract.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdFilter()

long GUIDialog_ChooserAbstract::onCmdFilter ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Hides unselected items if pressed.

Definition at line 261 of file GUIDialog_ChooserAbstract.cpp.

References FLAG, GUIIconSubSys::getIcon(), GUIDialog_ChooserAbstract::myList, and GUIDialog_ChooserAbstract::refreshList().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdFilterSubstr()

long GUIDialog_ChooserAbstract::onCmdFilterSubstr ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Hides unmatched items if pressed.

Definition at line 277 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::filterACs(), GUIDialog_ChooserAbstract::myCaseSensitive, GUIDialog_ChooserAbstract::myHaveFilteredSubstring, GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myTextEntry, GUIDialog_ChooserAbstract::onChgText(), and GUIDialog_ChooserAbstract::refreshList().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdLocateByName()

long GUIDialog_ChooserAbstract::onCmdLocateByName ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Toggle locator by name.

Definition at line 379 of file GUIDialog_ChooserAbstract.cpp.

References GUIGlObjectStorage::getObjectBlocking(), GUIDialog_ChooserAbstract::getObjectName(), GUIGlObjectStorage::gIDStorage, GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myLocateByName, GUIDialog_ChooserAbstract::myTextEntry, GUIDialog_ChooserAbstract::refreshList(), and GUIGlObjectStorage::unblockObject().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdText()

long GUIDialog_ChooserAbstract::onCmdText ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Selects to current item if enter is pressed.

Definition at line 232 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myWindowsParent, and GUIGlChildWindow::setView().

Referenced by FXDEFMAP(), and GUIDialog_ChooserAbstract::onListKeyPress().

Here is the caller graph for this function:

◆ onCmdToggleSelection()

long GUIDialog_ChooserAbstract::onCmdToggleSelection ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Toggle selection status of current object / list.

Definition at line 334 of file GUIDialog_ChooserAbstract.cpp.

References FLAG, GUIIconSubSys::getIcon(), GUIGlChildWindow::getView(), GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myWindowsParent, and GUIDialog_ChooserAbstract::toggleSelection().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdTrack()

long GUIDialog_ChooserAbstract::onCmdTrack ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: The selected vehicle shall be tracked within the calling view.

Definition at line 149 of file GUIDialog_ChooserAbstract.cpp.

References GUIGlObject::getGlID(), GUIGlObjectStorage::getObjectBlocking(), GUIGlObject::getType(), GUIGlChildWindow::getView(), GUIGlObjectStorage::gIDStorage, GLO_VEHICLE, GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myWindowsParent, GUIGlChildWindow::setView(), GUISUMOAbstractView::startTrack(), and GUIGlObjectStorage::unblockObject().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdUpdate()

long GUIDialog_ChooserAbstract::onCmdUpdate ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Callback: Update list.

Definition at line 405 of file GUIDialog_ChooserAbstract.cpp.

References GUIGlChildWindow::getObjectIDs(), GUIDialog_ChooserAbstract::myMessageId, GUIDialog_ChooserAbstract::myWindowsParent, and GUIDialog_ChooserAbstract::refreshList().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onListKeyPress()

long GUIDialog_ChooserAbstract::onListKeyPress ( FXObject *  ,
FXSelector  ,
void *  ptr 
)
inherited

Callback: Selects to current item if enter is pressed.

Definition at line 243 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::myList, GUIDialog_ChooserAbstract::myTextEntry, and GUIDialog_ChooserAbstract::onCmdText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ refreshList()

◆ saveWindowPos()

void GUIPersistentWindowPos::saveWindowPos ( )
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().

Here is the caller graph for this function:

◆ select()

void GUIDialog_ChooserAbstract::select ( int  listIndex)
protectedvirtualinherited

set selection (handled differently in netedit)

Reimplemented in GNEDialogACChooser.

Definition at line 417 of file GUIDialog_ChooserAbstract.cpp.

References gSelected, GUIDialog_ChooserAbstract::myList, and GUISelectedStorage::select().

Referenced by GUIDialog_ChooserAbstract::onCmdAddListSelection().

Here is the caller graph for this function:

◆ show()

void GUIDialog_ChooserAbstract::show ( )
inherited

sets the focus after the window is created to work-around bug in libfox

Definition at line 131 of file GUIDialog_ChooserAbstract.cpp.

References GUIDialog_ChooserAbstract::myTextEntry.

◆ toggleSelection()

void GUIDialog_ChooserAbstract::toggleSelection ( int  listIndex)
protectedvirtualinherited

fox need this

toggle selection (handled differently in netedit)

Reimplemented in GNEDialogACChooser.

Definition at line 411 of file GUIDialog_ChooserAbstract.cpp.

References gSelected, GUIDialog_ChooserAbstract::myList, and GUISelectedStorage::toggleSelection().

Referenced by GUIDialog_ChooserAbstract::onCmdToggleSelection().

Here is the caller graph for this function:

Field Documentation

◆ myCaseSensitive

FXCheckButton* GUIDialog_ChooserAbstract::myCaseSensitive
privateinherited

◆ myCenterButton

FXButton* GUIDialog_ChooserAbstract::myCenterButton
privateinherited

The button that triggers centering on the select object.

Definition at line 160 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::onChgText().

◆ myCountLabel

FXLabel* GUIDialog_ChooserAbstract::myCountLabel
privateinherited

label for declaring list size

Definition at line 181 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::refreshList().

◆ myDefaultHeight

int GUIPersistentWindowPos::myDefaultHeight
protectedinherited

Definition at line 65 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myDefaultWidth

int GUIPersistentWindowPos::myDefaultWidth
protectedinherited

Definition at line 64 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myDefaultX

int GUIPersistentWindowPos::myDefaultX
protectedinherited

Definition at line 61 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myDefaultY

int GUIPersistentWindowPos::myDefaultY
protectedinherited

Definition at line 62 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myHaveFilteredSubstring

bool GUIDialog_ChooserAbstract::myHaveFilteredSubstring
privateinherited

whether the list was filter by substring

Definition at line 178 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::onChgText(), and GUIDialog_ChooserAbstract::onCmdFilterSubstr().

◆ myIDs

std::set<GUIGlID> GUIDialog_ChooserAbstract::myIDs
privateinherited

myList contains (void) pointers to elements of myIDs instead of the more volatile pointers to GUIGlObject

Definition at line 172 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::refreshList().

◆ myInstantCenter

FXCheckButton* GUIDialog_ChooserAbstract::myInstantCenter
privateinherited

Whether each change in the list should re-center the view.

Definition at line 187 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::onChgList(), and GUIDialog_ChooserAbstract::~GUIDialog_ChooserAbstract().

◆ myList

◆ myLocateByName

bool GUIDialog_ChooserAbstract::myLocateByName
privateinherited

◆ myMessageId

int GUIDialog_ChooserAbstract::myMessageId
privateinherited

the object type being chosen

Definition at line 154 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::getMessageId(), and GUIDialog_ChooserAbstract::onCmdUpdate().

◆ myMinSize

int GUIPersistentWindowPos::myMinSize
protectedinherited

Definition at line 67 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myMinTitlebarHeight

int GUIPersistentWindowPos::myMinTitlebarHeight
protectedinherited

Definition at line 68 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myParent

FXWindow* GUIPersistentWindowPos::myParent
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().

◆ mySelected

GUIGlObject* GUIDialog_ChooserAbstract::mySelected
privateinherited

The chosen id.

Definition at line 166 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::getObject().

◆ myStoreSize

bool GUIPersistentWindowPos::myStoreSize
protectedinherited

whether window size shall be stored

Definition at line 59 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().

◆ mySUMOViewParent

GUISUMOViewParent* GUIDialog_GLObjChooser::mySUMOViewParent
private

SUMO-GUI View parent.

Definition at line 66 of file GUIDialog_GLObjChooser.h.

Referenced by ~GUIDialog_GLObjChooser().

◆ myTextEntry

◆ myTrackButton

FXButton* GUIDialog_ChooserAbstract::myTrackButton
privateinherited

The button that triggers tracking on the select vehicle.

Definition at line 163 of file GUIDialog_ChooserAbstract.h.

Referenced by GUIDialog_ChooserAbstract::onChgText().

◆ myWindowName

std::string GUIPersistentWindowPos::myWindowName
protectedinherited

Name for storing in the registry.

Definition at line 56 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().

◆ myWindowsParent


The documentation for this class was generated from the following files: