54FXIMPLEMENT(
GUIDialog_GLChosenEditor, FXMainWindow, GUIDialog_GLChosenEditorMap, ARRAYNUMBER(GUIDialog_GLChosenEditorMap))
62#pragma warning(disable: 4355)
110 const auto& chosen =
gSelected.getSelected();
111 for (
auto i : chosen) {
113 if (
object !=
nullptr) {
114 std::string name =
object->getFullName();
115 FXListItem* item =
myList->getItem(
myList->appendItem(name.c_str()));
116 item->setData(
object);
126 FXMainWindow::update();
133 FXFileDialog opendialog(
this,
TL(
"Open List of Selected Items"));
135 opendialog.setSelectMode(SELECTFILE_EXISTING);
140 if (opendialog.execute()) {
142 std::string file = opendialog.getFilename().text();
145 FXMessageBox::error(
this, MBOX_OK,
TL(
"Errors while loading Selection"),
"%s", msg.c_str());
165 FXMessageBox::error(
this, MBOX_OK,
TL(
"Storing failed!"),
"%s", e.what());
173 FXint no =
myList->getNumItems();
175 std::vector<GUIGlID> selected;
176 for (i = 0; i < no; ++i) {
177 if (
myList->getItem(i)->isSelected()) {
182 for (i = 0; i < (FXint) selected.size(); ++i) {
194 const FXEvent* e = (FXEvent*) ptr;
195 if(e->code==KEY_Escape){
199 return FXMainWindow::onKeyPress(o, sel, ptr);
@ MID_CANCEL
Cancel-button pressed.
@ MID_CHOOSEN_SAVE
Save set.
@ MID_CHOOSEN_DESELECT
Deselect selected items.
@ MID_CHOOSER_LIST
Object list.
@ MID_CHOOSEN_LOAD
Load set.
@ MID_CHOOSEN_CLEAR
Clear set.
#define GUIDesignChooserButtons
design for Chooser buttons
#define GUIDesignChooserLayoutLeft
design for Chooser Layout left
#define GUIDesignChooserLayoutRight
design for Chooser Layout right
#define GUIDesignHorizontalSeparator
#define GUIDesignChooserLayoutList
design for Chooser Layout list
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignChooserDialog
#define GUIDesignChooserListMultiple
design for Chooser List
FXDEFMAP(GUIDialog_GLChosenEditor) GUIDialog_GLChosenEditorMap[]
GUISelectedStorage gSelected
A global holder of selected objects.
FXString gCurrentFolder
The folder used as last.
GUIIcon
An enumeration of icons used by the gui applications.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
Editor for the list of chosen objects.
FXList * myList
The list that holds the ids.
GUISelectedStorage * myStorage
The storage.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
long onCmdDeselect(FXObject *, FXSelector, void *)
Called when the user presses the Deselect-button.
GUIMainWindow * myParent
The parent window.
~GUIDialog_GLChosenEditor()
Destructor (Notifies both the parent and the storage about being destroyed).
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
void selectionUpdated()
called when selection is updated
GUIDialog_GLChosenEditor()
FOX needs this.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
void rebuildList()
Rebuilds the entire list.
GUIGlID getGlID() const
Returns the numerical id of the object.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GUIPersistentWindowPos(FXWindow *parent, const std::string &name, bool storeSize, int x=150, int y=150, int width=700, int height=500, int minSize=400, int minTitlebarHeight=20)
Constructor (Notifies both the parent and the storage about being initialised).
Storage for "selected" objects.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extensions, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
static StringBijection< TXTFileExtension > TXTFileExtensions
TXT file Extensions.