Eclipse SUMO - Simulation of Urban MObility
GUIDialog_ChooserAbstract Class Reference

#include <GUIDialog_ChooserAbstract.h>

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

Public Member Functions

GUIGlObjectgetObject () const
 Returns the chosen (selected) object. More...
 
 GUIDialog_ChooserAbstract (GUIGlChildWindow *windowsParent, 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_ChooserAbstract ()
 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 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 toggleSelection (int listIndex)
 fox need this More...
 

Private Attributes

FXButton * myCenterButton
 The button that triggers centering on the select object. 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...
 
FXList * myList
 The list that holds the ids. More...
 
bool myLocateByName
 whether to locate by object name instead of id More...
 
GUIGlObjectmySelected
 The chosen id. 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 51 of file GUIDialog_ChooserAbstract.h.

Constructor & Destructor Documentation

◆ GUIDialog_ChooserAbstract()

GUIDialog_ChooserAbstract::GUIDialog_ChooserAbstract ( GUIGlChildWindow windowsParent,
FXIcon *  icon,
const FXString &  title,
const std::vector< GUIGlID > &  ids,
GUIGlObjectStorage glStorage 
)

◆ ~GUIDialog_ChooserAbstract()

GUIDialog_ChooserAbstract::~GUIDialog_ChooserAbstract ( )
virtual

Member Function Documentation

◆ filterACs()

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

filter ACs (needed in NETEDIT)

Reimplemented in GNEDialogACChooser.

Definition at line 330 of file GUIDialog_ChooserAbstract.cpp.

Referenced by onCmdFilterSubstr().

Here is the caller graph for this function:

◆ getObject()

GUIGlObject * GUIDialog_ChooserAbstract::getObject ( ) const

Returns the chosen (selected) object.

Returns
The selected object

Definition at line 108 of file GUIDialog_ChooserAbstract.cpp.

References mySelected.

◆ getObjectName()

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

@bbrief retrieve name for the given object

Reimplemented in GNEDialogACChooser.

Definition at line 250 of file GUIDialog_ChooserAbstract.cpp.

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

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

Here is the caller graph for this function:

◆ onChgText()

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

Callback: Something has been typed into the the field.

Definition at line 155 of file GUIDialog_ChooserAbstract.cpp.

References myCenterButton, myHaveFilteredSubstring, myList, myLocateByName, myTextEntry, and myTrackButton.

Referenced by FXDEFMAP(), and onCmdFilterSubstr().

Here is the caller graph for this function:

◆ onCmdCenter()

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

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

Definition at line 121 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdClose()

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

Callback: The dialog shall be closed.

Definition at line 148 of file GUIDialog_ChooserAbstract.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdFilter()

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

Callback: Hides unselected items if pressed.

Definition at line 214 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdFilterSubstr()

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

Callback: Hides unmatched items if pressed.

Definition at line 230 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdLocateByName()

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

Callback: Toggle locator by name.

Definition at line 296 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdText()

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

Callback: Selects to current item if enter is pressed.

Definition at line 189 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by FXDEFMAP(), and onListKeyPress().

Here is the caller graph for this function:

◆ onCmdToggleSelection()

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

Callback: Toggle selection status of current object.

Definition at line 278 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdTrack()

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

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

Definition at line 132 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().

Here is the caller graph for this function:

◆ onListKeyPress()

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

Callback: Selects to current item if enter is pressed.

Definition at line 200 of file GUIDialog_ChooserAbstract.cpp.

References onCmdText().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ refreshList()

void GUIDialog_ChooserAbstract::refreshList ( const std::vector< GUIGlID > &  ids)
protected

update the list with the given ids

Definition at line 259 of file GUIDialog_ChooserAbstract.cpp.

References FLAG, GUIGlObject::getGlID(), GUIIconSubSys::getIcon(), GUIGlObjectStorage::getObjectBlocking(), getObjectName(), GUIGlObjectStorage::gIDStorage, GUIGlChildWindow::isSelected(), myIDs, myList, myWindowsParent, and GUIGlObjectStorage::unblockObject().

Referenced by GNEDialogACChooser::GNEDialogACChooser(), onCmdFilter(), onCmdFilterSubstr(), and onCmdLocateByName().

Here is the caller graph for this function:

◆ show()

void GUIDialog_ChooserAbstract::show ( )

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

Definition at line 114 of file GUIDialog_ChooserAbstract.cpp.

References myTextEntry.

◆ toggleSelection()

void GUIDialog_ChooserAbstract::toggleSelection ( int  listIndex)
protectedvirtual

fox need this

toggle selection (handled differently in NETEDIT)

Reimplemented in GNEDialogACChooser.

Definition at line 323 of file GUIDialog_ChooserAbstract.cpp.

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

Referenced by onCmdToggleSelection().

Here is the caller graph for this function:

Field Documentation

◆ myCenterButton

FXButton* GUIDialog_ChooserAbstract::myCenterButton
private

The button that triggers centering on the select object.

Definition at line 136 of file GUIDialog_ChooserAbstract.h.

Referenced by onChgText().

◆ myHaveFilteredSubstring

bool GUIDialog_ChooserAbstract::myHaveFilteredSubstring
private

whether the list was filter by substring

Definition at line 154 of file GUIDialog_ChooserAbstract.h.

Referenced by onChgText(), and onCmdFilterSubstr().

◆ myIDs

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

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

Definition at line 148 of file GUIDialog_ChooserAbstract.h.

Referenced by refreshList().

◆ myList

FXList* GUIDialog_ChooserAbstract::myList
private

◆ myLocateByName

bool GUIDialog_ChooserAbstract::myLocateByName
private

whether to locate by object name instead of id

Definition at line 151 of file GUIDialog_ChooserAbstract.h.

Referenced by getObjectName(), onChgText(), and onCmdLocateByName().

◆ mySelected

GUIGlObject* GUIDialog_ChooserAbstract::mySelected
private

The chosen id.

Definition at line 142 of file GUIDialog_ChooserAbstract.h.

Referenced by getObject().

◆ myTextEntry

FXTextField* GUIDialog_ChooserAbstract::myTextEntry
private

The text field.

Definition at line 145 of file GUIDialog_ChooserAbstract.h.

Referenced by onChgText(), onCmdFilterSubstr(), onCmdLocateByName(), and show().

◆ myTrackButton

FXButton* GUIDialog_ChooserAbstract::myTrackButton
private

The button that triggers tracking on the select vehicle.

Definition at line 139 of file GUIDialog_ChooserAbstract.h.

Referenced by onChgText().

◆ myWindowsParent

GUIGlChildWindow* GUIDialog_ChooserAbstract::myWindowsParent
private

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