#include <filechooser.h>
Data Structures | |
class | Preview |
Public Member Functions | |
FileChooser (GtkWidget *parent, const std::string &title, bool open, bool browseFolders, const std::string &pattern="", const std::string &defaultExt="") | |
virtual | ~FileChooser () |
void | setCurrentPath (const std::string &path) |
void | setCurrentFile (const std::string &file) |
void | attachPreview (Preview *preview) |
virtual std::string | getSelectedFileName () |
virtual std::string | display () |
void | setPreviewActive (bool active) |
Static Private Member Functions | |
static void | onUpdatePreview (GtkFileChooser *chooser, FileChooser *self) |
Private Attributes | |
GtkWidget * | _parent |
GtkWidget * | _dialog |
std::string | _title |
std::string | _path |
std::string | _file |
std::string | _pattern |
std::string | _defaultExt |
bool | _open |
Preview * | _preview |
Definition at line 38 of file filechooser.h.
gtkutil::FileChooser::FileChooser | ( | GtkWidget * | parent, | |
const std::string & | title, | |||
bool | open, | |||
bool | browseFolders, | |||
const std::string & | pattern = "" , |
|||
const std::string & | defaultExt = "" | |||
) |
Construct a new filechooser with the given parameters.
parent | The parent GtkWidget | |
title | The dialog title. | |
open | if TRUE this is asking for "Open" files, FALSE generates a "Save" dialog. | |
browseFolders | if TRUE the dialog is asking the user for directories only. | |
pattern | the type "map", "prefab", this determines the file extensions. | |
defaultExt | The default extension appended when the user enters filenames without extension. (Including the dot as seperator character.) |
virtual gtkutil::FileChooser::~FileChooser | ( | ) | [virtual] |
void gtkutil::FileChooser::attachPreview | ( | Preview * | preview | ) |
FileChooser in "open" mode (see constructor) can have one single preview attached to it. The Preview object will get notified on selection changes to update the widget it provides.
virtual std::string gtkutil::FileChooser::display | ( | ) | [virtual] |
greebo: Displays the dialog and enters the GTK main loop. Returns the filename or "" if the user hit cancel.
The returned file name is normalised using the os::standardPath() method.
virtual std::string gtkutil::FileChooser::getSelectedFileName | ( | ) | [virtual] |
Returns the selected filename (default extension will be added if appropriate).
static void gtkutil::FileChooser::onUpdatePreview | ( | GtkFileChooser * | chooser, | |
FileChooser * | self | |||
) | [static, private] |
void gtkutil::FileChooser::setCurrentFile | ( | const std::string & | file | ) |
void gtkutil::FileChooser::setCurrentPath | ( | const std::string & | path | ) |
void gtkutil::FileChooser::setPreviewActive | ( | bool | active | ) |
std::string gtkutil::FileChooser::_defaultExt [private] |
Definition at line 77 of file filechooser.h.
GtkWidget* gtkutil::FileChooser::_dialog [private] |
Definition at line 67 of file filechooser.h.
std::string gtkutil::FileChooser::_file [private] |
Definition at line 73 of file filechooser.h.
bool gtkutil::FileChooser::_open [private] |
Definition at line 80 of file filechooser.h.
GtkWidget* gtkutil::FileChooser::_parent [private] |
Definition at line 65 of file filechooser.h.
std::string gtkutil::FileChooser::_path [private] |
Definition at line 72 of file filechooser.h.
std::string gtkutil::FileChooser::_pattern [private] |
Definition at line 75 of file filechooser.h.
Preview* gtkutil::FileChooser::_preview [private] |
Definition at line 83 of file filechooser.h.
std::string gtkutil::FileChooser::_title [private] |
Definition at line 70 of file filechooser.h.