sptk2 logo
SPTK Home Page

sptk::CFileDialog Class Reference
[GUI Classes]

Base class for CFileOpenDialog and CFileSaveDialog. More...

#include <CFileDialog.h>

Inheritance diagram for sptk::CFileDialog:

sptk::CDialog sptk::CWindow sptk::CLayoutManager sptk::CWindowShape sptk::CLayoutClient sptk::CDirOpenDialog sptk::CFileOpenDialog sptk::CFileSaveDialog

List of all members.

Public Member Functions

std::string directory () const
 Returns the dialog's current directory.
void directory (std::string p)
 Sets the dialog's current directory.
void clearPatterns ()
 Removes all the defined file name paterns.
void setPattern (std::string patternName)
void addPattern (std::string patternName, std::string pattern)
std::string pattern () const
 Returns currently selected pattern.
void refreshDirectory (std::string dirName="")
std::string fileName () const
std::string fullFileName () const
void fileName (std::string fileName)
bool execute ()
 Initializes the dialog and shows it in the modal mode.

Protected Member Functions

void createFolder ()
 Creates a new folder. The folder name is asked interactively.
 CFileDialog (std::string label, bool saveMode)

Static Protected Member Functions

static std::string removeTrailingSlash (std::string dirname)
 Removes a trailing slash in the directory name.
static void new_folder_cb (Fl_Widget *, void *)
 Internal create folder button callback.
static void home_cb (Fl_Widget *, void *)
 Internal home button callback.
static void up_cb (Fl_Widget *, void *)
 Internal go up button callback.
static void dirview_cb (Fl_Widget *w, void *)
 Internal directory double-clicked callback.
static void lookin_cb (Fl_Widget *w, void *)
 Internal look-in combo callback.
static void pattern_cb (Fl_Widget *w, void *)
 Internal pattern combo callback.

Protected Attributes

CDirectoryDS m_directory
 Directory Dataset.
CListViewm_directoryView
 File list in the directory.
CComboBoxm_lookInCombo
 The combo with the list of the lookup directories.
CInputm_fileNameInput
 The file name input box.
CComboBoxm_patternCombo
 The file mask (pattern) selection combo.

Static Protected Attributes

static const char slashChar
 Default slash character, '\' on Windows and '/' on Unux.
static const char slashStr []
 Default slash character string, "\\" on Windows and "/" on Unux.


Detailed Description

Base class for CFileOpenDialog and CFileSaveDialog.

Actually implements most of these classes functionality. Can't be used by itself, only as a base class.


Constructor & Destructor Documentation

sptk::CFileDialog::CFileDialog ( std::string  label,
bool  saveMode 
) [protected]

Constructor

Parameters:
label std::string, window caption
saveMode bool, true for File Save Dialog and false for File Open Dialog.


Member Function Documentation

void sptk::CFileDialog::addPattern ( std::string  patternName,
std::string  pattern 
)

Adds the file name patern to the pattern combo box

Parameters:
patternName std::string, the name of the pattern, like "All files"
pattern std::string, one or more the patterns, separated with semicolon like "*.cpp;*.cxx"

void sptk::CFileDialog::fileName ( std::string  fileName  ) 

Set the currently selected file name in edit entry

Parameters:
fileName std::string, the name of the file.

std::string sptk::CFileDialog::fileName (  )  const [inline]

Returns the list of currently selected files without the full path, as a simicolon-separated string.

Returns:
The list of the selected file names.

References sptk::CInput::data(), and m_fileNameInput.

std::string sptk::CFileDialog::fullFileName (  )  const

Returns the list of currently selected files with the full path, as a simicolon-separated string

Returns:
The list of the selected full file names.

void sptk::CFileDialog::refreshDirectory ( std::string  dirName = ""  ) 

Sets the new directory, if parameter dir is defined, and reloads the file list.

Parameters:
dirName std::string, the name of the directory

static std::string sptk::CFileDialog::removeTrailingSlash ( std::string  dirname  )  [static, protected]

Removes a trailing slash in the directory name.

Parameters:
dirname std::string, a directory name

void sptk::CFileDialog::setPattern ( std::string  patternName  ) 

Sets the file name patern in pattern combo box

Parameters:
patternName std::string, the name of the pattern as defined in call of addPattern()


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

Mon Mar 5 11:56:13 2012: SPTK 3.5.7