Public Types | |
enum | { NONE = 0, ASK_OVERWRITE = 1, MUST_EXIST = 2, MULTIPLE = 0x80000000 } |
Public Member Functions | |
~FileDialog () | |
std::string | execModal () |
void | on_response (int cmd) |
Static Public Member Functions | |
static FileDialog * | create (const Glib::ustring &title, Gtk::FileChooserAction action=Gtk::FILE_CHOOSER_ACTION_OPEN, unsigned int dlgOption=NONE) |
Public Attributes | |
sigc::signal< void, const std::string & > | sigSelected |
Protected Types | |
enum | commandID { OK = 1, CANCEL } |
Protected Member Functions | |
virtual void | fileSelected (std::string &) |
void | free (int) |
FileDialog (const Glib::ustring &title, Gtk::FileChooserAction action=Gtk::FILE_CHOOSER_ACTION_OPEN, unsigned int dlgOption=NONE) |
It will create a new dialog window containing a directory list, and a file list corresponding to the current working directory. The filesystem can be navigated using the directory list or the drop-down history menu. Alternatively, the TAB key can be used to navigate using filename completion - common in text based editors such as emacs and jed.
The caller is informed via the passed callback about the selection.
There are some flags to perform some checks if the OK
button is selected:
See also the description of the parent for further options!
anonymous enum |
enum XGP::FileDialog::commandID [protected] |
IDs for the possible commands (OK, CANCEL).
XGP::FileDialog::~FileDialog | ( | ) |
Destructor.
XGP::FileDialog::FileDialog | ( | const Glib::ustring & | title, | |
Gtk::FileChooserAction | action = Gtk::FILE_CHOOSER_ACTION_OPEN , |
|||
unsigned int | dlgOption = NONE | |||
) | [protected] |
Constructor; Creates a (modeless) dialog to select a file.
title | Text to display in the title of the dialog | |
action | Action which is caused by clicking a file | |
dlgOption | Checks to perform after selecting OK |
FileDialog * XGP::FileDialog::create | ( | const Glib::ustring & | title, | |
Gtk::FileChooserAction | action = Gtk::FILE_CHOOSER_ACTION_OPEN , |
|||
unsigned int | dlgOption = NONE | |||
) | [static] |
Creates the dialog.
Creates a (modeless) dialog and registers a handler to free it after deleting.
title | Title of the dialog | |
action | Action which is caused by clicking a file | |
dlgOption | Options for the dialog |
std::string XGP::FileDialog::execModal | ( | ) |
Performs the dialog modaly.
virtual void XGP::FileDialog::fileSelected | ( | std::string & | ) | [inline, protected, virtual] |
Callback after selecting a file.
Name of selected file |
void XGP::FileDialog::free | ( | int | ) | [protected] |
Frees the dialog.
void XGP::FileDialog::on_response | ( | int | cmd | ) |
Callback on user-action (file selected or dialog closed).
cmd | ID of selected action |
sigc::signal<void, const std::string&> XGP::FileDialog::sigSelected |
Signal emitted, when OK is selected.