FileOpen Class Reference

Displays a "file open dialog" (sorta). More...

#include <fileopen.h>

Inheritance diagram for FileOpen:

YAPETUI::BaseWindow

List of all members.

Public Member Functions

 FileOpen (std::string t) throw (YAPETUI::UIException)
std::string getFilepath ()
bool isCanceled () const
void refresh () throw (YAPETUI::UIException)
void resize () throw (YAPETUI::UIException)
void run () throw (YAPETUI::UIException)
virtual ~FileOpen ()

Protected Member Functions

void cd (const YAPETUI::secstring d) throw (YAPETUI::UIException)
void getcwd () throw (YAPETUI::UIException)
void getEntries (std::list< YAPETUI::secstring > &d, std::list< YAPETUI::secstring > &f) throw (YAPETUI::UIException)

Private Types

enum  { FALLBACK_PATH_MAX = 255 }

Private Member Functions

void createWindows () throw (YAPETUI::UIException)
 FileOpen (const FileOpen &)
const FileOpenoperator= (const FileOpen &)
void printCWD () throw (YAPETUI::UIException)
void printTitle () throw (YAPETUI::UIException)
int startX ()
int startY ()
int windowHeight ()
int windowWidth ()

Private Attributes

YAPETUI::Buttoncancelbutton
bool canceled
YAPETUI::ListWidget
< YAPETUI::secstring > * 
dir
YAPETUI::secstring directory
YAPETUI::secstring filename
YAPETUI::ListWidget
< YAPETUI::secstring > * 
files
YAPETUI::InputWidgetinput
YAPETUI::Buttonokbutton
std::string title
WINDOW * window


Detailed Description

Displays a window where the user can navigate the directory hierarchy and select a file whose ending is .pet.

Note:
The filename returned by getFilepath() always ends with .pet.

Definition at line 54 of file fileopen.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
FALLBACK_PATH_MAX  The max filename length.

This is only used if we are unable to determine the max length of the filename by other means.

Definition at line 56 of file fileopen.h.


Constructor & Destructor Documentation

FileOpen::FileOpen ( const FileOpen  )  [inline, private]

Definition at line 77 of file fileopen.h.

FileOpen::FileOpen ( std::string  t  )  throw (YAPETUI::UIException)

Definition at line 181 of file fileopen.cc.

FileOpen::~FileOpen (  )  [virtual]

Definition at line 195 of file fileopen.cc.

References cancelbutton, dir, files, input, okbutton, and window.


Member Function Documentation

void FileOpen::cd ( const YAPETUI::secstring  d  )  throw (YAPETUI::UIException) [protected]

Definition at line 173 of file fileopen.cc.

Referenced by run().

void FileOpen::createWindows (  )  throw (YAPETUI::UIException) [private]

Definition at line 56 of file fileopen.cc.

References cancelbutton, dir, files, getEntries(), input, okbutton, startX(), startY(), window, windowHeight(), and windowWidth().

Referenced by resize().

void FileOpen::getcwd (  )  throw (YAPETUI::UIException) [protected]

Definition at line 150 of file fileopen.cc.

References directory, and FALLBACK_PATH_MAX.

void FileOpen::getEntries ( std::list< YAPETUI::secstring > &  d,
std::list< YAPETUI::secstring > &  f 
) throw (YAPETUI::UIException) [protected]

Definition at line 93 of file fileopen.cc.

References endswith().

Referenced by createWindows(), and run().

std::string FileOpen::getFilepath (  ) 

Definition at line 344 of file fileopen.cc.

References directory, endswith(), and filename.

Referenced by MainWindow::run().

bool FileOpen::isCanceled (  )  const [inline]

Definition at line 124 of file fileopen.h.

References canceled.

Referenced by MainWindow::run().

const FileOpen& FileOpen::operator= ( const FileOpen  )  [inline, private]

Definition at line 78 of file fileopen.h.

void FileOpen::printCWD (  )  throw (YAPETUI::UIException) [private]

Definition at line 132 of file fileopen.cc.

References directory, window, and windowWidth().

Referenced by refresh(), and run().

void FileOpen::printTitle (  )  throw (YAPETUI::UIException) [private]

Definition at line 125 of file fileopen.cc.

References title, and window.

Referenced by refresh().

void FileOpen::refresh (  )  throw (YAPETUI::UIException) [virtual]

void FileOpen::resize (  )  throw (YAPETUI::UIException) [virtual]

Implements YAPETUI::BaseWindow.

Definition at line 322 of file fileopen.cc.

References cancelbutton, createWindows(), dir, files, input, okbutton, and window.

void FileOpen::run (  )  throw (YAPETUI::UIException)

int FileOpen::startX (  )  [inline, private]

Definition at line 91 of file fileopen.h.

References YAPETUI::BaseWindow::minX().

Referenced by createWindows().

int FileOpen::startY (  )  [inline, private]

Definition at line 95 of file fileopen.h.

References YAPETUI::BaseWindow::minY().

Referenced by createWindows().

int FileOpen::windowHeight (  )  [inline, private]

Definition at line 87 of file fileopen.h.

References YAPETUI::BaseWindow::maxY().

Referenced by createWindows().

int FileOpen::windowWidth (  )  [inline, private]

Definition at line 83 of file fileopen.h.

References YAPETUI::BaseWindow::maxX().

Referenced by createWindows(), and printCWD().


Member Data Documentation

Definition at line 72 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

bool FileOpen::canceled [private]

Definition at line 74 of file fileopen.h.

Referenced by isCanceled(), and run().

Definition at line 68 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

Definition at line 80 of file fileopen.h.

Referenced by getcwd(), getFilepath(), and printCWD().

Definition at line 81 of file fileopen.h.

Referenced by getFilepath(), and run().

Definition at line 69 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

Definition at line 70 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

Definition at line 71 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

std::string FileOpen::title [private]

Definition at line 66 of file fileopen.h.

Referenced by printTitle().

WINDOW* FileOpen::window [private]

Definition at line 67 of file fileopen.h.

Referenced by createWindows(), printCWD(), printTitle(), refresh(), resize(), and ~FileOpen().


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

Generated on Mon Apr 13 17:29:47 2009 for YAPET by  doxygen 1.5.8