Fl_File_Browser Class Reference

The Fl_File_Browser widget displays a list of filenames, optionally with file-specific icons. More...

#include <Fl_File_Browser.H>

Inheritance diagram for Fl_File_Browser:
Fl_Browser Fl_Browser_ Fl_Group Fl_Widget

List of all members.

Public Types

enum  { FILES, DIRECTORIES }

Public Member Functions

void filetype (int t)
 Sets or gets the file browser type, FILES or DIRECTORIES.
int filetype () const
 Sets or gets the file browser type, FILES or DIRECTORIES.
const char * filter () const
 Sets or gets the filename filter.
void filter (const char *pattern)
 Sets or gets the filename filter.
 Fl_File_Browser (int, int, int, int, const char *=0)
 The constructor creates the Fl_File_Browser widget at the specified position and size.
void iconsize (uchar s)
 Sets or gets the size of the icons.
uchar iconsize () const
 Sets or gets the size of the icons.
int load (const char *directory, Fl_File_Sort_F *sort=fl_numericsort)
 Loads the specified directory into the browser.
void textsize (Fl_Fontsize s)
 Sets the default text size (in pixels) for the lines in the browser to newSize.
Fl_Fontsize textsize () const
 Gets the default text size (in pixels) for the lines in the browser.

Detailed Description

The Fl_File_Browser widget displays a list of filenames, optionally with file-specific icons.


Constructor & Destructor Documentation

Fl_File_Browser::Fl_File_Browser ( int  X,
int  Y,
int  W,
int  H,
const char *  l = 0 
)

The constructor creates the Fl_File_Browser widget at the specified position and size.

The destructor destroys the widget and frees all memory that has been allocated.


Member Function Documentation

void Fl_File_Browser::filetype ( int  t  )  [inline]

Sets or gets the file browser type, FILES or DIRECTORIES.

When set to FILES, both files and directories are shown. Otherwise only directories are shown.

int Fl_File_Browser::filetype (  )  const [inline]

Sets or gets the file browser type, FILES or DIRECTORIES.

When set to FILES, both files and directories are shown. Otherwise only directories are shown.

const char* Fl_File_Browser::filter (  )  const [inline]

Sets or gets the filename filter.

The pattern matching uses the fl_filename_match() function in FLTK.

void Fl_File_Browser::filter ( const char *  pattern  ) 

Sets or gets the filename filter.

The pattern matching uses the fl_filename_match() function in FLTK.

void Fl_File_Browser::iconsize ( uchar  s  )  [inline]

Sets or gets the size of the icons.

The default size is 20 pixels.

uchar Fl_File_Browser::iconsize (  )  const [inline]

Sets or gets the size of the icons.

The default size is 20 pixels.

int Fl_File_Browser::load ( const char *  directory,
Fl_File_Sort_F sort = fl_numericsort 
)

Loads the specified directory into the browser.

If icons have been loaded then the correct icon is associated with each file in the list.

The sort argument specifies a sort function to be used with fl_filename_list().

void Fl_File_Browser::textsize ( Fl_Fontsize  newSize  )  [inline]

Sets the default text size (in pixels) for the lines in the browser to newSize.

This method recalculates all item heights and caches the total height internally for optimization of later item changes. This can be slow if there are many items in the browser.

It returns immediately (w/o recalculation) if newSize equals the current textsize().

You may need to call redraw() to see the effect and to have the scrollbar positions recalculated.

You should set the text size before populating the browser with items unless you really need to change the size later.

Reimplemented from Fl_Browser.


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