Inherits fltk::Browser.
List of all members.
Public Types |
| enum | { FILES,
DIRECTORIES
} |
Public Member Functions |
| void | add (const char *line, FileIcon *icon) |
| const char * | directory () const |
| | FileBrowser (int, int, int, int, const char *=0) |
| int | filetype () const |
| void | filetype (int t) |
| void | filter (const char *pattern) |
| const char * | filter () const |
| float | icon_size () const |
| void | icon_size (float f) |
| void | insert (int n, const char *label, void *data) |
| void | insert (int n, const char *label, FileIcon *icon) |
| int | load (const char *directory, FileSortF *sort=(FileSortF *) fltk::numericsort) |
| bool | show_hidden () const |
| void | show_hidden (bool show) |
| void | textsize (float s) |
| float | textsize () const |
Private Attributes |
| const char * | directory_ |
| int | filetype_ |
| float | icon_size_ |
| const char * | pattern_ |
| bool | show_hidden_ |
Detailed Description
The fltk::FileBrowser widget displays a list of filenames, optionally with file-specific icons.
Member Enumeration Documentation
The types of items this browser can show
- Enumerator:
| FILES |
Show all files
|
| DIRECTORIES |
Show only directories
|
Constructor & Destructor Documentation
| FileBrowser::FileBrowser |
( |
int |
X, |
|
|
int |
Y, |
|
|
int |
W, |
|
|
int |
H, |
|
|
const char * |
l = 0 |
|
) |
| |
Create a FileBrowser widget
- Parameters:
-
| X | Upper left-hand X coordinate |
| Y | Upper right-hand Y coordinate |
| W | Width in pixels |
| H | Height in pixels |
| l | Label text |
Member Function Documentation
| void FileBrowser::add |
( |
const char * |
line, |
|
|
FileIcon * |
icon |
|
) |
| |
Add a line to the filebrowser
- Parameters:
-
| line | Name of the line to add |
| icon | Optional icon to add to this item |
| const char* fltk::FileBrowser::directory |
( |
| ) |
const [inline] |
- Returns:
- The current directory
| int fltk::FileBrowser::filetype |
( |
| ) |
const [inline] |
- Returns:
- The browser's current filetype
| void fltk::FileBrowser::filetype |
( |
int |
t | ) |
[inline] |
Sets the filetype
- Parameters:
-
| void FileBrowser::filter |
( |
const char * |
pattern | ) |
|
Set the filename filter.
- Parameters:
-
| pattern | Pattern to filter with. Eventually should deal with proper regex! |
| const char* fltk::FileBrowser::filter |
( |
| ) |
const [inline] |
- Returns:
- The filter pattern
| void fltk::FileBrowser::icon_size |
( |
float |
f | ) |
[inline] |
Sets the icon size and redraws the browser
- Parameters:
-
| float fltk::FileBrowser::icon_size |
( |
| ) |
const [inline] |
- Returns:
- The icon size as a float
| void FileBrowser::insert |
( |
int |
n, |
|
|
const char * |
label, |
|
|
FileIcon * |
icon |
|
) |
| |
Insert an item into the file browser at the 'n'th position
This shifts everything up to and including this position back and then places the current item in this spot.
- Parameters:
-
| n | The position to insert at. This will append if necessary |
| label | The name of the line to add |
| icon | Optional icon to add to this item |
| void fltk::FileBrowser::insert |
( |
int |
n, |
|
|
const char * |
label, |
|
|
void * |
data |
|
) |
| [inline] |
Inserts a line at the 'n'th position with Callback data set. This will not attempt to split the label at '/' characters
- Parameters:
-
| n | The position to insert at. This will append if necessary |
| label | The label of the widget |
| data | The callback data of the widget |
Reimplemented from fltk::Menu.
| int FileBrowser::load |
( |
const char * |
directory, |
|
|
FileSortF * |
sort = (FileSortF*) fltk::numericsort |
|
) |
| |
Load a directory into the browser.
- Parameters:
-
| directory | Directory to load |
| sort | Sorting function to use |
- Returns:
- Number of files loaded
| bool fltk::FileBrowser::show_hidden |
( |
| ) |
const [inline] |
- Returns:
- Whether or not we're currently showing hidden files
| void fltk::FileBrowser::show_hidden |
( |
bool |
show | ) |
[inline] |
Set this flag if you want to see the hidden files in the browser
- Parameters:
-
| show | A flag to determine whether or not to show hidden files |
| void fltk::FileBrowser::textsize |
( |
float |
s | ) |
[inline] |
Sets the current Browser's textsize and scales the icon size accordingly
- Parameters:
-
Reimplemented from fltk::Widget.
| float fltk::FileBrowser::textsize |
( |
| ) |
const [inline] |
- Returns:
- the current Browser's textsize
Reimplemented from fltk::Widget.
Member Data Documentation
The FileBrowser's icon sizes
The filename glob pattern
- Todo:
- regex!
Used to determine whether to show hidden files or not
The documentation for this class was generated from the following files:
- fltk/FileBrowser.h
- src/FileBrowser.cxx