GFileSelect Class Reference

File selector dialog. More...

#include <GFileSelect.h>

Inherits GBase.

List of all members.

Public Member Functions

char * Name ()
 Returns the first file name selected.
bool Name (char *n)
 Sets the file name.
char * operator[] (int i)
 Returns the n'th file name selected.
int Length ()
 Returns the number of file names selected.
GViewI * Parent ()
 Returns the parent window.
void Parent (GViewI *Window)
 Sets the parent window.
bool MultiSelect ()
 Returns whether the use can select multiple files.
void MultiSelect (bool Multi)
 Sets whether the use can select multiple files.
bool ReadOnly ()
 Returns whether read only was selected.
void ShowReadOnly (bool ro)
 Sets whether the user sees a read only option.
char * InitialDir ()
 Gets the initial directory to open in.
void InitialDir (char *InitDir)
 Sets the initial directory to open in.
char * Title ()
 Gets the title of the dialog box.
void Title (char *Title)
 Sets the title of the dialog box.
char * DefaultExtension ()
 Gets the default extension to append to files selected without an extension.
void DefaultExtension (char *DefExt)
 Sets the default extension to append to files selected without an extension.
int Types ()
 Returns the number of types in the type list.
int SelectedType ()
 Returns the 0 based index of the type selected in the type list.
GFileType * TypeAt (int n)
 Returns the type into at a given index.
bool Type (char *Description, char *Extension, int Data=0)
 Adds a file type to the type filters list.
void ClearTypes ()
 Empties the type list.
bool Open ()
bool Save ()
bool OpenFolder ()


Detailed Description

File selector dialog.

Handles the UI for selecting files for opening and saving and selecting directories. Uses the Win32 system dialogs on Windows and has it's own native window on Linux.

A simple example of this class in action:

 GFileSelect s;
 s.Parent(MyWindow);
 s.Type("PNG Files", "*.png");
 if (s.Open())
 {
    LgiMsg(MyWindow, "The file selected is '%s'", "Example", MB_OK, s.Name());
 }

Member Function Documentation

bool GFileSelect::Open (  ) 

Shows the open file dialog

Returns:
true if the user selected a file, otherwise false

References IDOK.

Referenced by SystemFunctions::SelectFiles().

bool GFileSelect::OpenFolder (  ) 

Shows the open folder dialog

Returns:
true if the user selected a folder, otherwise false

References IDOK.

bool GFileSelect::Save (  ) 

Shows the save file dialog

Returns:
true if the user selected a file, otherwise false

References IDOK.

bool GFileSelect::Type ( char *  Description,
char *  Extension,
int  Data = 0 
)

Adds a file type to the type filters list.

Parameters:
Description  This full description of the file type
Extension  The extension(s) of the file type: e.g: '*.png;*.gif;*.jpg'
Data  Application defined 32-bit value.

Referenced by SystemFunctions::SelectFiles().


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

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen 1.5.7.1