Eclipse SUMO - Simulation of Urban MObility
GUIDialog_GLObjChooser Class Reference

#include <GUIDialog_GLObjChooser.h>

Inheritance diagram for GUIDialog_GLObjChooser:
Collaboration diagram for GUIDialog_GLObjChooser:

Public Member Functions

GUIGlObjectgetObject () 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 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...
 
 GUIDialog_GLObjChooser ()
 FOX needs this. 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< GUIGlIDmyIDs
 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...
 
GUIGlChildWindowmyParent
 The parent window. More...
 
GUIGlObjectmySelected
 The chosen id. More...
 
FXTextField * myTextEntry
 The text field. More...
 
FXButton * myTrackButton
 The button that triggers tracking on the select vehicle. 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 52 of file GUIDialog_GLObjChooser.h.

Constructor & Destructor Documentation

◆ GUIDialog_GLObjChooser() [1/2]

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

◆ ~GUIDialog_GLObjChooser()

GUIDialog_GLObjChooser::~GUIDialog_GLObjChooser ( )
virtual

Destructor.

Definition at line 96 of file GUIDialog_GLObjChooser.cpp.

References GUIGlChildWindow::getParent(), myParent, and GUIMainWindow::removeChild().

◆ GUIDialog_GLObjChooser() [2/2]

GUIDialog_GLObjChooser::GUIDialog_GLObjChooser ( )
inlineprotected

FOX needs this.

Definition at line 154 of file GUIDialog_GLObjChooser.h.

Member Function Documentation

◆ getObject()

GUIGlObject* GUIDialog_GLObjChooser::getObject ( ) const
inline

Returns the chosen (selected) object.

Returns
The selected object

Definition at line 75 of file GUIDialog_GLObjChooser.h.

References mySelected.

◆ getObjectName()

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

@bbrief retrieve name for the given object

Reimplemented in GNEDialogACChooser.

Definition at line 217 of file GUIDialog_GLObjChooser.cpp.

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

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

◆ onChgText()

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

Callback: Something has been typed into the the field.

Definition at line 143 of file GUIDialog_GLObjChooser.cpp.

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

◆ onCmdCenter()

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

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

Definition at line 109 of file GUIDialog_GLObjChooser.cpp.

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

◆ onCmdClose()

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

Callback: The dialog shall be closed.

Definition at line 136 of file GUIDialog_GLObjChooser.cpp.

◆ onCmdFilter()

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

Callback: Hides unselected items if pressed.

Definition at line 202 of file GUIDialog_GLObjChooser.cpp.

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

◆ onCmdLocateByName()

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

◆ onCmdText()

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

Callback: Selects to current item if enter is pressed.

Definition at line 177 of file GUIDialog_GLObjChooser.cpp.

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

Referenced by onListKeyPress().

◆ onCmdToggleSelection()

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

Callback: Toggle selection status of current object.

Definition at line 245 of file GUIDialog_GLObjChooser.cpp.

References flag, GUIIconSubSys::getIcon(), GUIGlChildWindow::getView(), ICON_FLAG, myList, myParent, and toggleSelection().

◆ onCmdTrack()

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

◆ onListKeyPress()

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

Callback: Selects to current item if enter is pressed.

Definition at line 188 of file GUIDialog_GLObjChooser.cpp.

References onCmdText().

◆ refreshList()

◆ show()

void GUIDialog_GLObjChooser::show ( )

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

Definition at line 102 of file GUIDialog_GLObjChooser.cpp.

References myTextEntry.

◆ toggleSelection()

void GUIDialog_GLObjChooser::toggleSelection ( int  listIndex)
protectedvirtual

toggle selection (handled differently in NETEDIT)

Reimplemented in GNEDialogACChooser.

Definition at line 288 of file GUIDialog_GLObjChooser.cpp.

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

Referenced by onCmdToggleSelection().

Field Documentation

◆ myCenterButton

FXButton* GUIDialog_GLObjChooser::myCenterButton
private

The button that triggers centering on the select object.

Definition at line 131 of file GUIDialog_GLObjChooser.h.

Referenced by onChgText().

◆ myIDs

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

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

Definition at line 147 of file GUIDialog_GLObjChooser.h.

Referenced by refreshList().

◆ myList

FXList* GUIDialog_GLObjChooser::myList
private

◆ myLocateByName

bool GUIDialog_GLObjChooser::myLocateByName
private

whether to locate by object name instead of id

Definition at line 150 of file GUIDialog_GLObjChooser.h.

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

◆ myParent

GUIGlChildWindow* GUIDialog_GLObjChooser::myParent
private

◆ mySelected

GUIGlObject* GUIDialog_GLObjChooser::mySelected
private

The chosen id.

Definition at line 140 of file GUIDialog_GLObjChooser.h.

Referenced by getObject().

◆ myTextEntry

FXTextField* GUIDialog_GLObjChooser::myTextEntry
private

The text field.

Definition at line 143 of file GUIDialog_GLObjChooser.h.

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

◆ myTrackButton

FXButton* GUIDialog_GLObjChooser::myTrackButton
private

The button that triggers tracking on the select vehicle.

Definition at line 134 of file GUIDialog_GLObjChooser.h.

Referenced by onChgText().


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