Displays a "file open dialog" (sorta). More...
#include <fileopen.h>


Public Member Functions | |
| FileOpen (std::string t) throw (YAPET::UI::UIException) | |
| std::string | getFilepath () |
| bool | isCanceled () const |
| void | refresh () throw (YAPET::UI::UIException) |
| void | resize () throw (YAPET::UI::UIException) |
| void | run () throw (YAPET::UI::UIException) |
| virtual | ~FileOpen () |
Protected Member Functions | |
| void | cd (const YAPET::UI::secstring d) throw (YAPET::UI::UIException) |
| void | getcwd () throw (YAPET::UI::UIException) |
| void | getEntries (std::list< YAPET::UI::secstring > &d, std::list< YAPET::UI::secstring > &f) throw (YAPET::UI::UIException) |
Private Types | |
| enum | { FALLBACK_PATH_MAX = 255 } |
Private Member Functions | |
| void | createWindows () throw (YAPET::UI::UIException) |
| FileOpen (const FileOpen &) | |
| const FileOpen & | operator= (const FileOpen &) |
| void | printCWD () throw (YAPET::UI::UIException) |
| void | printTitle () throw (YAPET::UI::UIException) |
| int | startX () |
| int | startY () |
| int | windowHeight () |
| int | windowWidth () |
Private Attributes | |
| YAPET::UI::Button * | cancelbutton |
| bool | canceled |
| YAPET::UI::ListWidget < YAPET::UI::secstring > * | dir |
| YAPET::UI::secstring | directory |
| YAPET::UI::secstring | filename |
| YAPET::UI::ListWidget < YAPET::UI::secstring > * | files |
| YAPET::UI::InputWidget * | input |
| YAPET::UI::Button * | okbutton |
| std::string | title |
| WINDOW * | window |
Displays a window where the user can navigate the directory hierarchy and select a file whose ending is .pet.
getFilepath() always ends with .pet. Definition at line 55 of file fileopen.h.
anonymous enum [private] |
| 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.
| FileOpen::FileOpen | ( | const FileOpen & | ) | [inline, private] |
Definition at line 77 of file fileopen.h.
| FileOpen::FileOpen | ( | std::string | t | ) | throw (YAPET::UI::UIException) |
Definition at line 209 of file fileopen.cc.
| FileOpen::~FileOpen | ( | ) | [virtual] |
Definition at line 222 of file fileopen.cc.
References cancelbutton, dir, files, input, okbutton, and window.
| void FileOpen::cd | ( | const YAPET::UI::secstring | d | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 200 of file fileopen.cc.
Referenced by run().

| void FileOpen::createWindows | ( | ) | throw (YAPET::UI::UIException) [private] |
Definition at line 78 of file fileopen.cc.
References cancelbutton, dir, files, getEntries(), input, okbutton, startX(), startY(), window, windowHeight(), and windowWidth().
Referenced by resize().


| void FileOpen::getcwd | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 175 of file fileopen.cc.
References directory, and FALLBACK_PATH_MAX.
| void FileOpen::getEntries | ( | std::list< YAPET::UI::secstring > & | d, | |
| std::list< YAPET::UI::secstring > & | f | |||
| ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 113 of file fileopen.cc.
References endswith(), and YAPET::CONSTS::Consts::getDefaultSuffix().
Referenced by createWindows(), and run().


| std::string FileOpen::getFilepath | ( | ) |
Definition at line 389 of file fileopen.cc.
References directory, endswith(), filename, and YAPET::CONSTS::Consts::getDefaultSuffix().
Referenced by MainWindow::run().


| bool FileOpen::isCanceled | ( | ) | const [inline] |
Definition at line 126 of file fileopen.h.
References canceled, and filename.
Referenced by MainWindow::run().

Definition at line 78 of file fileopen.h.
| void FileOpen::printCWD | ( | ) | throw (YAPET::UI::UIException) [private] |
Definition at line 155 of file fileopen.cc.
References directory, window, and windowWidth().
Referenced by refresh(), and run().


| void FileOpen::printTitle | ( | ) | throw (YAPET::UI::UIException) [private] |
Definition at line 147 of file fileopen.cc.
Referenced by refresh().

| void FileOpen::refresh | ( | ) | throw (YAPET::UI::UIException) [virtual] |
Implements YAPET::UI::BaseWindow.
Definition at line 346 of file fileopen.cc.
References box(), cancelbutton, dir, files, input, YAPET::UI::MESSAGEBOX, okbutton, printCWD(), printTitle(), YAPET::UI::Button::refresh(), YAPET::UI::InputWidget::refresh(), YAPET::UI::ListWidget< T >::refresh(), YAPET::UI::Colors::setcolor(), and window.
Referenced by run().


| void FileOpen::resize | ( | ) | throw (YAPET::UI::UIException) [virtual] |
Implements YAPET::UI::BaseWindow.
Definition at line 368 of file fileopen.cc.
References cancelbutton, createWindows(), dir, files, input, okbutton, and window.

| void FileOpen::run | ( | ) | throw (YAPET::UI::UIException) |
Definition at line 233 of file fileopen.cc.
References cancelbutton, canceled, cd(), dir, filename, files, YAPET::UI::Button::focus(), YAPET::UI::InputWidget::focus(), YAPET::UI::ListWidget< T >::focus(), getEntries(), YAPET::UI::ListWidget< T >::getSelectedItem(), YAPET::UI::InputWidget::getText(), input, KEY_ESC, okbutton, printCWD(), refresh(), YAPET::UI::BaseWindow::resizeAll(), YAPET::UI::MessageBox::run(), YAPET::UI::ListWidget< T >::setList(), YAPET::UI::InputWidget::setText(), and YAPET::UI::UIException::what().
Referenced by MainWindow::run().


| int FileOpen::startX | ( | ) | [inline, private] |
Definition at line 93 of file fileopen.h.
References YAPET::UI::BaseWindow::minX().
Referenced by createWindows().


| int FileOpen::startY | ( | ) | [inline, private] |
Definition at line 97 of file fileopen.h.
References YAPET::UI::BaseWindow::minY().
Referenced by createWindows().


| int FileOpen::windowHeight | ( | ) | [inline, private] |
Definition at line 89 of file fileopen.h.
References YAPET::UI::BaseWindow::maxY().
Referenced by createWindows().


| int FileOpen::windowWidth | ( | ) | [inline, private] |
Definition at line 85 of file fileopen.h.
References YAPET::UI::BaseWindow::maxX().
Referenced by createWindows(), and printCWD().


YAPET::UI::Button* FileOpen::cancelbutton [private] |
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().
YAPET::UI::ListWidget<YAPET::UI::secstring>* FileOpen::dir [private] |
Definition at line 69 of file fileopen.h.
Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().
YAPET::UI::secstring FileOpen::directory [private] |
Definition at line 82 of file fileopen.h.
Referenced by getcwd(), getFilepath(), and printCWD().
YAPET::UI::secstring FileOpen::filename [private] |
Definition at line 83 of file fileopen.h.
Referenced by getFilepath(), isCanceled(), and run().
YAPET::UI::ListWidget<YAPET::UI::secstring>* FileOpen::files [private] |
Definition at line 70 of file fileopen.h.
Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().
YAPET::UI::InputWidget* FileOpen::input [private] |
Definition at line 71 of file fileopen.h.
Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().
YAPET::UI::Button* FileOpen::okbutton [private] |
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().
1.7.1