gtkutil::FileChooser Class Reference

#include <filechooser.h>

Collaboration diagram for gtkutil::FileChooser:
Collaboration graph
[legend]

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

Detailed Description

Definition at line 38 of file filechooser.h.


Constructor & Destructor Documentation

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.

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]

Member Function Documentation

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  ) 

Field Documentation

Definition at line 77 of file filechooser.h.

Definition at line 67 of file filechooser.h.

Definition at line 73 of file filechooser.h.

Definition at line 80 of file filechooser.h.

Definition at line 65 of file filechooser.h.

Definition at line 72 of file filechooser.h.

Definition at line 75 of file filechooser.h.

Definition at line 83 of file filechooser.h.

Definition at line 70 of file filechooser.h.


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

Generated by  doxygen 1.6.2