#include <GFileSelect.h>
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. | |
| 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 () |
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()); }
|
|
Shows the open file dialog
|
|
|
Shows the open folder dialog
|
|
|
Shows the save file dialog
|
|
||||||||||||||||
|
Adds a file type to the type filters list.
|
1.4.1