 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
52 FXIMPLEMENT(
GUIDialog_GLChosenEditor, FXMainWindow, GUIDialog_GLChosenEditorMap, ARRAYNUMBER(GUIDialog_GLChosenEditorMap))
61 myParent(parent), myStorage(str) {
62 myStorage->add2Update(
this);
87 myParent->addChild(
this);
101 for (
auto i : chosen) {
103 if (
object !=
nullptr) {
105 FXListItem* item =
myList->getItem(
myList->appendItem(name.c_str()));
106 item->setData(
object);
116 FXMainWindow::update();
123 FXFileDialog opendialog(
this,
"Open List of Selected Items");
125 opendialog.setSelectMode(SELECTFILE_EXISTING);
126 opendialog.setPatternList(
"*.txt\nAll files (*)");
130 if (opendialog.execute()) {
132 std::string file = opendialog.getFilename().text();
135 FXMessageBox::error(
this, MBOX_OK,
"Errors while loading Selection",
"%s", msg.c_str());
152 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
160 FXint no =
myList->getNumItems();
162 std::vector<GUIGlID> selected;
163 for (i = 0; i < no; ++i) {
164 if (
myList->getItem(i)->isSelected()) {
169 for (i = 0; i < (FXint) selected.size(); ++i) {
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
#define GUIDesignChooserLayoutLeft
design for Chooser Layout left
void save(GUIGlObjectType type, const std::string &filename)
Saves a selection list.
~GUIDialog_GLChosenEditor()
Destructor (Notifies both the parent and the storage about being destroyed)
@ MID_CHOOSEN_DESELECT
Deselect selected items.
long onCmdDeselect(FXObject *, FXSelector, void *)
Called when the user presses the Deselect-button.
@ MID_CHOOSEN_CLEAR
Clear set.
GUIMainWindow * myParent
The parent window.
const std::string & getFullName() const
GUISelectedStorage * myStorage
The storage.
void rebuildList()
Rebuilds the entire list.
@ MID_CANCEL
Cancel-button pressed.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
@ MID_CHOOSEN_LOAD
Load set.
std::string load(const std::string &filename, GUIGlObjectType type=GLO_MAX)
Loads a selection list (optionally with restricted type)
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
void selectionUpdated()
called when selection is updated
FXDEFMAP(GUIDialog_GLChosenEditor) GUIDialog_GLChosenEditorMap[]
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
#define GUIDesignHorizontalSeparator
GUIGlID getGlID() const
Returns the numerical id of the object.
void remove2Update()
Removes the dialog to be updated.
void removeChild(FXMainWindow *child)
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
#define GUIDesignChooserButtons
design for Chooser buttons
FXString gCurrentFolder
The folder used as last.
void clear()
Clears the list of selected objects.
@ MID_CHOOSEN_SAVE
Save set.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
Storage for "selected" objects.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUISelectedStorage gSelected
A global holder of selected objects.
#define GUIDesignChooserLayoutList
design for Chooser Layout list
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
#define GUIDesignChooserDialog
@ MID_CHOOSER_LIST
Object list.
#define GUIDesignChooserListMultiple
design for Chooser List
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
#define GUIDesignChooserLayoutRight
design for Chooser Layout right
void deselect(GUIGlID id)
Deselects the object with the given id.
FXList * myList
The list that holds the ids.
Editor for the list of chosen objects.