Planeshift
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

pawsFileNavigation Class Reference

#include <pawsfilenavigation.h>

List of all members.

Public Member Functions

virtual bool FillFileList ()
 Refreshes the current listing of files based on the current directory.
virtual const char * GetCurrentPath ()
 Called to retrieve just the full path of current browsing.
virtual const char * GetFullPathFilename ()
 Called to retrieve the full path of the current browsing concatenated with the text in the.
virtual int GetSelectionState ()
 Called to retrieve the current selection state of the file navigation box.
void Initialize (const csString &filename, const csString &filter, iOnFileSelectedAction *action)
virtual bool OnButtonPressed (int mouseButton, int keyModifier, pawsWidget *widget)
 Called whenever a button is pressed.
virtual bool OnChange (pawsWidget *widget)
 Called whenever a widget is selected.
virtual bool OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers)
 Process keydown messages.
virtual void OnListAction (pawsListBox *selected, int status)
 Called whenever an item in a child list box is selected.
 pawsFileNavigation ()
 pawsFileNavigation (const pawsFileNavigation &origin)
virtual bool PostSetup ()
 This is called after the widget and all of it's children have been created.
virtual void SetActionButtonText (const char *actiontext)
 Called to set the text of the action/perorm button.
virtual bool SetFileFilters (const char *filename)
virtual bool SetSelectedFilename (const char *filename)
 Called to set the selected filename field.
virtual void Show ()
 Overridden to reset the selection state on Show()
virtual ~pawsFileNavigation ()

Static Public Member Functions

static pawsFileNavigationCreate (const csString &label, const csString &filter, iOnFileSelectedAction *action, const char *xmlWidget="filenavigation.xml")

Protected Member Functions

virtual bool DownOnePath (const char *pathstring, int pathlen)
virtual const char * GetFilterForSelection ()
virtual bool RelativeIsFile (const char *filename)
virtual bool SetFilterForSelection (const char *filename)
 Called to set the filterfunction.
virtual bool SmartAppendPath (const char *append)
 Appends a section of a path to the current path. Interprets . and .. appropriately.
virtual bool SmartSetPath (const char *path)
 Similar to SmartAppendPath, but a leading / or \ is interpretted from the root.
virtual bool UpOnePath ()

Protected Attributes

iOnFileSelectedActionaction
csString current_path
 The current virtual path.
pawsListBoxdirlistbox
 The directory display listbox child of this widget.
pawsListBoxfilelistbox
 The file display listbox child of this widget.
char * fullpathandfilename
 A buffer used to construct the full path and file of a selected file. Not always valid.
int selection_state
 Stores the current selection state (none selected, canceled, or perform)
csRef< iVFS > vfs
 A reference to the iVFS for the file system, used for navigation.
csArray< csString > zip_mounts

Detailed Description

Definition at line 43 of file pawsfilenavigation.h.


Constructor & Destructor Documentation

pawsFileNavigation::pawsFileNavigation ( )
virtual pawsFileNavigation::~pawsFileNavigation ( ) [virtual]
pawsFileNavigation::pawsFileNavigation ( const pawsFileNavigation origin)

Member Function Documentation

static pawsFileNavigation* pawsFileNavigation::Create ( const csString &  label,
const csString &  filter,
iOnFileSelectedAction action,
const char *  xmlWidget = "filenavigation.xml" 
) [static]
virtual bool pawsFileNavigation::DownOnePath ( const char *  pathstring,
int  pathlen 
) [protected, virtual]
virtual bool pawsFileNavigation::FillFileList ( ) [virtual]

Refreshes the current listing of files based on the current directory.

virtual const char* pawsFileNavigation::GetCurrentPath ( ) [virtual]

Called to retrieve just the full path of current browsing.

virtual const char* pawsFileNavigation::GetFilterForSelection ( ) [protected, virtual]
virtual const char* pawsFileNavigation::GetFullPathFilename ( ) [virtual]

Called to retrieve the full path of the current browsing concatenated with the text in the.

virtual int pawsFileNavigation::GetSelectionState ( ) [virtual]

