|
FLTK 1.3.0
|
The Fl_File_Icon class manages icon images that can be used as labels in other widgets and as icons in the FileBrowser widget. More...
#include <Fl_File_Icon.H>
Public Types | |
| enum | { ANY, PLAIN, FIFO, DEVICE, LINK, DIRECTORY } |
| enum | { END, COLOR, LINE, CLOSEDLINE, POLYGON, OUTLINEPOLYGON, VERTEX } |
Public Member Functions | |
| short * | add (short d) |
| Adds a keyword value to the icon array, returning a pointer to it. | |
| short * | add_color (Fl_Color c) |
| Adds a color value to the icon array, returning a pointer to it. | |
| short * | add_vertex (int x, int y) |
| Adds a vertex value to the icon array, returning a pointer to it. | |
| short * | add_vertex (float x, float y) |
| Adds a vertex value to the icon array, returning a pointer to it. | |
| void | clear () |
| Clears all icon data from the icon. | |
| void | draw (int x, int y, int w, int h, Fl_Color ic, int active=1) |
| Draws an icon in the indicated area. | |
| Fl_File_Icon (const char *p, int t, int nd=0, short *d=0) | |
| Creates a new Fl_File_Icon with the specified information. | |
| void | label (Fl_Widget *w) |
| Applies the icon to the widget, registering the Fl_File_Icon label type as needed. | |
| void | load (const char *f) |
| Loads the specified icon image. | |
| int | load_fti (const char *fti) |
| Loads an SGI icon file. | |
| int | load_image (const char *i) |
| Load an image icon file from an image filename. | |
| Fl_File_Icon * | next () |
| Returns next file icon object. | |
| const char * | pattern () |
| Returns the filename matching pattern for the icon. | |
| int | size () |
| Returns the number of words of data used by the icon. | |
| int | type () |
| Returns the filetype associated with the icon, which can be one of the following: | |
| short * | value () |
| Returns the data array for the icon. | |
| ~Fl_File_Icon () | |
| The destructor destroys the icon and frees all memory that has been allocated for it. | |
Static Public Member Functions | |
| static Fl_File_Icon * | find (const char *filename, int filetype=ANY) |
| Finds an icon that matches the given filename and file type. | |
| static Fl_File_Icon * | first () |
| Returns a pointer to the first icon in the list. | |
| static void | labeltype (const Fl_Label *o, int x, int y, int w, int h, Fl_Align a) |
| Draw the icon label. | |
| static void | load_system_icons (void) |
| Loads all system-defined icons. | |
The Fl_File_Icon class manages icon images that can be used as labels in other widgets and as icons in the FileBrowser widget.
| Fl_File_Icon::Fl_File_Icon | ( | const char * | p, |
| int | t, | ||
| int | nd = 0, |
||
| short * | d = 0 |
||
| ) |
Creates a new Fl_File_Icon with the specified information.
| [in] | p | filename pattern |
| [in] | t | file type |
| [in] | nd | number of data values |
| [in] | d | data values |
| short * Fl_File_Icon::add | ( | short | d | ) |
Adds a keyword value to the icon array, returning a pointer to it.
| [in] | d | data value |
| short* Fl_File_Icon::add_color | ( | Fl_Color | c | ) | [inline] |
Adds a color value to the icon array, returning a pointer to it.
| [in] | c | color value |
| short* Fl_File_Icon::add_vertex | ( | int | x, |
| int | y | ||
| ) | [inline] |
Adds a vertex value to the icon array, returning a pointer to it.
The integer version accepts coordinates from 0 to 10000. The origin (0.0) is in the lower-lefthand corner of the icon.
| [in] | x,y | vertex coordinates |
| short* Fl_File_Icon::add_vertex | ( | float | x, |
| float | y | ||
| ) | [inline] |
Adds a vertex value to the icon array, returning a pointer to it.
The floating point version goes from 0.0 to 1.0. The origin (0.0) is in the lower-lefthand corner of the icon.
| [in] | x,y | vertex coordinates |
| void Fl_File_Icon::clear | ( | ) | [inline] |
Clears all icon data from the icon.
| void Fl_File_Icon::draw | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| Fl_Color | ic, | ||
| int | active = 1 |
||
| ) |
Draws an icon in the indicated area.
| [in] | x,y,w,h | position and size |
| [in] | ic | icon color |
| [in] | active | status, default is active [non-zero] |
| Fl_File_Icon * Fl_File_Icon::find | ( | const char * | filename, |
| int | filetype = ANY |
||
| ) | [static] |
Finds an icon that matches the given filename and file type.
| [in] | filename | name of file |
| [in] | filetype | enumerated file type |
| static Fl_File_Icon* Fl_File_Icon::first | ( | ) | [inline, static] |
Returns a pointer to the first icon in the list.
| void Fl_File_Icon::label | ( | Fl_Widget * | w | ) |
Applies the icon to the widget, registering the Fl_File_Icon label type as needed.
| [in] | w | widget for which this icon will become the label |
| void Fl_File_Icon::labeltype | ( | const Fl_Label * | o, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| Fl_Align | a | ||
| ) | [static] |
Draw the icon label.
| [in] | o | label data |
| [in] | x,y,w,h | position and size of label |
| [in] | a | label alignment [not used] |
| void Fl_File_Icon::load | ( | const char * | f | ) |
Loads the specified icon image.
The format is deduced from the filename.
| [in] | f | filename |
| int Fl_File_Icon::load_fti | ( | const char * | fti | ) |
Loads an SGI icon file.
| [in] | fti | icon filename |
| int Fl_File_Icon::load_image | ( | const char * | ifile | ) |
Load an image icon file from an image filename.
| [in] | ifile | image filename |
| void Fl_File_Icon::load_system_icons | ( | void | ) | [static] |
Loads all system-defined icons.
This call is useful when using the FileChooser widget and should be used when the application starts:
| Fl_File_Icon* Fl_File_Icon::next | ( | ) | [inline] |
Returns next file icon object.
| const char* Fl_File_Icon::pattern | ( | ) | [inline] |
Returns the filename matching pattern for the icon.
| int Fl_File_Icon::size | ( | ) | [inline] |
Returns the number of words of data used by the icon.
| int Fl_File_Icon::type | ( | ) | [inline] |
Returns the filetype associated with the icon, which can be one of the following:
| short* Fl_File_Icon::value | ( | ) | [inline] |
Returns the data array for the icon.