fltk/documentation/Fl_FileIcon.html
Michael R Sweet 9a528400f0 Doco updates.
Add directory-only support to Fl_FileBrowser.

Update button and menu drawing code for check and radio buttons.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2001-09-04 13:13:29 +00:00

154 lines
4.5 KiB
HTML

<HTML>
<BODY>
<!-- NEW PAGE -->
<H2><A NAME="Fl_FileIcon">class Fl_FileIcon</A></H2>
<HR>
<H3>Class Hierarchy</H3>
<UL><PRE>
<B>Fl_FileIcon</B>
</PRE></UL>
<H3>Include Files</H3>
<UL><PRE>
#include &lt;FL/Fl_FileIcon.H>
</PRE></UL>
<H3>Description</H3>
<P>The <CODE>Fl_FileIcon</CODE> class manages icon images that can be
used as labels in other widgets and as icons in the <CODE>FileBrowser</CODE>
widget.
<H3>Methods</H3>
<UL>
<LI><A HREF="#Fl_FileIcon.Fl_FileIcon">Fl_FileIcon</A>
<LI><A HREF="#Fl_FileIcon.~Fl_FileIcon">~Fl_FileIcon</A>
<LI><A HREF="#Fl_FileIcon.add">add</A>
<LI><A HREF="#Fl_FileIcon.add_color">add_color</A>
<LI><A HREF="#Fl_FileIcon.add_vertex">add_vertex</A>
<LI><A HREF="#Fl_FileIcon.clear">clear</A>
<LI><A HREF="#Fl_FileIcon.draw">draw</A>
<LI><A HREF="#Fl_FileIcon.find">find</A>
<LI><A HREF="#Fl_FileIcon.first">first</A>
<LI><A HREF="#Fl_FileIcon.label">label</A>
<LI><A HREF="#Fl_FileIcon.labeltype">labeltype</A>
<LI><A HREF="#Fl_FileIcon.load_fti">load_fti</A>
<LI><A HREF="#Fl_FileIcon.load">load</A>
<LI><A HREF="#Fl_FileIcon.load_system_icons">load_system_icons</A>
<LI><A HREF="#Fl_FileIcon.load_xpm">load_xpm</A>
<LI><A HREF="#Fl_FileIcon.pattern">pattern</A>
<LI><A HREF="#Fl_FileIcon.size">size</A>
<LI><A HREF="#Fl_FileIcon.type">type</A>
<LI><A HREF="#Fl_FileIcon.value">value</A>
</UL>
<H4><A NAME="Fl_FileIcon.Fl_FileIcon">Fl_FileIcon()</A></H4>
<P>The constructor creates a new <CODE>Fl_FileIcon</CODE> with the specified
information.
<H4><A NAME="Fl_FileIcon.~Fl_FileIcon">~Fl_FileIcon()</A></H4>
<P>The destructor destroys the icon and frees all memory that has been
allocated for it.
<H4><A NAME="Fl_FileIcon.add">short *add(short d)</A></H4>
<P>Adds a keyword value to the icon array, returning a pointer to it.
<H4><A NAME="Fl_FileIcon.add_color">short *add_color(short c)</A></H4>
<P>Adds a color value to the icon array, returning a pointer to it.
<H4><A NAME="Fl_FileIcon.add_vertex">short *add_vertex(int x, int y)<BR>
short *add_vertex(float x, float y)</A></H4>
<P>Adds a vertex value to the icon array, returning a pointer to it.
The integer version accepts coordinates from 0 to 10000, while the
floating point version goes from 0.0 to 1.0. The origin (0.0) is in
the lower-lefthand corner of the icon.
<H4><A NAME="Fl_FileIcon.clear">void clear()</A></H4>
<P>Clears all icon data from the icon.
<H4><A NAME="Fl_FileIcon.draw">void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1)</A></H4>
<P>Draws the icon in the indicated area.
<H4><A NAME="Fl_FileIcon.find">static Fl_FileIcon *find(const char *filename, int filetype = ANY);</A></H4>
<P>Finds an icon that matches the given filename and file type.
<H4><A NAME="Fl_FileIcon.first">static Fl_FileIcon *first()</A></H4>
<P>Returns a pointer to the first icon in the list.
<H4><A NAME="Fl_FileIcon.label">void label(Fl_Widget *w)</A></H4>
<P>Applies the icon to the widget, registering the <CODE>Fl_FileIcon</CODE>
label type as needed.
<H4><A NAME="Fl_FileIcon.labeltype">static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a)</A></H4>
<P>The labeltype function for icons.
<H4><A NAME="Fl_FileIcon.load">void load(const char *f)</A></H4>
<P>Loads the specified icon image. The format is deduced from the filename.
<H4><A NAME="Fl_FileIcon.load_fti">void load_fti(const char *fti)</A></H4>
<P>Loads an SGI icon file.
<H4><A NAME="Fl_FileIcon.load_system_icons">static void load_system_icons(void)</A></H4>
<P>Loads all system-defined icons. This call is useful when using the
<CODE>FileChooser</CODE> widget and should be used when the application
starts:
<UL><PRE>
Fl_FileIcon::load_system_icons();
</PRE></UL>
<H4><A NAME="Fl_FileIcon.load_xpm">void load_xpm(const char *xpm)</A></H4>
<P>Loads an XPM icon file.
<H4><A NAME="Fl_FileIcon.pattern">const char *pattern()</A></H4>
<P>Returns the filename matching pattern for the icon.
<H4><A NAME="Fl_FileIcon.size">int size()</A></H4>
<P>Returns the number of words of data used by the icon.
<H4><A NAME="Fl_FileIcon.type">int type()</A></H4>
<P>Returns the filetype associated with the icon, which can be one of the
following:
<UL>
<LI><CODE>Fl_FileIcon::ANY</CODE>, any kind of file.
<LI><CODE>Fl_FileIcon::PLAIN</CODE>, plain files.
<LI><CODE>Fl_FileIcon::FIFO</CODE>, named pipes.
<LI><CODE>Fl_FileIcon::DEVICE</CODE>, character and block devices.
<LI><CODE>Fl_FileIcon::LINK</CODE>, symbolic links.
<LI><CODE>Fl_FileIcon::DIRECTORY</CODE>, directories.
</UL>
<H4><A NAME="Fl_FileIcon.value">short *value()</A></H4>
<P>Returns the data array for the icon.
</BODY>
</HTML>