Called to retrieve the current selection state of the file navigation box.

States can be: PAWSFILENAV_SELECTION_UNDETERMINED - The window is still open and neither the perform button nor the cancel button has been pressed. PAWSFILENAV_SELECTION_CANCEL - The cancel button was pressed, or the window was closed. PAWSFILENAV_SELECTION_PERFORM - The perform button was pressed. The cancel button specifically overrides the perform button. The perform button does not override the cancel button.

void pawsFileNavigation::Initialize ( const csString &  filename,
const csString &  filter,
iOnFileSelectedAction action 
)
virtual bool pawsFileNavigation::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
) [virtual]

Called whenever a button is pressed.

Parameters:
buttonThe button pressed.
keyModifierModifier key in effect.
widgetThe widget the button belongs to.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

virtual bool pawsFileNavigation::OnChange ( pawsWidget widget) [virtual]

Called whenever a widget is selected.

Parameters:
widgetThe widget acted upon.
Returns:
Notify parent and return result FALSE if no parent.

Reimplemented from pawsWidget.

virtual bool pawsFileNavigation::OnKeyDown ( utf32_char  keyCode,
utf32_char  keyChar,
int  modifiers 
) [virtual]

Process keydown messages.

Parameters:
keyCodeThe code for the pressed key.
keyCharThe key pressed.
modifiersUsed to modify tab behavior.
Returns:
bool TRUE for success FALSE if no action.
Remarks:
If you override this, be sure to also override GetFocusOverridesControls() as returning true

Reimplemented from pawsWidget.

virtual void pawsFileNavigation::OnListAction ( pawsListBox selected,
int  status 
) [virtual]

Called whenever an item in a child list box is selected.

Parameters:
selectedThe listbox that has the item selected.
statusFrom listbox when a row is selected.

Reimplemented from pawsWidget.

virtual bool pawsFileNavigation::PostSetup ( ) [virtual]

This is called after the widget and all of it's children have been created.

Remarks:
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.

virtual bool pawsFileNavigation::RelativeIsFile ( const char *  filename) [protected, virtual]
virtual void pawsFileNavigation::SetActionButtonText ( const char *  actiontext) [virtual]

Called to set the text of the action/perorm button.

virtual bool pawsFileNavigation::SetFileFilters ( const char *  filename) [virtual]
virtual bool pawsFileNavigation::SetFilterForSelection ( const char *  filename) [protected, virtual]

Called to set the filterfunction.

virtual bool pawsFileNavigation::SetSelectedFilename ( const char *  filename) [virtual]

Called to set the selected filename field.

virtual void pawsFileNavigation::Show ( ) [virtual]

Overridden to reset the selection state on Show()

Reimplemented from pawsWidget.

virtual bool pawsFileNavigation::SmartAppendPath ( const char *  append) [protected, virtual]

Appends a section of a path to the current path. Interprets . and .. appropriately.

virtual bool pawsFileNavigation::SmartSetPath ( const char *  path) [protected, virtual]

Similar to SmartAppendPath, but a leading / or \ is interpretted from the root.

virtual bool pawsFileNavigation::UpOnePath ( ) [protected, virtual]

Member Data Documentation

Definition at line 127 of file pawsfilenavigation.h.

csString pawsFileNavigation::current_path [protected]

The current virtual path.

Definition at line 110 of file pawsfilenavigation.h.

The directory display listbox child of this widget.

Definition at line 115 of file pawsfilenavigation.h.

The file display listbox child of this widget.

Definition at line 118 of file pawsfilenavigation.h.

A buffer used to construct the full path and file of a selected file. Not always valid.

Definition at line 122 of file pawsfilenavigation.h.

Stores the current selection state (none selected, canceled, or perform)

Definition at line 125 of file pawsfilenavigation.h.

csRef<iVFS> pawsFileNavigation::vfs [protected]

A reference to the iVFS for the file system, used for navigation.

Definition at line 107 of file pawsfilenavigation.h.

csArray<csString> pawsFileNavigation::zip_mounts [protected]

Definition at line 112 of file pawsfilenavigation.h.


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