Eclipse SUMO - Simulation of Urban MObility
GUIDialog_GLChosenEditor Class Reference

Editor for the list of chosen objects. More...

#include <GUIDialog_GLChosenEditor.h>

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

Public Member Functions

 GUIDialog_GLChosenEditor (GUIMainWindow *parent, GUISelectedStorage *str)
 Constructor (Notifies both the parent and the storage about being initialised) More...
 
void rebuildList ()
 Rebuilds the entire list. More...
 
void selectionUpdated ()
 called when selection is updated More...
 
 ~GUIDialog_GLChosenEditor ()
 Destructor (Notifies both the parent and the storage about being destroyed) More...
 
FOX-callbacks
long onCmdLoad (FXObject *, FXSelector, void *)
 Called when the user presses the Load-button. More...
 
long onCmdSave (FXObject *, FXSelector, void *)
 Called when the user presses the Save-button. More...
 
long onCmdDeselect (FXObject *, FXSelector, void *)
 Called when the user presses the Deselect-button. More...
 
long onCmdClear (FXObject *, FXSelector, void *)
 Called when the user presses the Clear-button. More...
 
long onCmdClose (FXObject *, FXSelector, void *)
 Called when the user presses the Close-button. More...
 

Protected Member Functions

 GUIDialog_GLChosenEditor ()
 FOX needs this. More...
 

Private Attributes

FXList * myList = nullptr
 The list that holds the ids. More...
 
GUIMainWindowmyParent = nullptr
 The parent window. More...
 
GUISelectedStoragemyStorage = nullptr
 The storage. More...
 

Detailed Description

Editor for the list of chosen objects.

See also
GUIMainWindow
GUISelectedStorage

Definition at line 47 of file GUIDialog_GLChosenEditor.h.

Constructor & Destructor Documentation

◆ GUIDialog_GLChosenEditor() [1/2]

GUIDialog_GLChosenEditor::GUIDialog_GLChosenEditor ( GUIMainWindow parent,
GUISelectedStorage str 
)

Constructor (Notifies both the parent and the storage about being initialised)

Parameters
[in]parentThe parent window
[in]strThe storage of object selections to use

Definition at line 59 of file GUIDialog_GLChosenEditor.cpp.

References FLAG, GUIIconSubSys::getIcon(), GUIDesignAuxiliarFrame, GUIDesignChooserButtons, GUIDesignChooserLayoutLeft, GUIDesignChooserLayoutList, GUIDesignChooserLayoutRight, GUIDesignChooserListMultiple, GUIDesignHorizontalSeparator, MID_CANCEL, MID_CHOOSEN_CLEAR, MID_CHOOSEN_DESELECT, MID_CHOOSEN_LOAD, MID_CHOOSEN_SAVE, MID_CHOOSER_LIST, NO, OPEN_CONFIG, SAVE, and TL.

◆ ~GUIDialog_GLChosenEditor()

GUIDialog_GLChosenEditor::~GUIDialog_GLChosenEditor ( )

Destructor (Notifies both the parent and the storage about being destroyed)

Definition at line 91 of file GUIDialog_GLChosenEditor.cpp.

References myParent, myStorage, GUISelectedStorage::remove2Update(), and GUIMainWindow::removeChild().

◆ GUIDialog_GLChosenEditor() [2/2]

GUIDialog_GLChosenEditor::GUIDialog_GLChosenEditor ( )
inlineprotected

FOX needs this.

Definition at line 114 of file GUIDialog_GLChosenEditor.h.

Member Function Documentation

◆ onCmdClear()

long GUIDialog_GLChosenEditor::onCmdClear ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Clear-button.

Clear the internal list and calls GUISelectedStorage::clear. Repaints itself

Definition at line 180 of file GUIDialog_GLChosenEditor.cpp.

References GUISelectedStorage::clear(), gSelected, myList, myParent, and GUIMainWindow::updateChildren().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdClose()

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

Called when the user presses the Close-button.

Closes itself.

Definition at line 189 of file GUIDialog_GLChosenEditor.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdDeselect()

long GUIDialog_GLChosenEditor::onCmdDeselect ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Deselect-button.

Determines which items were chosen and calls GUISelectedStorage::deselect for each.

Definition at line 159 of file GUIDialog_GLChosenEditor.cpp.

References GUISelectedStorage::deselect(), GUIGlObject::getGlID(), gSelected, myList, myParent, rebuildList(), and GUIMainWindow::updateChildren().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdLoad()

long GUIDialog_GLChosenEditor::onCmdLoad ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Load-button.

Opens a file dialog and forces the parent to load the list of selected objects when a file was chosen. Rebuilds the list, then, and redraws itself.

Todo:
Recheck loading/saving of selections

Definition at line 121 of file GUIDialog_GLChosenEditor.cpp.

References gCurrentFolder, GUIIconSubSys::getIcon(), gSelected, GUISelectedStorage::load(), OPEN_CONFIG, rebuildList(), and TL.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSave()

long GUIDialog_GLChosenEditor::onCmdSave ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Save-button.

Opens a file dialog and forces the selection container to save the list of selected objects when a file was chosen.

If the saving failed, a message window is shown.

Todo:
Recheck loading/saving of selections

Definition at line 144 of file GUIDialog_GLChosenEditor.cpp.

References gCurrentFolder, MFXUtils::getFilename2Write(), GUIIconSubSys::getIcon(), gSelected, GUISelectedStorage::save(), SAVE, and TL.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ rebuildList()

void GUIDialog_GLChosenEditor::rebuildList ( )

Rebuilds the entire list.

Definition at line 98 of file GUIDialog_GLChosenEditor.cpp.

References GUIGlObject::getFullName(), GUIGlObjectStorage::getObjectBlocking(), GUISelectedStorage::getSelected(), GUIGlObjectStorage::gIDStorage, gSelected, myList, and GUIGlObjectStorage::unblockObject().

Referenced by onCmdDeselect(), onCmdLoad(), and selectionUpdated().

Here is the caller graph for this function:

◆ selectionUpdated()

void GUIDialog_GLChosenEditor::selectionUpdated ( )
virtual

called when selection is updated

Implements GUISelectedStorage::UpdateTarget.

Definition at line 114 of file GUIDialog_GLChosenEditor.cpp.

References rebuildList().

Field Documentation

◆ myList

FXList* GUIDialog_GLChosenEditor::myList = nullptr
private

The list that holds the ids.

Definition at line 118 of file GUIDialog_GLChosenEditor.h.

Referenced by onCmdClear(), onCmdDeselect(), and rebuildList().

◆ myParent

GUIMainWindow* GUIDialog_GLChosenEditor::myParent = nullptr
private

The parent window.

Definition at line 121 of file GUIDialog_GLChosenEditor.h.

Referenced by onCmdClear(), onCmdDeselect(), and ~GUIDialog_GLChosenEditor().

◆ myStorage

GUISelectedStorage* GUIDialog_GLChosenEditor::myStorage = nullptr
private

The storage.

Definition at line 124 of file GUIDialog_GLChosenEditor.h.

Referenced by ~GUIDialog_GLChosenEditor().


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