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 55 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 57 of file fileopen.h.


Constructor & Destructor Documentation

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

Definition at line 78 of file fileopen.h.

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

Definition at line 182 of file fileopen.cc.

FileOpen::~FileOpen (  )  [virtual]

Definition at line 196 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 174 of file fileopen.cc.

Referenced by run().

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

Definition at line 57 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 151 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 94 of file fileopen.cc.

References endswith().

Referenced by createWindows(), and run().

std::string FileOpen::getFilepath (  ) 

Definition at line 345 of file fileopen.cc.

References directory, endswith(), and filename.

Referenced by MainWindow::run().

bool FileOpen::isCanceled (  )  const [inline]

Definition at line 125 of file fileopen.h.

References canceled.

Referenced by MainWindow::run().

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

Definition at line 79 of file fileopen.h.

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

Definition at line 133 of file fileopen.cc.

References directory, window, and windowWidth().

Referenced by refresh(), and run().

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

Definition at line 126 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 323 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 92 of file fileopen.h.

References YAPETUI::BaseWindow::minX().

Referenced by createWindows().

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

Definition at line 96 of file fileopen.h.

References YAPETUI::BaseWindow::minY().

Referenced by createWindows().

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

Definition at line 88 of file fileopen.h.

References YAPETUI::BaseWindow::maxY().

Referenced by createWindows().

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

Definition at line 84 of file fileopen.h.

References YAPETUI::BaseWindow::maxX().

Referenced by createWindows(), and printCWD().


Member Data Documentation

Definition at line 73 of file fileopen.h.

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

bool FileOpen::canceled [private]

Definition at line 75 of file fileopen.h.

Referenced by isCanceled(), and run().

Definition at line 69 of file fileopen.h.

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

Definition at line 81 of file fileopen.h.

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

Definition at line 82 of file fileopen.h.

Referenced by getFilepath(), and run().

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().

Definition at line 72 of file fileopen.h.

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

std::string FileOpen::title [private]

Definition at line 67 of file fileopen.h.

Referenced by printTitle().

WINDOW* FileOpen::window [private]

Definition at line 68 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 Thu Jun 11 19:13:03 2009 for YAPET by  doxygen 1.5.8