diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1999-01-13 19:28:54 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1999-01-13 19:28:54 +0000 |
| commit | d7b88a3bcc7e76f38ee5799be7722fd5a10781ef (patch) | |
| tree | d8984d45424c9b2cdb199c1918f38bfea4a8211d /documentation | |
| parent | 30fa233681467b82b165e7d42cd0bea778b93768 (diff) | |
Updated all links so they work between files.
Revision 1.
git-svn-id: file:///fltk/svn/fltk/trunk@219 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation')
71 files changed, 9261 insertions, 12222 deletions
diff --git a/documentation/Fl_Adjuster.html b/documentation/Fl_Adjuster.html index d7cdf0a90..bb51e26c1 100644 --- a/documentation/Fl_Adjuster.html +++ b/documentation/Fl_Adjuster.html @@ -1,61 +1,47 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Adjuster">class Fl_Adjuster</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Adjuster>class Fl_Adjuster</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Adjuster</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Adjuster.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Adjuster</tt> widget was stolen from Prisms, and has -proven to be very useful for values that need a large dynamic range. -When you press a button and drag to the right the value increases. When -you drag to the left it decreases. The largest button adjusts by -<tt>100 * step()</tt>, the next by <tt>10 * step()</tt> and that -smallest button by <tt>step()</tt>. Clicking on the buttons increments -by 10 times the amount dragging by a pixel does. Shift + click -decrements by 10 times the amount. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Adjuster.Fl_Adjuster">Fl_Adjuster</a> - <li><a href="#Fl_Adjuster.~Fl_Adjuster">~Fl_Adjuster</a> - <li><a href="#Fl_Adjuster.soft">soft</a> -</ul> - -<h4><a name="Fl_Adjuster.Fl_Adjuster">Fl_Adjuster::Fl_Adjuster(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Adjuster</tt> widget using the given position, size, and -label string. It looks best if one of the dimensions is 3 times the other. - -<h4><a name="Fl_Adjuster.~Fl_Adjuster">virtual Fl_Adjuster::~Fl_Adjuster()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Adjuster.soft">uchar Fl_Adjuster::soft() const<br> -void Fl_Adjuster::soft(uchar)</a></h4> - -If "soft" is turned on, the user is allowed to drag the value outside -the range. If they drag the value to one of the ends, let go, then -grab again and continue to drag, they can get to any value. Default -is one. - -</body> -</html> + +----<B>Fl_Adjuster</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Adjuster.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Adjuster</TT> widget was stolen from Prisms, and has proven +to be very useful for values that need a large dynamic range. When you +press a button and drag to the right the value increases. When you drag +to the left it decreases. The largest button adjusts by <TT>100 * +step()</TT>, the next by <TT>10 * step()</TT> and that smallest button +by <TT>step()</TT>. Clicking on the buttons increments by 10 times the +amount dragging by a pixel does. Shift + click decrements by 10 times +the amount. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Adjuster.Fl_Adjuster>Fl_Adjuster</A></LI> +<LI><A href=#Fl_Adjuster.~Fl_Adjuster>~Fl_Adjuster</A></LI> +<LI><A href=#Fl_Adjuster.soft>soft</A></LI> +</UL> +<H4><A name=Fl_Adjuster.Fl_Adjuster>Fl_Adjuster::Fl_Adjuster(int x, int +y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Adjuster</TT> widget using the given position, +size, and label string. It looks best if one of the dimensions is 3 +times the other. +<H4><A name=Fl_Adjuster.~Fl_Adjuster>virtual Fl_Adjuster::~Fl_Adjuster()</A> +</H4> + Destroys the valuator. +<H4><A name=Fl_Adjuster.soft>uchar Fl_Adjuster::soft() const +<BR> void Fl_Adjuster::soft(uchar)</A></H4> + If "soft" is turned on, the user is allowed to drag the value outside +the range. If they drag the value to one of the ends, let go, then +grab again and continue to drag, they can get to any value. Default is +one. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Box.html b/documentation/Fl_Box.html index e702d863d..4aa5cffeb 100644 --- a/documentation/Fl_Box.html +++ b/documentation/Fl_Box.html @@ -1,52 +1,39 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Box">class Fl_Box</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Box>class Fl_Box</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Box</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Box.H> -</pre></ul> - -<h3>Description</h3> - -This widget simply draws its box, and possibly it's label. Putting it -before some other widgets and making it big enough to surround them -will let you draw a frame around them. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Box.Fl_Box">Fl_Box</a> - <li><a href="#Fl_Box.~Fl_Box">~Fl_Box</a> -</ul> - -<h4><a name="Fl_Box.Fl_Box">Fl_Box::Fl_Box(int x, int y, int w, int h, const char * = 0)<br> -Fl_Box::Fl_Box(Fl_Boxtype b, int x, int y, int w, int h, const char *)</a></h4> - -The first constructor sets <tt>box()</tt> to <tt>FL_NO_BOX</tt>, which -means it is invisible. However such widgets are useful as placeholders -or <a href=#Fl_Group.resizable"><tt>Fl_Group::resizable()</tt></a> -values. To change the box to something visible, use <tt>box(n)</tt>. - -<p>The second form of the constructor sets the box to the specified box type. - -<h4><a name="Fl_Box.~Fl_Box">Fl_Box::~Fl_Box(void)</a></h4> - -The destructor removes the box. - -</body> -</html> + +----<B>Fl_Box</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Box.H> +</PRE> +</UL> +<H3>Description</H3> + This widget simply draws its box, and possibly it's label. Putting it +before some other widgets and making it big enough to surround them +will let you draw a frame around them. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Box.Fl_Box>Fl_Box</A></LI> +<LI><A href=#Fl_Box.~Fl_Box>~Fl_Box</A></LI> +</UL> +<H4><A name=Fl_Box.Fl_Box>Fl_Box::Fl_Box(int x, int y, int w, int h, +const char * = 0) +<BR> Fl_Box::Fl_Box(Fl_Boxtype b, int x, int y, int w, int h, const +char *)</A></H4> + The first constructor sets <TT>box()</TT> to <TT>FL_NO_BOX</TT>, which +means it is invisible. However such widgets are useful as placeholders +or <A href=#Fl_Group.resizable"><TT>Fl_Group::resizable()</TT></A> + values. To change the box to something visible, use <TT>box(n)</TT>. +<P>The second form of the constructor sets the box to the specified box +type. </P> +<H4><A name=Fl_Box.~Fl_Box>Fl_Box::~Fl_Box(void)</A></H4> + The destructor removes the box. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Browser.html b/documentation/Fl_Browser.html index c0219955c..cfd6c9ba8 100644 --- a/documentation/Fl_Browser.html +++ b/documentation/Fl_Browser.html @@ -1,276 +1,200 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Browser">class Fl_Browser</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Browser_">Fl_Browser_</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Browser>class Fl_Browser</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Browser_.html#Fl_Browser_>Fl_Browser_</A> | - +----<b>Fl_Browser</b> + +----<B>Fl_Browser</B> | - +----<a href="#Fl_Hold_Browser">Fl_Hold_Browser</a>, <a href="#Fl_Multi_Browser">Fl_Multi_Browser</a>, <a href="#Fl_Select_Browser">Fl_Select_Browser</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Browser.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Browser</tt> widget displays a scrolling list of text lines, -and manages all the storage for the text. This is not a text editor or -spreadsheet! But it is useful for showing a vertical list of named -objects to the user. - -<p>Each line in the browser is identified by number. <i>The numbers -start at one</i> (this is so that zero can be reserved for "no line" -in the selective browsers). <i>Unless otherwise noted, the methods do -not check to see if the passed line number is in range and legal. It -must always be greater than zero and <= <tt>size()</tt>.</i> - -<p>Each line contains a null-terminated string of text and a <tt>void -*</tt> data pointer. The text string is displayed, the <tt>void *</tt> -pointer can be used by the callbacks to reference the object the text -describes. - -<p>The base class does nothing when the user clicks on it. The subclasses -<a href="#Fl_Select_Browser"><tt>Fl_Select_Browser</tt></a>, -<a href="#Fl_Hold_Browser"><tt>Fl_Hold_Browser</tt></a>, and -<a href="#Fl_Multi_Browser"><tt>Fl_Multi_Browser</tt></a> -react to user clicks to select lines in the browser and do callbacks. - -<p>The base class called <a href="#Fl_Browser_"> -<tt>Fl_Browser_</tt></a> provides the scrolling and selection -mechanisms of this and all the subclasses, but the dimensions and -appearance of each item are determined by the subclass. You can use -<tt>Fl_Browser_</tt> to display information other than text, or text -that is dynamically produced from your own data structures. If you find -that loading the browser is a lot of work or is inefficient, you may -want to make a subclass of <tt>Fl_Browser_</tt>. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser.Fl_Browser">Fl_Browser</a> - <li><a href="#Fl_Browser.~Fl_Browser">~Fl_Browser</a> - <li><a href="#Fl_Browser.add">add</a> - <li><a href="#Fl_Browser.clear">clear</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser.column_char">column_char</a> - <li><a href="#Fl_Browser.column_widths">column_widths</a> - <li><a href="#Fl_Browser.data">data</a> - <li><a href="#Fl_Browser.format_char">format_char</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser.hide">hide</a> - <li><a href="#Fl_Browser.insert">insert</a> - <li><a href="#Fl_Browser.load">load</a> - <li><a href="#Fl_Browser.move">move</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser.position">position</a> - <li><a href="#Fl_Browser.remove">remove</a> - <li><a href="#Fl_Browser.show">show</a> - <li><a href="#Fl_Browser.size">size</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser.text">text</a> - <li><a href="#Fl_Browser.topline">topline</a> - <li><a href="#Fl_Browser.visible">visible</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Browser.Fl_Browser">Fl_Browser::Fl_Browser(int, int, int, int, const char * = 0)</a></h4> - -The constructor makes an empty browser. - -<h4><a name="Fl_Browser.~Fl_Browser">Fl_Browser::~Fl_Browser(void)</a></h4> - -The destructor deletes all list items and destroys the browser. - -<h4><a name="Fl_Browser.add">void Fl_Browser::add(const char *, void * = 0)</a></h4> - -Add a new line to the end of the browser. The text is copied using the -<tt>strdup()</tt> function. It may also be <tt>NULL</tt> to make a -blank line. The <tt>void *</tt> argument is returned as the -<tt>data()</tt> of the new item. - -<h4><a name="Fl_Browser.clear">void Fl_Browser::clear()</a></h4> - -Remove all the lines in the browser. - -<h4><a name="Fl_Browser.column_char">uchar Fl_Browser::column_char() const<br> -void Fl_Browser::column_char(char c)</a></h4> - -The first form gets the current column separator character. By default this is -<tt>'\t'</tt> (tab). - -<p>The second form sets the column separator to <tt>c</tt>. This will only -have an effect if you also set <tt>column_widths()</tt>. - -<h4><a name="Fl_Browser.column_widths">const int *Fl_Browser::column_widths() const<br> -void Fl_Browser::column_widths(const int *w)</a></h4> - -The first form gets the current column width array. This array is -zero-terminated and specifies the widths in pixels of each column. The -text is split at each <tt>column_char()</tt> and each part is formatted -into it's own column. After the last column any remaining text is -formatted into the space between the last column and the right edge of -the browser, even if the text contains instances of -<tt>column_char()</tt>. The default value is a one-element array of -just a zero, which makes there are no columns. - -<p>The second form sets the current array to <tt>w</tt>. Make sure the last -entry is zero. - -<h4><a name="Fl_Browser.data">void *Fl_Browser::data(int n) const<br> -void Fl_Browser::data(int n, void *)</a></h4> - -The first form returns the data for line <tt>n</tt>. If <tt>n</tt> is -out of range this returns <tt>NULL</tt>. - -<p>The second form sets the data for line <tt>n</tt>. - -<h4><a name="Fl_Browser.format_char">uchar Fl_Browser::format_char() const<br> -void Fl_Browser::format_char(char c)</a></h4> - -The first form gets the current format code prefix character, which by -default is <tt>@</tt>. A string of formatting codes at the start of -each column are stripped off and used to modify how the rest of the -line is printed: - -<ul> - <li><code>@.</code> Print rest of line, don't look for more '@' signs - - <li><code>@@</code> Print rest of line starting with '@' - - <li><code>@l</code> Use a <big>large</big> (24 point) font - - <li><code>@m</code> Use a <big>medium large</big> (18 point) font - - <li><code>@s</code> Use a <small>small</small> (11 point) font - - <li><code>@b</code> Use a <b>bold</b> font (adds FL_BOLD to font) - - <li><code>@i</code> Use an <i>italic</i> font (adds FL_ITALIC to font) - - <li><code>@f</code> or <code>@t</code> Use a <code>fixed-pitch</code> - font (sets font to FL_COURIER) - - <li><code>@c</code> Center the line horizontally - - <li><code>@r</code> Right-justify the text - - <li><code>@B0, @B1, ... @B255</code> Fill the backgound with fl_color(n) - - <li><code>@C0, @C1, ... @C255</code> Use fl_color(n) to draw the text - - <li><code>@F0, @F1, ... </code> Use fl_font(n) to draw the text - - <li><code>@S1, @S2, ... </code> Use point size n to draw the text - - <li><code>@u</code> or <code>@_</code> Underline the text. - - <li><code>@-</code> draw an engraved line through the middle. -</ul> - -Notice that the <code>@.</code> command can be used to reliably -terminate the parsing. To print a random string in a random color, -use <tt>sprintf("@C%d@.%s", color, string)</tt> and it will work even -if the string starts with a digit or has the format character in it. - -<p>The second form sets the current prefix to <tt>c</tt>. Set the prefix -to 0 to disable formatting. - -<h4><a name="Fl_Browser.hide">void Fl_Browser::hide(int n)</a></h4> - -Makes line <tt>n</tt> invisible, preventing selection by the user. The line -can still be selected under program control. - -<h4><a name="Fl_Browser.insert">void Fl_Browser::insert(int n, const char *, void * = 0)</a></h4> - -Insert a new line <i>before</i> line <tt>n</tt>. If <tt>n</tt> > -<tt>size()</tt> then the line is added to the end. - -<h4><a name="Fl_Browser.load">int Fl_Browser::load(const char *filename)</a></h4> - -Clears the browser and reads the file, adding each line from the file -to the browser. If the filename is <tt>NULL</tt> or a zero-length -string then this just clears the browser. This returns zero if there -was any error in opening or reading the file, in which case -<tt>errno</tt> is set to the system error. The <tt>data()</tt> of each -line is set to <tt>NULL</tt>. - -<h4><a name="Fl_Browser.move">void Fl_Browser::move(int to, int from)</a></h4> - -Line <tt>from</tt> is removed and reinserted at <tt>to</tt>; <tt>to</tt> -is calculated after the line is removed. - -<h4><a name="Fl_Browser.position">int Fl_Browser::position() const<br> -void Fl_Browser::position(int p)</a></h4> - -The first form returns the current vertical scrollbar position, where 0 -corresponds to the top. If there is not vertical scrollbar then this -will always return 0. - -<h4><a name="Fl_Browser.remove">void Fl_Browser::remove(int n)</a></h4> - -Remove line <tt>n</tt> and make the browser one line shorter. - -<h4><a name="Fl_Browser.show">void Fl_Browser::show(int n)</a></h4> - -Makes line <tt>n</tt> visible for selection. - -<h4><a name="Fl_Browser.size">int Fl_Browser::size() const</a></h4> - -Returns how many lines are in the browser. The last line number is -equal to this. - -<h4><a name="Fl_Browser.text">const char *Fl_Browser::text(int n) const<br> -void Fl_Browser::text(int n, const char *)</a></h4> - -The first form returns the text for line <tt>n</tt>. If <tt>n</tt> is -out of range it returns <tt>NULL</tt>. - -<p>The second form sets the text for line <tt>n</tt>. - -<h4><a name="Fl_Browser.topline">int Fl_Browser::topline() const<br> -void Fl_Browser::topline(int n)</a></h4> - -The first form returns the current top line in the browser. If there is no -vertical scrollbar then this will always return 1. - -<p>The second form sets the top line in the browser to <tt>n</tt>. - -<p>The second form sets the vertical scrollbar position to <tt>p</tt>. - -<h4><a name="Fl_Browser.visible">int Fl_Browser::visible(int n) const</a></h4> - -Returns a non-zero value if line <tt>n</tt> is visible. - -</body> -</html> + +----<A href=Fl_Hold_Browser.html#Fl_Hold_Browser>Fl_Hold_Browser</A>, <A href=Fl_Multi_Browser.html#Fl_Multi_Browser>Fl_Multi_Browser</A>, <A href=Fl_Select_Browser.html#Fl_Select_Browser>Fl_Select_Browser</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Browser.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Browser</TT> widget displays a scrolling list of text +lines, and manages all the storage for the text. This is not a text +editor or spreadsheet! But it is useful for showing a vertical list of +named objects to the user. +<P>Each line in the browser is identified by number. <I>The numbers +start at one</I> (this is so that zero can be reserved for "no line" in +the selective browsers). <I>Unless otherwise noted, the methods do not +check to see if the passed line number is in range and legal. It must +always be greater than zero and <= <TT>size()</TT>.</I></P> +<P>Each line contains a null-terminated string of text and a <TT>void *</TT> + data pointer. The text string is displayed, the <TT>void *</TT> + pointer can be used by the callbacks to reference the object the text +describes. </P> +<P>The base class does nothing when the user clicks on it. The +subclasses <A href=Fl_Select_Browser.html#Fl_Select_Browser><TT> +Fl_Select_Browser</TT></A>, <A href=Fl_Hold_Browser.html#Fl_Hold_Browser> +<TT>Fl_Hold_Browser</TT></A>, and <A href=Fl_Multi_Browser.html#Fl_Multi_Browser> +<TT>Fl_Multi_Browser</TT></A> react to user clicks to select lines in +the browser and do callbacks. </P> +<P>The base class called <A href=Fl_Browser_.html#Fl_Browser_><TT> +Fl_Browser_</TT></A> provides the scrolling and selection mechanisms of +this and all the subclasses, but the dimensions and appearance of each +item are determined by the subclass. You can use <TT>Fl_Browser_</TT> + to display information other than text, or text that is dynamically +produced from your own data structures. If you find that loading the +browser is a lot of work or is inefficient, you may want to make a +subclass of <TT>Fl_Browser_</TT>. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser.Fl_Browser>Fl_Browser</A></LI> +<LI><A href=#Fl_Browser.~Fl_Browser>~Fl_Browser</A></LI> +<LI><A href=#Fl_Browser.add>add</A></LI> +<LI><A href=#Fl_Browser.clear>clear</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser.column_char>column_char</A></LI> +<LI><A href=#Fl_Browser.column_widths>column_widths</A></LI> +<LI><A href=#Fl_Browser.data>data</A></LI> +<LI><A href=#Fl_Browser.format_char>format_char</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser.hide>hide</A></LI> +<LI><A href=#Fl_Browser.insert>insert</A></LI> +<LI><A href=#Fl_Browser.load>load</A></LI> +<LI><A href=#Fl_Browser.move>move</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser.position>position</A></LI> +<LI><A href=#Fl_Browser.remove>remove</A></LI> +<LI><A href=#Fl_Browser.show>show</A></LI> +<LI><A href=#Fl_Browser.size>size</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser.text>text</A></LI> +<LI><A href=#Fl_Browser.topline>topline</A></LI> +<LI><A href=#Fl_Browser.visible>visible</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Browser.Fl_Browser>Fl_Browser::Fl_Browser(int, int, int, +int, const char * = 0)</A></H4> + The constructor makes an empty browser. +<H4><A name=Fl_Browser.~Fl_Browser>Fl_Browser::~Fl_Browser(void)</A></H4> + The destructor deletes all list items and destroys the browser. +<H4><A name=Fl_Browser.add>void Fl_Browser::add(const char *, void * = +0)</A></H4> + Add a new line to the end of the browser. The text is copied using +the <TT>strdup()</TT> function. It may also be <TT>NULL</TT> to make a +blank line. The <TT>void *</TT> argument is returned as the <TT>data()</TT> + of the new item. +<H4><A name=Fl_Browser.clear>void Fl_Browser::clear()</A></H4> + Remove all the lines in the browser. +<H4><A name=Fl_Browser.column_char>uchar Fl_Browser::column_char() const +<BR> void Fl_Browser::column_char(char c)</A></H4> + The first form gets the current column separator character. By default +this is <TT>'\t'</TT> (tab). +<P>The second form sets the column separator to <TT>c</TT>. This will +only have an effect if you also set <TT>column_widths()</TT>. </P> +<H4><A name=Fl_Browser.column_widths>const int +*Fl_Browser::column_widths() const +<BR> void Fl_Browser::column_widths(const int *w)</A></H4> + The first form gets the current column width array. This array is +zero-terminated and specifies the widths in pixels of each column. The +text is split at each <TT>column_char()</TT> and each part is formatted +into it's own column. After the last column any remaining text is +formatted into the space between the last column and the right edge of +the browser, even if the text contains instances of <TT>column_char()</TT> +. The default value is a one-element array of just a zero, which makes +there are no columns. +<P>The second form sets the current array to <TT>w</TT>. Make sure the +last entry is zero. </P> +<H4><A name=Fl_Browser.data>void *Fl_Browser::data(int n) const +<BR> void Fl_Browser::data(int n, void *)</A></H4> + The first form returns the data for line <TT>n</TT>. If <TT>n</TT> is +out of range this returns <TT>NULL</TT>. +<P>The second form sets the data for line <TT>n</TT>. </P> +<H4><A name=Fl_Browser.format_char>uchar Fl_Browser::format_char() const +<BR> void Fl_Browser::format_char(char c)</A></H4> + The first form gets the current format code prefix character, which by +default is <TT>@</TT>. A string of formatting codes at the start of +each column are stripped off and used to modify how the rest of the +line is printed: +<UL> +<LI><CODE>@.</CODE> Print rest of line, don't look for more '@' signs </LI> +<LI><CODE>@@</CODE> Print rest of line starting with '@' </LI> +<LI><CODE>@l</CODE> Use a <BIG>large</BIG> (24 point) font </LI> +<LI><CODE>@m</CODE> Use a <BIG>medium large</BIG> (18 point) font </LI> +<LI><CODE>@s</CODE> Use a <SMALL>small</SMALL> (11 point) font </LI> +<LI><CODE>@b</CODE> Use a <B>bold</B> font (adds FL_BOLD to font) </LI> +<LI><CODE>@i</CODE> Use an <I>italic</I> font (adds FL_ITALIC to font) </LI> +<LI><CODE>@f</CODE> or <CODE>@t</CODE> Use a <CODE>fixed-pitch</CODE> + font (sets font to FL_COURIER) </LI> +<LI><CODE>@c</CODE> Center the line horizontally </LI> +<LI><CODE>@r</CODE> Right-justify the text </LI> +<LI><CODE>@B0, @B1, ... @B255</CODE> Fill the backgound with +fl_color(n) </LI> +<LI><CODE>@C0, @C1, ... @C255</CODE> Use fl_color(n) to draw the text </LI> +<LI><CODE>@F0, @F1, ... </CODE> Use fl_font(n) to draw the text </LI> +<LI><CODE>@S1, @S2, ... </CODE> Use point size n to draw the text </LI> +<LI><CODE>@u</CODE> or <CODE>@_</CODE> Underline the text. </LI> +<LI><CODE>@-</CODE> draw an engraved line through the middle. </LI> +</UL> + Notice that the <CODE>@.</CODE> command can be used to reliably +terminate the parsing. To print a random string in a random color, use <TT> +sprintf("@C%d@.%s", color, string)</TT> and it will work even if the +string starts with a digit or has the format character in it. +<P>The second form sets the current prefix to <TT>c</TT>. Set the +prefix to 0 to disable formatting. </P> +<H4><A name=Fl_Browser.hide>void Fl_Browser::hide(int n)</A></H4> + Makes line <TT>n</TT> invisible, preventing selection by the user. + The line can still be selected under program control. +<H4><A name=Fl_Browser.insert>void Fl_Browser::insert(int n, const char +*, void * = 0)</A></H4> + Insert a new line <I>before</I> line <TT>n</TT>. If <TT>n</TT> > <TT> +size()</TT> then the line is added to the end. +<H4><A name=Fl_Browser.load>int Fl_Browser::load(const char *filename)</A> +</H4> + Clears the browser and reads the file, adding each line from the file +to the browser. If the filename is <TT>NULL</TT> or a zero-length +string then this just clears the browser. This returns zero if there +was any error in opening or reading the file, in which case <TT>errno</TT> + is set to the system error. The <TT>data()</TT> of each line is set +to <TT>NULL</TT>. +<H4><A name=Fl_Browser.move>void Fl_Browser::move(int to, int from)</A></H4> + Line <TT>from</TT> is removed and reinserted at <TT>to</TT>; <TT>to</TT> + is calculated after the line is removed. +<H4><A name=Fl_Browser.position>int Fl_Browser::position() const +<BR> void Fl_Browser::position(int p)</A></H4> + The first form returns the current vertical scrollbar position, where +0 corresponds to the top. If there is not vertical scrollbar then this +will always return 0. +<H4><A name=Fl_Browser.remove>void Fl_Browser::remove(int n)</A></H4> + Remove line <TT>n</TT> and make the browser one line shorter. +<H4><A name=Fl_Browser.show>void Fl_Browser::show(int n)</A></H4> + Makes line <TT>n</TT> visible for selection. +<H4><A name=Fl_Browser.size>int Fl_Browser::size() const</A></H4> + Returns how many lines are in the browser. The last line number is +equal to this. +<H4><A name=Fl_Browser.text>const char *Fl_Browser::text(int n) const +<BR> void Fl_Browser::text(int n, const char *)</A></H4> + The first form returns the text for line <TT>n</TT>. If <TT>n</TT> is +out of range it returns <TT>NULL</TT>. +<P>The second form sets the text for line <TT>n</TT>. </P> +<H4><A name=Fl_Browser.topline>int Fl_Browser::topline() const +<BR> void Fl_Browser::topline(int n)</A></H4> + The first form returns the current top line in the browser. If there +is no vertical scrollbar then this will always return 1. +<P>The second form sets the top line in the browser to <TT>n</TT>. </P> +<P>The second form sets the vertical scrollbar position to <TT>p</TT>. </P> +<H4><A name=Fl_Browser.visible>int Fl_Browser::visible(int n) const</A></H4> + Returns a non-zero value if line <TT>n</TT> is visible. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Browser_.html b/documentation/Fl_Browser_.html index fc8456f51..037fd211f 100644 --- a/documentation/Fl_Browser_.html +++ b/documentation/Fl_Browser_.html @@ -1,171 +1,134 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Browser_">class Fl_Browser_</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Browser_>class Fl_Browser_</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Browser_</b> + +----<B>Fl_Browser_</B> | - +----<a href="#Fl_Browser">Fl_Browser</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Browser_.H> -</pre></ul> - -<h3>Description</h3> - -This is the base class for browsers. To be useful it must be -subclassed and several virtual functions defined. The Forms-compatable -browser and the file chooser's browser are subclassed off of this. - -<p>This has been designed so that the subclass has complete control -over the storage of the data, although because <tt>next()</tt> and -<tt>prev()</tt> functions are used to index, it works best as a linked -list or as a large block of characters in which the line breaks must be -searched for. - -<p>A great deal of work has been done so that the "height" of a data -object does not need to be determined until it is drawn. This is -useful if actually figuring out the size of an object requires -accessing image data or doing <tt>stat()</tt> on a file or doing some -other slow operation. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser_.Fl_Browser_">Fl_Browser_</a> - <li><a href="#Fl_Browser_.~Fl_Browser_">~Fl_Browser_</a> - <li><a href="#Fl_Browser_.bbox">bbox</a> - <li><a href="#Fl_Browser_.deleting">deleting</a> - <li><a href="#Fl_Browser_.deselect">deselect</a> - <li><a href="#Fl_Browser_.display">display</a> - <li><a href="#Fl_Browser_.displayed">displayed</a> - <li><a href="#Fl_Browser_.draw">draw</a> - <li><a href="#Fl_Browser_.find_item">find_item</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser_.full_height">full_height</a> - <li><a href="#Fl_Browser_.full_width">full_width</a> - <li><a href="#Fl_Browser_.handle">handle</a> - <li><a href="#Fl_Browser_.has_scrollbar">has_scrollbar</a> - <li><a href="#Fl_Browser_.hposition">hposition</a> - <li><a href="#Fl_Browser_.incr_height">incr_height</a> - <li><a href="#Fl_Browser_.inserting">inserting</a> - <li><a href="#Fl_Browser_.item_draw">item_draw</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser_.item_first">item_first</a> - <li><a href="#Fl_Browser_.item_height">item_height</a> - <li><a href="#Fl_Browser_.item_next">item_next</a> - <li><a href="#Fl_Browser_.item_prev">item_prev</a> - <li><a href="#Fl_Browser_.item_quick_height">item_quick_height</a> - <li><a href="#Fl_Browser_.item_select">item_select</a> - <li><a href="#Fl_Browser_.item_selected">item_selected</a> - <li><a href="#Fl_Browser_.item_width">item_width</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser_.leftedge">leftedge</a> - <li><a href="#Fl_Browser_.new_list">new_list</a> - <li><a href="#Fl_Browser_.position">position</a> - <li><a href="#Fl_Browser_.redraw_line">redraw_line</a> - <li><a href="#Fl_Browser_.redraw_lines">redraw_lines</a> - <li><a href="#Fl_Browser_.replacing">replacing</a> - <li><a href="#Fl_Browser_.resize">resize</a> - <li><a href="#Fl_Browser_.scrollbar_left">scrollbar_left</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Browser_.scrollbar_right">scrollbar_right</a> - <li><a href="#Fl_Browser_.select">select</a> - <li><a href="#Fl_Browser_.select_only">select_only</a> - <li><a href="#Fl_Browser_.selection">selection</a> - <li><a href="#Fl_Browser_.textcolor">textcolor</a> - <li><a href="#Fl_Browser_.textfont">textfont</a> - <li><a href="#Fl_Browser_.textsize">textsize</a> - <li><a href="#Fl_Browser_.top">top</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Browser_.Fl_Browser_">Fl_Browser::Fl_Browser(int, int, int, int, const char * = 0)</a></h4> - -The constructor makes an empty browser. - -<h4><a name="Fl_Browser_.~Fl_Browser_">Fl_Browser::~Fl_Browser(void)</a></h4> - -The destructor deletes all list items and destroys the browser. - -<h4><a name="Fl_Browser_.has_scrollbar">void Fl_Browser_::has_scrollbar(int h)</a></h4> - -By default you can scroll in both directions, and the scrollbars -disappear if the data will fit in the widget. has_scrollbar() -changes this based on the value of <tt>h</tt>: - -<ul> - <li><code>0</code> - No scrollbars - - <li><code>Fl_Browser_::HORIZONTAL</code> - Only a horizontal scrollbar. - - <li><code>Fl_Browser_::VERTICAL</code> - Only a vertical scrollbar. - - <li><code>Fl_Browser_::BOTH</code> - The default is both scrollbars. - - <li><code>Fl_Browser_::HORIZONTAL_ALWAYS</code> - Horizontal - scrollbar always on, vertical always off. - - <li><code>Fl_Browser_::VERTICAL_ALWAYS</code> - Vertical - scrollbar always on, horizontal always off. - - <li><code>Fl_Browser_::BOTH_ALWAYS</code> - Both always on. -</ul> - -<h4><a name="Fl_Browser_.textcolor">Fl_Color Fl_Browser_::textcolor() const<br> -void Fl_Browser_::textcolor(Fl_Color color)</a></h4> - -The first form gets the default text color for the lines in the -browser. - -<p>The second form sets the default text color to <tt>color</tt> - -<h4><a name="Fl_Browser_.textfont">Fl_Font Fl_Browser_::textfont() const<br> -void Fl_Browser_::textfont(Fl_Font font)</a></h4> - -The first form gets the default text font for the lines in the -browser. - -<p>The second form sets the default text font to <tt>font</tt> - -<h4><a name="Fl_Browser_.textsize">uchar Fl_Browser_::textsize() const<br> -void Fl_Browser_::textsize(uchar size)</a></h4> - -The first form gets the default text size for the lines in the -browser. - -<p>The second form sets the default text size to <tt>size</tt> - -</body> -</html> + +----<A href=Fl_Browser.html#Fl_Browser>Fl_Browser</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Browser_.H> +</PRE> +</UL> +<H3>Description</H3> + This is the base class for browsers. To be useful it must be +subclassed and several virtual functions defined. The Forms-compatable +browser and the file chooser's browser are subclassed off of this. +<P>This has been designed so that the subclass has complete control +over the storage of the data, although because <TT>next()</TT> and <TT> +prev()</TT> functions are used to index, it works best as a linked list +or as a large block of characters in which the line breaks must be +searched for. </P> +<P>A great deal of work has been done so that the "height" of a data +object does not need to be determined until it is drawn. This is +useful if actually figuring out the size of an object requires +accessing image data or doing <TT>stat()</TT> on a file or doing some +other slow operation. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser_.Fl_Browser_>Fl_Browser_</A></LI> +<LI><A href=#Fl_Browser_.~Fl_Browser_>~Fl_Browser_</A></LI> +<LI><A href=#Fl_Browser_.bbox>bbox</A></LI> +<LI><A href=#Fl_Browser_.deleting>deleting</A></LI> +<LI><A href=#Fl_Browser_.deselect>deselect</A></LI> +<LI><A href=#Fl_Browser_.display>display</A></LI> +<LI><A href=#Fl_Browser_.displayed>displayed</A></LI> +<LI><A href=#Fl_Browser_.draw>draw</A></LI> +<LI><A href=#Fl_Browser_.find_item>find_item</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser_.full_height>full_height</A></LI> +<LI><A href=#Fl_Browser_.full_width>full_width</A></LI> +<LI><A href=#Fl_Browser_.handle>handle</A></LI> +<LI><A href=#Fl_Browser_.has_scrollbar>has_scrollbar</A></LI> +<LI><A href=#Fl_Browser_.hposition>hposition</A></LI> +<LI><A href=#Fl_Browser_.incr_height>incr_height</A></LI> +<LI><A href=#Fl_Browser_.inserting>inserting</A></LI> +<LI><A href=#Fl_Browser_.item_draw>item_draw</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser_.item_first>item_first</A></LI> +<LI><A href=#Fl_Browser_.item_height>item_height</A></LI> +<LI><A href=#Fl_Browser_.item_next>item_next</A></LI> +<LI><A href=#Fl_Browser_.item_prev>item_prev</A></LI> +<LI><A href=#Fl_Browser_.item_quick_height>item_quick_height</A></LI> +<LI><A href=#Fl_Browser_.item_select>item_select</A></LI> +<LI><A href=#Fl_Browser_.item_selected>item_selected</A></LI> +<LI><A href=#Fl_Browser_.item_width>item_width</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser_.leftedge>leftedge</A></LI> +<LI><A href=#Fl_Browser_.new_list>new_list</A></LI> +<LI><A href=#Fl_Browser_.position>position</A></LI> +<LI><A href=#Fl_Browser_.redraw_line>redraw_line</A></LI> +<LI><A href=#Fl_Browser_.redraw_lines>redraw_lines</A></LI> +<LI><A href=#Fl_Browser_.replacing>replacing</A></LI> +<LI><A href=#Fl_Browser_.resize>resize</A></LI> +<LI><A href=#Fl_Browser_.scrollbar_left>scrollbar_left</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Browser_.scrollbar_right>scrollbar_right</A></LI> +<LI><A href=#Fl_Browser_.select>select</A></LI> +<LI><A href=#Fl_Browser_.select_only>select_only</A></LI> +<LI><A href=#Fl_Browser_.selection>selection</A></LI> +<LI><A href=#Fl_Browser_.textcolor>textcolor</A></LI> +<LI><A href=#Fl_Browser_.textfont>textfont</A></LI> +<LI><A href=#Fl_Browser_.textsize>textsize</A></LI> +<LI><A href=#Fl_Browser_.top>top</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Browser_.Fl_Browser_>Fl_Browser::Fl_Browser(int, int, +int, int, const char * = 0)</A></H4> + The constructor makes an empty browser. +<H4><A name=Fl_Browser_.~Fl_Browser_>Fl_Browser::~Fl_Browser(void)</A></H4> + The destructor deletes all list items and destroys the browser. +<H4><A name=Fl_Browser_.has_scrollbar>void +Fl_Browser_::has_scrollbar(int h)</A></H4> + By default you can scroll in both directions, and the scrollbars +disappear if the data will fit in the widget. has_scrollbar() changes +this based on the value of <TT>h</TT>: +<UL> +<LI><CODE>0</CODE> - No scrollbars </LI> +<LI><CODE>Fl_Browser_::HORIZONTAL</CODE> - Only a horizontal scrollbar. </LI> +<LI><CODE>Fl_Browser_::VERTICAL</CODE> - Only a vertical scrollbar. </LI> +<LI><CODE>Fl_Browser_::BOTH</CODE> - The default is both scrollbars. </LI> +<LI><CODE>Fl_Browser_::HORIZONTAL_ALWAYS</CODE> - Horizontal scrollbar +always on, vertical always off. </LI> +<LI><CODE>Fl_Browser_::VERTICAL_ALWAYS</CODE> - Vertical scrollbar +always on, horizontal always off. </LI> +<LI><CODE>Fl_Browser_::BOTH_ALWAYS</CODE> - Both always on. </LI> +</UL> +<H4><A name=Fl_Browser_.textcolor>Fl_Color Fl_Browser_::textcolor() +const +<BR> void Fl_Browser_::textcolor(Fl_Color color)</A></H4> + The first form gets the default text color for the lines in the +browser. +<P>The second form sets the default text color to <TT>color</TT></P> +<H4><A name=Fl_Browser_.textfont>Fl_Font Fl_Browser_::textfont() const +<BR> void Fl_Browser_::textfont(Fl_Font font)</A></H4> + The first form gets the default text font for the lines in the +browser. +<P>The second form sets the default text font to <TT>font</TT></P> +<H4><A name=Fl_Browser_.textsize>uchar Fl_Browser_::textsize() const +<BR> void Fl_Browser_::textsize(uchar size)</A></H4> + The first form gets the default text size for the lines in the +browser. +<P>The second form sets the default text size to <TT>size</TT></P> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Button.html b/documentation/Fl_Button.html index 3ed301853..f0bb3fd67 100644 --- a/documentation/Fl_Button.html +++ b/documentation/Fl_Button.html @@ -1,176 +1,130 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Button">class Fl_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Button>class Fl_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Button</b> + +----<B>Fl_Button</B> | - +----<a href="#Fl_Check_Button">Fl_Check_Button</a>, <a href="#Fl_Light_Button">Fl_Light_Button</a>, <a href="#Fl_Repeat_Button">Fl_Repeat_Button</a>, - <a href="#Fl_Return_Button">Fl_Return_Button</a>, <a href="#Fl_Round_Button">Fl_Round_Button</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Button.H> -</pre></ul> - -<h3>Description</h3> - -<p>Buttons generate callbacks when they are clicked by the user. You -control exactly when and how by changing the values for <tt>type()</tt> and -<tt>when()</tt>. - -<p>Buttons can also generate callbacks in response to -<tt>FL_SHORTCUT</tt> events. The button can either have an explicit -<a href="#Fl_Button.shortcut"><tt>shortcut()</tt></a> value or a letter -shortcut can be indicated in the <tt>label()</tt> with an '&' character -before it. For the label shortcut it does not matter if <i>Alt</i> is -held down, but if you have an input field in the same window, the user -will have to hold down the <i>Alt</i> key so that the input field does -not eat the event first as an <tt>FL_KEYBOARD</tt> event. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Button.Fl_Button">Fl_Button</a> - <li><a href="#Fl_Button.~Fl_Button">~Fl_Button</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Button.clear">clear</a> - <li><a href="#Fl_Button.down_box">down_box</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Button.set">set</a> - <li><a href="#Fl_Button.setonly">setonly</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Button.shortcut">shortcut</a> - <li><a href="#Fl_Button.type">type</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Button.value">value</a> - <li><a href="#Fl_Button.when">when</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Button.Fl_Button">Fl_Button::Fl_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -The constructor creates the button using the position, size, and label. - -<h4><a name="Fl_Button.~Fl_Button">Fl_Button::~Fl_Button(void)</a></h4> - -The destructor removed the button. - -<h4><a name="Fl_Button.clear">int Fl_Button::clear()</a></h4> - -Same as <tt>value(0)</tt>. - -<h4><a name="Fl_Button.down_box">Fl_Boxtype Fl_Button::down_box() const<br> -void Fl_Button::down_box(Fl_Boxtype bt)</a></h4> - -The first form returns the current down box type, which is drawn when -<tt>value()</tt> is non-zero. - -<p>The second form sets the down box type. The default value of 0 -causes FLTK to figure out the correct matching down version of -<tt>box()</tt>. - -<h4><a name="Fl_Button.set">int Fl_Button::set()</a></h4> - -Same as <tt>value(1)</tt>. - -<h4><a name="Fl_Button.setonly">void Fl_Button::setonly()</a></h4> - -Turns on this button and turns off all other radio buttons in the -group (calling <tt>value(1)</tt> or <tt>set()</tt> does not do this). - -<h4><a name="Fl_Button.shortcut">ulong Fl_Button::shortcut() const<br> -void Fl_Button::shortcut(ulong key)</a></h4> - -The first form returns the current shortcut key for the button. - -<P>The second form sets the shortcut key to <tt>key</tt>. Setting this -overrides the use of '&' in the <tt>label()</tt>. The value is a -bitwise OR of a key and a set of shift flags, for example <code>FL_ALT -| 'a'</code>, <code>FL_ALT | (FL_F + 10)</code>, or just -<code>'a'</code>. A value of 0 disables the shortcut. - -<p>The key can be any value returned by <a href=#event_key><tt> -Fl::event_key()</tt></a>, but will usually be an ASCII letter. Use a -lower-case letter unless you require the shift key to be held down. - -<p>The shift flags can be any set of values accepted by -<a href=#event_state><tt>Fl::event_state()</tt></a>. If the bit is on -that shift key must be pushed. Meta, Alt, Ctrl, and Shift must be off -if they are not in the shift flags (zero for the other bits indicates -a "don't care" setting). - -<h4><a name="Fl_Button.type">uchar Fl_Button::type() const<br> -void Fl_Button::type(uchar t)</a></h4> - -The first form of <tt>type()</tt> returns the current button type, -which can be one of: - -<ul> - <li><code>0</code>: The value is unchanged. - - <li><code>FL_TOGGLE_BUTTON</code>: The value is inverted. - - <li><code>FL_RADIO_BUTTON</code>: The value is set to 1, and all - other buttons in the current group with - <code>type() == FL_RADIO_BUTTON</code> are set to zero. -</ul> - -The second form sets the button type to <tt>t</tt>. - -<h4><a name="Fl_Button.value">char Fl_Button::value() const<br> -int Fl_Button::value(int)</a></h4> - -The first form returns the current value (0 or 1). The second form sets -the current value. - -<h4><a name="Fl_Button.when">Fl_When Fl_Widget::when() const<br> -void Fl_Widget::when(Fl_When w)</a></h4> - -Controls when callbacks are done. The following values are useful, -the default value is <code>FL_WHEN_RELEASE</code>: - -<ul> - <li><code>0</code>: The callback is not done, instead changed() is - turned on. - - <li><code>FL_WHEN_RELEASE</code>: The callback is done after the user - successfully clicks the button, or when a shortcut is typed. - - <li><code>FL_WHEN_CHANGED </code>: The callback is done each time the - value() changes (when the user pushes and releases the button, and as - the mouse is dragged around in and out of the button). -</ul> - -</body> -</html> + +----<A href=Fl_Check_Button.html#Fl_Check_Button>Fl_Check_Button</A>, <A href=Fl_Light_Button.html#Fl_Light_Button>Fl_Light_Button</A>, <A href=Fl_Repeat_Button.html#Fl_Repeat_Button>Fl_Repeat_Button</A>, + <A href=Fl_Return_Button.html#Fl_Return_Button>Fl_Return_Button</A>, <A href=Fl_Round_Button.html#Fl_Round_Button>Fl_Round_Button</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Button.H> +</PRE> +</UL> +<H3>Description</H3> +<P>Buttons generate callbacks when they are clicked by the user. You +control exactly when and how by changing the values for <TT>type()</TT> + and <TT>when()</TT>. </P> +<P>Buttons can also generate callbacks in response to <TT>FL_SHORTCUT</TT> + events. The button can either have an explicit <A href=#Fl_Button.shortcut> +<TT>shortcut()</TT></A> value or a letter shortcut can be indicated in +the <TT>label()</TT> with an ''character before it. For the label +shortcut it does not matter if <I>Alt</I> is held down, but if you have +an input field in the same window, the user will have to hold down the <I> +Alt</I> key so that the input field does not eat the event first as an <TT> +FL_KEYBOARD</TT> event. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Button.Fl_Button>Fl_Button</A></LI> +<LI><A href=#Fl_Button.~Fl_Button>~Fl_Button</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Button.clear>clear</A></LI> +<LI><A href=#Fl_Button.down_box>down_box</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Button.set>set</A></LI> +<LI><A href=#Fl_Button.setonly>setonly</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Button.shortcut>shortcut</A></LI> +<LI><A href=#Fl_Button.type>type</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Button.value>value</A></LI> +<LI><A href=#Fl_Button.when>when</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Button.Fl_Button>Fl_Button::Fl_Button(int x, int y, int +w, int h, const char *label = 0)</A></H4> + The constructor creates the button using the position, size, and +label. +<H4><A name=Fl_Button.~Fl_Button>Fl_Button::~Fl_Button(void)</A></H4> + The destructor removed the button. +<H4><A name=Fl_Button.clear>int Fl_Button::clear()</A></H4> + Same as <TT>value(0)</TT>. +<H4><A name=Fl_Button.down_box>Fl_Boxtype Fl_Button::down_box() const +<BR> void Fl_Button::down_box(Fl_Boxtype bt)</A></H4> + The first form returns the current down box type, which is drawn when <TT> +value()</TT> is non-zero. +<P>The second form sets the down box type. The default value of 0 +causes FLTK to figure out the correct matching down version of <TT>box()</TT> +. </P> +<H4><A name=Fl_Button.set>int Fl_Button::set()</A></H4> + Same as <TT>value(1)</TT>. +<H4><A name=Fl_Button.setonly>void Fl_Button::setonly()</A></H4> + Turns on this button and turns off all other radio buttons in the +group (calling <TT>value(1)</TT> or <TT>set()</TT> does not do this). +<H4><A name=Fl_Button.shortcut>ulong Fl_Button::shortcut() const +<BR> void Fl_Button::shortcut(ulong key)</A></H4> + The first form returns the current shortcut key for the button. +<P>The second form sets the shortcut key to <TT>key</TT>. Setting this +overrides the use of ''in the <TT>label()</TT>. The value is a bitwise +OR of a key and a set of shift flags, for example <CODE>FL_ALT | 'a'</CODE> +, <CODE>FL_ALT | (FL_F + 10)</CODE>, or just <CODE>'a'</CODE>. A value +of 0 disables the shortcut. </P> +<P>The key can be any value returned by <A href=functions.html#event_key> +<TT>Fl::event_key()</TT></A>, but will usually be an ASCII letter. Use +a lower-case letter unless you require the shift key to be held down. </P> +<P>The shift flags can be any set of values accepted by <A href=events.html#event_state> +<TT>Fl::event_state()</TT></A>. If the bit is on that shift key must +be pushed. Meta, Alt, Ctrl, and Shift must be off if they are not in +the shift flags (zero for the other bits indicates a "don't care" +setting). </P> +<H4><A name=Fl_Button.type>uchar Fl_Button::type() const +<BR> void Fl_Button::type(uchar t)</A></H4> + The first form of <TT>type()</TT> returns the current button type, +which can be one of: +<UL> +<LI><CODE>0</CODE>: The value is unchanged. </LI> +<LI><CODE>FL_TOGGLE_BUTTON</CODE>: The value is inverted. </LI> +<LI><CODE>FL_RADIO_BUTTON</CODE>: The value is set to 1, and all other +buttons in the current group with <CODE>type() == FL_RADIO_BUTTON</CODE> + are set to zero. </LI> +</UL> + The second form sets the button type to <TT>t</TT>. +<H4><A name=Fl_Button.value>char Fl_Button::value() const +<BR> int Fl_Button::value(int)</A></H4> + The first form returns the current value (0 or 1). The second form +sets the current value. +<H4><A name=Fl_Button.when>Fl_When Fl_Widget::when() const +<BR> void Fl_Widget::when(Fl_When w)</A></H4> + Controls when callbacks are done. The following values are useful, +the default value is <CODE>FL_WHEN_RELEASE</CODE>: +<UL> +<LI><CODE>0</CODE>: The callback is not done, instead changed() is + turned on. </LI> +<LI><CODE>FL_WHEN_RELEASE</CODE>: The callback is done after the user + successfully clicks the button, or when a shortcut is typed. </LI> +<LI><CODE>FL_WHEN_CHANGED </CODE>: The callback is done each time the + value() changes (when the user pushes and releases the button, and as + the mouse is dragged around in and out of the button). </LI> +</UL> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Chart.html b/documentation/Fl_Chart.html index 5a9d527ab..83c6834eb 100644 --- a/documentation/Fl_Chart.html +++ b/documentation/Fl_Chart.html @@ -1,162 +1,119 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Chart">class Fl_Chart</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Chart>class Fl_Chart</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Chart</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Chart.H> -</pre></ul> - -<h3>Description</h3> - -This widget displays simple charts and is provided for forms compatibility. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Chart.Fl_Chart">Fl_Chart</a> - <li><a href="#Fl_Chart.~Fl_Chart">~Fl_Chart</a> - <li><a href="#Fl_Chart.add">add</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Chart.autosize">autosize</a> - <li><a href="#Fl_Chart.bounds">bounds</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Chart.clear">clear</a> - <li><a href="#Fl_Chart.insert">insert</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Chart.maxsize">maxsize</a> - <li><a href="#Fl_Chart.replace">replace</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Chart.size">size</a> - <li><a href="#Fl_Chart.type">type</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Chart.Fl_Chart">Fl_Chart::Fl_Chart(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Chart</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Chart.~Fl_Chart">virtual Fl_Chart::~Fl_Chart()</a></h4> - -Destroys the <tt>Fl_Chart</tt> widget and all of its data. - -<h4><a name="Fl_Chart.add">void add(double value, const char *label = NULL, uchar color = 0)</a></h4> - -The <tt>add</tt> method adds the <tt>value</tt> and optionally <tt>label</tt> -and <tt>color</tt> to the chart. - -<h4><a name="Fl_Chart.autosize">uchar autosize(void) const<br> -void autosize(uchar onoff)</a></h4> - -The <tt>autosize</tt> method controls whether or not the chart will -automatically adjust the bounds of the chart. The first form returns a -boolean value that is non-zero if auto-sizing is enabled and zero is auto-sizing -is disabled. - -<p>The second form of <tt>autosize</tt> sets the auto-sizing property to -<tt>onoff</tt>. - -<h4><a name="Fl_Chart.bounds">void bounds(double *a, double *b)<br> -void bounds(double a, double b)</a></h4> - -The <tt>bounds</tt> method gets or sets the lower and upper bounds of the chart -values to <tt>a</tt> and <tt>b</tt> respectively. - -<h4><a name="Fl_Chart.clear">void clear(void)</a></h4> - -The <tt>clear</tt> method removes all values from the chart. - -<h4><a name="Fl_Chart.insert">void insert(int pos, double value, const char *label = NULL, uchar color = 0)</a></h4> - -The <tt>insert</tt> method inserts a data value at the given position -<tt>pos</tt>. Position 0 is the first data value. - -<h4><a name="Fl_Chart.maxsize">int maxsize(void) const<br> -void maxsize(int n)</a></h4> - -The <tt>maxsize</tt> method gets or sets the maximum number of data values for -a chart. - -<h4><a name="Fl_Chart.replace">void replace(int pos, double value, const char *label = NULL, uchar color = 0)</a></h4> - -The <tt>replace</tt> method replaces data value <tt>pos</tt> with -<tt>value</tt>, <tt>label</tt>, and <tt>color</tt>. Position 0 is -the first data value. - -<h4><a name="Fl_Chart.size">int size(void) const</a></h4> - -The <tt>size</tt> method returns the number of data values in the chart. - -<h4><a name="Fl_Chart.type">uchar type() const<br> -void type(uchar t)</a></h4> - -The first form of <tt>type()</tt> returns the current chart type. -The chart type can be one of the following: - + +----<B>Fl_Chart</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Chart.H> +</PRE> +</UL> +<H3>Description</H3> + This widget displays simple charts and is provided for forms +compatibility. +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Chart.Fl_Chart>Fl_Chart</A></LI> +<LI><A href=#Fl_Chart.~Fl_Chart>~Fl_Chart</A></LI> +<LI><A href=#Fl_Chart.add>add</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Chart.autosize>autosize</A></LI> +<LI><A href=#Fl_Chart.bounds>bounds</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Chart.clear>clear</A></LI> +<LI><A href=#Fl_Chart.insert>insert</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Chart.maxsize>maxsize</A></LI> +<LI><A href=#Fl_Chart.replace>replace</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Chart.size>size</A></LI> +<LI><A href=#Fl_Chart.type>type</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Chart.Fl_Chart>Fl_Chart::Fl_Chart(int x, int y, int w, +int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Chart</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Chart.~Fl_Chart>virtual Fl_Chart::~Fl_Chart()</A></H4> + Destroys the <TT>Fl_Chart</TT> widget and all of its data. +<H4><A name=Fl_Chart.add>void add(double value, const char *label = +NULL, uchar color = 0)</A></H4> + The <TT>add</TT> method adds the <TT>value</TT> and optionally <TT> +label</TT> and <TT>color</TT> to the chart. +<H4><A name=Fl_Chart.autosize>uchar autosize(void) const +<BR> void autosize(uchar onoff)</A></H4> + The <TT>autosize</TT> method controls whether or not the chart will +automatically adjust the bounds of the chart. The first form returns a +boolean value that is non-zero if auto-sizing is enabled and zero is +auto-sizing is disabled. +<P>The second form of <TT>autosize</TT> sets the auto-sizing property +to <TT>onoff</TT>. </P> +<H4><A name=Fl_Chart.bounds>void bounds(double *a, double *b) +<BR> void bounds(double a, double b)</A></H4> + The <TT>bounds</TT> method gets or sets the lower and upper bounds of +the chart values to <TT>a</TT> and <TT>b</TT> respectively. +<H4><A name=Fl_Chart.clear>void clear(void)</A></H4> + The <TT>clear</TT> method removes all values from the chart. +<H4><A name=Fl_Chart.insert>void insert(int pos, double value, const +char *label = NULL, uchar color = 0)</A></H4> + The <TT>insert</TT> method inserts a data value at the given position <TT> +pos</TT>. Position 0 is the first data value. +<H4><A name=Fl_Chart.maxsize>int maxsize(void) const +<BR> void maxsize(int n)</A></H4> + The <TT>maxsize</TT> method gets or sets the maximum number of data +values for a chart. +<H4><A name=Fl_Chart.replace>void replace(int pos, double value, const +char *label = NULL, uchar color = 0)</A></H4> + The <TT>replace</TT> method replaces data value <TT>pos</TT> with <TT> +value</TT>, <TT>label</TT>, and <TT>color</TT>. Position 0 is the +first data value. +<H4><A name=Fl_Chart.size>int size(void) const</A></H4> + The <TT>size</TT> method returns the number of data values in the +chart. +<H4><A name=Fl_Chart.type>uchar type() const +<BR> void type(uchar t)</A></H4> + The first form of <TT>type()</TT> returns the current chart type. The +chart type can be one of the following: <DL> - <DT>FL_BAR_CHART</DT> - <DD>Each sample value is drawn as a vertical bar.</DD> - - <DT>FL_FILLED_CHART</DT> - <DD>The chart is filled from the bottom of the graph to the - sample values.</DD> - - <DT>FL_HORBAR_CHART</DT> - <DD>Each sample value is drawn as a horizontal bar.</DD> - - <DT>FL_LINE_CHART</DT> - <DD>The chart is drawn as a polyline with vertices at each - sample value.</DD> - - <DT>FL_PIE_CHART</DT> - <DD>A pie chart is drawn with each sample value being drawn - as a proportionate slice in the circle.</DD> - - <DT>FL_SPECIALPIE_CHART</DT> - <DD>Like FL_PIE_CHART, but the first slice is separated from - the pie.</DD> - - <DT>FL_SPIKE_CHART</DT> - <DD>Each sample value is drawn as a vertical line.</DD> +<DT>FL_BAR_CHART</DT> +<DD>Each sample value is drawn as a vertical bar.</DD> +<DT>FL_FILLED_CHART</DT> +<DD>The chart is filled from the bottom of the graph to the sample +values.</DD> +<DT>FL_HORBAR_CHART</DT> +<DD>Each sample value is drawn as a horizontal bar.</DD> +<DT>FL_LINE_CHART</DT> +<DD>The chart is drawn as a polyline with vertices at each sample +value.</DD> +<DT>FL_PIE_CHART</DT> +<DD>A pie chart is drawn with each sample value being drawn as a +proportionate slice in the circle.</DD> +<DT>FL_SPECIALPIE_CHART</DT> +<DD>Like FL_PIE_CHART, but the first slice is separated from the pie.</DD> +<DT>FL_SPIKE_CHART</DT> +<DD>Each sample value is drawn as a vertical line.</DD> </DL> - -The second form of <tt>type()</tt> sets the chart type to <tt>t</tt>. - -<center><img src="charts.gif" width=80%></center> - -</body> -</html> + The second form of <TT>type()</TT> sets the chart type to <TT>t</TT>. +<CENTER><IMG src=./charts.gif width=80%></CENTER> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Check_Button.html b/documentation/Fl_Check_Button.html index 14ac7f0eb..9b013ea2a 100644 --- a/documentation/Fl_Check_Button.html +++ b/documentation/Fl_Check_Button.html @@ -1,53 +1,40 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Check_Button">class Fl_Check_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Button">Fl_Button</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Check_Button>class Fl_Check_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Button.html#Fl_Button>Fl_Button</A> | - +----<b>Fl_Check_Button</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Check_Button.H> -</pre></ul> - -<h3>Description</h3> - -Buttons generate callbacks when they are clicked by the user. You -control exactly when and how by changing the values for <tt>type()</tt> and -<tt>when()</tt>. - -<P>The <tt>Fl_Check_Button</tt> subclass display the "on" state by -turning on a light, rather than drawing pushed in. The shape of the -"light" is initially set to FL_DIAMOND_DOWN_BOX. The color of the -light when on is controlled with <tt>selection_color()<tt>, which defaults to -FL_RED. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Check_Button.Fl_Check_Button">Fl_Check_Button</a> - <li><a href="#Fl_Check_Button.~Fl_Check_Button">~Fl_Check_Button</a> -</ul> - -<h4><a name="Fl_Check_Button.Fl_Check_Button">Fl_Check_Button::Fl_Check_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Check_Button</tt> widget using the given position, -size, and label string. - -<h4><a name="Fl_Check_Button.~Fl_Check_Button">Fl_Check_Button::~Fl_Check_Button()</a></h4> - -The destructor deletes the check button. - -</body> -</html> + +----<B>Fl_Check_Button</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Check_Button.H> +</PRE> +</UL> +<H3>Description</H3> + Buttons generate callbacks when they are clicked by the user. You +control exactly when and how by changing the values for <TT>type()</TT> + and <TT>when()</TT>. +<P>The <TT>Fl_Check_Button</TT> subclass display the "on" state by +turning on a light, rather than drawing pushed in. The shape of the +"light" is initially set to FL_DIAMOND_DOWN_BOX. The color of the +light when on is controlled with <TT>selection_color()<TT>, which +defaults to FL_RED. </TT></TT></P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Check_Button.Fl_Check_Button>Fl_Check_Button</A></LI> +<LI><A href=#Fl_Check_Button.~Fl_Check_Button>~Fl_Check_Button</A></LI> +</UL> +<H4><A name=Fl_Check_Button.Fl_Check_Button> +Fl_Check_Button::Fl_Check_Button(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Check_Button</TT> widget using the given +position, size, and label string. +<H4><A name=Fl_Check_Button.~Fl_Check_Button> +Fl_Check_Button::~Fl_Check_Button()</A></H4> + The destructor deletes the check button. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Choice.html b/documentation/Fl_Choice.html index 96b4337dc..e6f52706a 100644 --- a/documentation/Fl_Choice.html +++ b/documentation/Fl_Choice.html @@ -1,110 +1,80 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Choice">class Fl_Choice</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Menu_">Fl_Menu_</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Choice>class Fl_Choice</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Menu_.html#Fl_Menu_>Fl_Menu_</A> | - +----<b>Fl_Choice</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Choice.H> -</pre></ul> - -<h3>Description</h3> - -This is a button that when pushed pops up a menu (or hierarchy of -menus) defined by an array of <a href="#Fl_Menu_Item"><tt>Fl_Menu_Item</tt></a> -objects. Motif calls this an OptionButton. - -<p>The only difference between this and a <a href="#Fl_Menu_Button"> -<tt>Fl_Menu_Button</tt></a> is that the name of the most recent chosen -menu item is displayed inside the box, while the label is displayed -outside the box. However, since the use of this is most often to -control a single variable rather than do individual callbacks, some of -the <tt>Fl_Menu_Button</tt> methods are redescribed here in those terms. - -<P>When the user picks an item off the menu the <tt>value()</tt> is set -to that item and then the callback is done. - -<p>All three mouse buttons pop up the menu. The Forms behavior of the -first two buttons to increment/decrement the choice is not -implemented. This could be added with a subclass, however. - -<p>The menu will also pop up in response to shortcuts indicated by -putting a '&' character in the <tt>label()</tt>. See -<a href="#Fl_Button"><tt>Fl_Button</tt></a> for a description of this. - -<p>Typing the <tt>shortcut()</tt> of any of the items will do exactly -the same as when you pick the item with the mouse. The '&' character -in item names are only looked at when the menu is popped up, however. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Choice.Fl_Choice">Fl_Choice</a> - <li><a href="#Fl_Choice.~Fl_Choice">~Fl_Choice</a> - <li><a href="#Fl_Choice.clear_changed">clear_changed</a> - <li><a href="#Fl_Choice.changed">changed</a> - <li><a href="#Fl_Choice.down_box">down_box</a> - <li><a href="#Fl_Choice.set_changed">set_changed</a> - <li><a href="#Fl_Choice.value">value</a> -</ul> - -<h4><a name="Fl_Choice.Fl_Choice">Fl_Choice::Fl_Choice(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Choice</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_UP_BOX</tt>. - -<p>The constructor sets <tt>menu()</tt> to <tt>NULL</tt>. See <a -href="#Fl_Menu_"><tt>Fl_Menu_</tt></a> for the methods to set or change -the menu. - -<h4><a name="Fl_Choice.~Fl_Choice">virtual Fl_Choice::~Fl_Choice()</a></h4> - -The destructor removes the <tt>Fl_Choice</tt> widget and all of its menu items. - -<h4><a name="Fl_Choice.value">int Fl_Choice::value() const<br> -int Fl_Choice::value(int)<br> -int Fl_Choice::value(const Fl_Menu *)</a></h4> - -The value is the index into the <tt>Fl_Menu</tt> array of the last item chosen -by the user. It is zero initially. You can set it as an integer, or -set it with a pointer to a menu item. The set routines return -non-zero if the new value is different than the old one. Changing it -causes a <tt>redraw()</tt>. - -<h4><a name="Fl_Choice.changed">int Fl_Widget::changed() const</a></h4> - -This value is true if the user picks a different value. <i>It is -turned off by <tt>value()</tt> and just before doing a callback (the -callback can turn it back on if desired).</i> - -<h4><a name="Fl_Choice.set_changed">void Fl_Widget::set_changed()</a></h4> - -This method sets the <tt>changed()</tt> flag. - -<h4><a name="Fl_Choice.clear_changed">void Fl_Widget::clear_changed()</a></h4> - -This method clears the <tt>changed()</tt> flag. - -<h4><a name="Fl_Choice.down_box">Fl_Boxtype Fl_Choice::down_box() const<br> -void Fl_Choice::down_box(Fl_Boxtype b)</a></h4> - -The first form gets the current down box, which is used when the menu -is popped up. The default down box type is <tt>FL_DOWN_BOX</tt> - -The second form sets the current down box type to <tt>b</tt>. - -</body> -</html> + +----<B>Fl_Choice</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Choice.H> +</PRE> +</UL> +<H3>Description</H3> + This is a button that when pushed pops up a menu (or hierarchy of +menus) defined by an array of <A href=Fl_Menu_Item.html#Fl_Menu_Item><TT> +Fl_Menu_Item</TT></A> objects. Motif calls this an OptionButton. +<P>The only difference between this and a <A href=Fl_Menu_Button.html#Fl_Menu_Button> +<TT>Fl_Menu_Button</TT></A> is that the name of the most recent chosen +menu item is displayed inside the box, while the label is displayed +outside the box. However, since the use of this is most often to +control a single variable rather than do individual callbacks, some of +the <TT>Fl_Menu_Button</TT> methods are redescribed here in those +terms. </P> +<P>When the user picks an item off the menu the <TT>value()</TT> is set +to that item and then the callback is done. </P> +<P>All three mouse buttons pop up the menu. The Forms behavior of the +first two buttons to increment/decrement the choice is not implemented. + This could be added with a subclass, however. </P> +<P>The menu will also pop up in response to shortcuts indicated by +putting a ''character in the <TT>label()</TT>. See <A href=Fl_Button.html#Fl_Button> +<TT>Fl_Button</TT></A> for a description of this. </P> +<P>Typing the <TT>shortcut()</TT> of any of the items will do exactly +the same as when you pick the item with the mouse. The ''character in +item names are only looked at when the menu is popped up, however. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Choice.Fl_Choice>Fl_Choice</A></LI> +<LI><A href=#Fl_Choice.~Fl_Choice>~Fl_Choice</A></LI> +<LI><A href=#Fl_Choice.clear_changed>clear_changed</A></LI> +<LI><A href=#Fl_Choice.changed>changed</A></LI> +<LI><A href=#Fl_Choice.down_box>down_box</A></LI> +<LI><A href=#Fl_Choice.set_changed>set_changed</A></LI> +<LI><A href=#Fl_Choice.value>value</A></LI> +</UL> +<H4><A name=Fl_Choice.Fl_Choice>Fl_Choice::Fl_Choice(int x, int y, int +w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Choice</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_UP_BOX</TT>. +<P>The constructor sets <TT>menu()</TT> to <TT>NULL</TT>. See <A href=Fl_Menu_.html#Fl_Menu_> +<TT>Fl_Menu_</TT></A> for the methods to set or change the menu. </P> +<H4><A name=Fl_Choice.~Fl_Choice>virtual Fl_Choice::~Fl_Choice()</A></H4> + The destructor removes the <TT>Fl_Choice</TT> widget and all of its +menu items. +<H4><A name=Fl_Choice.value>int Fl_Choice::value() const +<BR> int Fl_Choice::value(int) +<BR> int Fl_Choice::value(const Fl_Menu *)</A></H4> + The value is the index into the <TT>Fl_Menu</TT> array of the last +item chosen by the user. It is zero initially. You can set it as an +integer, or set it with a pointer to a menu item. The set routines +return non-zero if the new value is different than the old one. + Changing it causes a <TT>redraw()</TT>. +<H4><A name=Fl_Choice.changed>int Fl_Widget::changed() const</A></H4> + This value is true if the user picks a different value. <I>It is +turned off by <TT>value()</TT> and just before doing a callback (the +callback can turn it back on if desired).</I> +<H4><A name=Fl_Choice.set_changed>void Fl_Widget::set_changed()</A></H4> + This method sets the <TT>changed()</TT> flag. +<H4><A name=Fl_Choice.clear_changed>void Fl_Widget::clear_changed()</A></H4> + This method clears the <TT>changed()</TT> flag. +<H4><A name=Fl_Choice.down_box>Fl_Boxtype Fl_Choice::down_box() const +<BR> void Fl_Choice::down_box(Fl_Boxtype b)</A></H4> + The first form gets the current down box, which is used when the menu +is popped up. The default down box type is <TT>FL_DOWN_BOX</TT> The +second form sets the current down box type to <TT>b</TT>. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Clock.html b/documentation/Fl_Clock.html index e1da8a9e9..0ddb2a10b 100644 --- a/documentation/Fl_Clock.html +++ b/documentation/Fl_Clock.html @@ -1,78 +1,56 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Clock">class Fl_Clock</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Clock>class Fl_Clock</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Clock</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Clock.H> -</pre></ul> - -<h3>Description</h3> - -This widget provides a round analog clock display and is provided for -Forms compatibility. It installs a 1-second timeout callback using -<a href="#add_timeout"><tt>Fl::add_timeout()</tt></a>. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Clock.Fl_Clock">Fl_Clock</a> - <li><a href="#Fl_Clock.~Fl_Clock">~Fl_Clock</a> - <li><a href="#Fl_Clock.hour">hour</a> - <li><a href="#Fl_Clock.minute">minute</a> - <li><a href="#Fl_Clock.second">second</a> - <li><a href="#Fl_Clock.value">value</a> -</ul> - -<h4><a name="Fl_Clock.Fl_Clock">Fl_Clock::Fl_Clock(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Clock</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Clock.~Fl_Clock">virtual Fl_Clock::~Fl_Clock()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Clock</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Clock</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Clock.hour">int Fl_Clock::hour() const</a></h4> - -Returns the current hour (0 to 23). - -<h4><a name="Fl_Clock.minute">int Fl_Clock::minute() const</a></h4> - -Returns the current minute (0 to 59). - -<h4><a name="Fl_Clock.second">int Fl_Clock::second() const</a></h4> - -Returns the current second (0 to 60, 60 = leap second). - -<h4><a name="Fl_Clock.value">void Fl_Clock::value(ulong v)<br> -void Fl_Clock::value(int h, int m, int s)<br> -ulong Fl_Clock::value(void)</a></h4> - -The first two forms of <tt>value</tt> set the displayed time to the given -UNIX time value or specific hours, minutes, and seconds. - -<p>The third form of <tt>value</tt> returns the displayed time in seconds -since the UNIX epoch (January 1, 1970). - -</body> -</html> + +----<B>Fl_Clock</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Clock.H> +</PRE> +</UL> +<H3>Description</H3> + This widget provides a round analog clock display and is provided for +Forms compatibility. It installs a 1-second timeout callback using <A href=functions.html#add_timeout> +<TT>Fl::add_timeout()</TT></A>. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Clock.Fl_Clock>Fl_Clock</A></LI> +<LI><A href=#Fl_Clock.~Fl_Clock>~Fl_Clock</A></LI> +<LI><A href=#Fl_Clock.hour>hour</A></LI> +<LI><A href=#Fl_Clock.minute>minute</A></LI> +<LI><A href=#Fl_Clock.second>second</A></LI> +<LI><A href=#Fl_Clock.value>value</A></LI> +</UL> +<H4><A name=Fl_Clock.Fl_Clock>Fl_Clock::Fl_Clock(int x, int y, int w, +int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Clock</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Clock.~Fl_Clock>virtual Fl_Clock::~Fl_Clock()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Clock</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Clock</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Clock.hour>int Fl_Clock::hour() const</A></H4> + Returns the current hour (0 to 23). +<H4><A name=Fl_Clock.minute>int Fl_Clock::minute() const</A></H4> + Returns the current minute (0 to 59). +<H4><A name=Fl_Clock.second>int Fl_Clock::second() const</A></H4> + Returns the current second (0 to 60, 60 = leap second). +<H4><A name=Fl_Clock.value>void Fl_Clock::value(ulong v) +<BR> void Fl_Clock::value(int h, int m, int s) +<BR> ulong Fl_Clock::value(void)</A></H4> + The first two forms of <TT>value</TT> set the displayed time to the +given UNIX time value or specific hours, minutes, and seconds. +<P>The third form of <TT>value</TT> returns the displayed time in +seconds since the UNIX epoch (January 1, 1970). </P> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Color_Chooser.html b/documentation/Fl_Color_Chooser.html index 5f9a0ed53..26b798c6b 100644 --- a/documentation/Fl_Color_Chooser.html +++ b/documentation/Fl_Color_Chooser.html @@ -1,103 +1,78 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Color_Chooser">class Fl_Color_Chooser</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Group">Fl_Group</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Color_Chooser>class Fl_Color_Chooser</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Group.html#Fl_Group>Fl_Group</A> | - +----<b>Fl_Color_Chooser</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Color_Chooser.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Color_Chooser</tt> widget provides a standard RGB color -chooser. You can place any number of these into a panel of your own -design. This widget contains the hue box, value slider, and rgb input -fields from the above diagram (it does not have the color chips or the -Cancel or OK buttons). The callback is done every time the user -changes the rgb value. It is not done if they move the hue control in -a way that produces the <i>same</i> rgb value, such as when saturation -or value is zero. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Color_Chooser.Fl_Color_Chooser">Fl_Color_Chooser</a> - <li><a href="#Fl_Color_Chooser.~Fl_Color_Chooser">~Fl_Color_Chooser</a> - <li><a href="#Fl_Color_Chooser.add">add</a> -</ul> - -<h4><a name="Fl_Color_Chooser.Fl_Color_Chooser">Fl_Color_Chooser::Fl_Color_Chooser(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Color_Chooser</tt> widget using the given -position, size, and label string. The recommended dimensions are -200x95. The color is initialized to black. - -<h4><a name="Fl_Color_Chooser.~Fl_Color_Chooser">virtual Fl_Color_Chooser::~Fl_Color_Chooser()</a></h4> - -The destructor removes the color chooser and all of its controls. - -<h4><a name="Fl_Color_Chooser.hue">double Fl_Color_Chooser::hue() const</a></h4> - -Return the current hue. 0 <= hue < 6. Zero is red, one is -yellow, two is green, etc. <i>This value is convienent for the internal -calculations - some other systems consider hue to run from zero to -one, or from 0 to 360.</i> - -<h4><a name="Fl_Color_Chooser.saturation">double Fl_Color_Chooser::saturation() const</a></h4> - -Returns the saturation. 0 <= saturation <= 1. - -<h4><a name="Fl_Color_Chooser.value">double Fl_Color_Chooser::value() const</a></h4> - -Returns the value/brightness. 0 <= value <= 1. - -<h4><a name="Fl_Color_Chooser.r">double Fl_Color_Chooser::r() const</a></h4> - -Returns the current red value. 0 <= r <= 1. - -<h4><a name="Fl_Color_Chooser.g">double Fl_Color_Chooser::g() const</a></h4> - -Returns the current green value. 0 <= g <= 1. - -<h4><a name="Fl_Color_Chooser.b">double Fl_Color_Chooser::b() const</a></h4> - -Returns the current blue value. 0 <= b <= 1. - -<h4><a name="Fl_Color_Chooser.rgb">int Fl_Color_Chooser::rgb(double, double, -double)</a></h4> - -Sets the current rgb color values. Does not do the callback. Does -not clamp (but out of range values will produce psychedelic effects in -the hue selector). - -<h4><a name="Fl_Color_Chooser.hsv">int Fl_Color_Chooser::hsv(double,double,double)</a></h4> - -Set the hsv values. The passed values are clamped (or for hue, -modulus 6 is used) to get legal values. Does not do the callback. - -<h4><a name="Fl_Color_Chooser.hsv2rgb">static void Fl_Color_Chooser::hsv2rgb(double, double, -double, double&, double&, double&)</a></h4> - -This <i>static</i> method converts HSV colors to RGB colorspace. - -<h4><a name="Fl_Color_Chooser.rgb2hsv">static void Fl_Color_Chooser::rgb2hsv(double, double, double, double&, -double&, double&)</a></h4> - -This <i>static</i> method converts RGB colors to HSV colorspace. - -</body> -</html> + +----<B>Fl_Color_Chooser</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Color_Chooser.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Color_Chooser</TT> widget provides a standard RGB color +chooser. You can place any number of these into a panel of your own +design. This widget contains the hue box, value slider, and rgb input +fields from the above diagram (it does not have the color chips or the +Cancel or OK buttons). The callback is done every time the user +changes the rgb value. It is not done if they move the hue control in +a way that produces the <I>same</I> rgb value, such as when saturation +or value is zero. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Color_Chooser.Fl_Color_Chooser>Fl_Color_Chooser</A></LI> +<LI><A href=#Fl_Color_Chooser.~Fl_Color_Chooser>~Fl_Color_Chooser</A></LI> +<LI><A href=#Fl_Color_Chooser.add>add</A></LI> +</UL> +<H4><A name=Fl_Color_Chooser.Fl_Color_Chooser> +Fl_Color_Chooser::Fl_Color_Chooser(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Color_Chooser</TT> widget using the given +position, size, and label string. The recommended dimensions are +200x95. The color is initialized to black. +<H4><A name=Fl_Color_Chooser.~Fl_Color_Chooser>virtual +Fl_Color_Chooser::~Fl_Color_Chooser()</A></H4> + The destructor removes the color chooser and all of its controls. +<H4><A name=Fl_Color_Chooser.hue>double Fl_Color_Chooser::hue() const</A> +</H4> + Return the current hue. 0 <= hue < 6. Zero is red, one is yellow, +two is green, etc. <I>This value is convienent for the internal +calculations - some other systems consider hue to run from zero to one, +or from 0 to 360.</I> +<H4><A name=Fl_Color_Chooser.saturation>double +Fl_Color_Chooser::saturation() const</A></H4> + Returns the saturation. 0 <= saturation <= 1. +<H4><A name=Fl_Color_Chooser.value>double Fl_Color_Chooser::value() +const</A></H4> + Returns the value/brightness. 0 <= value <= 1. +<H4><A name=Fl_Color_Chooser.r>double Fl_Color_Chooser::r() const</A></H4> + Returns the current red value. 0 <= r <= 1. +<H4><A name=Fl_Color_Chooser.g>double Fl_Color_Chooser::g() const</A></H4> + Returns the current green value. 0 <= g <= 1. +<H4><A name=Fl_Color_Chooser.b>double Fl_Color_Chooser::b() const</A></H4> + Returns the current blue value. 0 <= b <= 1. +<H4><A name=Fl_Color_Chooser.rgb>int Fl_Color_Chooser::rgb(double, +double, double)</A></H4> + Sets the current rgb color values. Does not do the callback. Does +not clamp (but out of range values will produce psychedelic effects in +the hue selector). +<H4><A name=Fl_Color_Chooser.hsv>int +Fl_Color_Chooser::hsv(double,double,double)</A></H4> + Set the hsv values. The passed values are clamped (or for hue, +modulus 6 is used) to get legal values. Does not do the callback. +<H4><A name=Fl_Color_Chooser.hsv2rgb>static void +Fl_Color_Chooser::hsv2rgb(double, double, double, double&, double&, +double&)</A></H4> + This <I>static</I> method converts HSV colors to RGB colorspace. +<H4><A name=Fl_Color_Chooser.rgb2hsv>static void +Fl_Color_Chooser::rgb2hsv(double, double, double, double&, double&, +double&)</A></H4> + This <I>static</I> method converts RGB colors to HSV colorspace. </BODY> +</HTML>
\ No newline at end of file diff --git a/documentation/Fl_Counter.html b/documentation/Fl_Counter.html index 42551fefa..d7832f9c2 100644 --- a/documentation/Fl_Counter.html +++ b/documentation/Fl_Counter.html @@ -1,66 +1,47 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Counter">class Fl_Counter</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Counter>class Fl_Counter</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Counter</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Counter.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Counter</tt> widget is provided for forms compatibility. It -controls a single floating point value. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Counter.Fl_Counter">Fl_Counter</a> - <li><a href="#Fl_Counter.~Fl_Counter">~Fl_Counter</a> - <li><a href="#Fl_Counter.lstep">lstep</a> - <li><a href="#Fl_Counter.type">type</a> -</ul> - -<h4><a name="Fl_Counter.Fl_Counter">Fl_Counter::Fl_Counter(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Counter</tt> widget using the given position, size, and -label string. The default type is <tt>FL_NORMAL_COUNTER</tt>. - -<h4><a name="Fl_Counter.~Fl_Counter">virtual Fl_Counter::~Fl_Counter()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Counter.lstep">double Fl_Counter::lstep() const<br> -void Fl_Counter::lstep(double)</a></h4> - -Get or set the increment for the double-arrow buttons. The default -value is 1.0. - -<h4><a name="Fl_Counter.type">type(uchar)</a></h4> - -Sets the type of counter: - -<ul> - <li><tt>FL_NORMAL_COUNTER</tt> - Displays a counter with 4 arrow - buttons. - - <li><tt>FL_SIMPLE_COUNTER</tt> - Displays a counter with only 2 - arrow buttons. -</ul> - -</body> -</html> + +----<B>Fl_Counter</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Counter.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Counter</TT> widget is provided for forms compatibility. + It controls a single floating point value. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Counter.Fl_Counter>Fl_Counter</A></LI> +<LI><A href=#Fl_Counter.~Fl_Counter>~Fl_Counter</A></LI> +<LI><A href=#Fl_Counter.lstep>lstep</A></LI> +<LI><A href=#Fl_Counter.type>type</A></LI> +</UL> +<H4><A name=Fl_Counter.Fl_Counter>Fl_Counter::Fl_Counter(int x, int y, +int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Counter</TT> widget using the given position, +size, and label string. The default type is <TT>FL_NORMAL_COUNTER</TT>. +<H4><A name=Fl_Counter.~Fl_Counter>virtual Fl_Counter::~Fl_Counter()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Counter.lstep>double Fl_Counter::lstep() const +<BR> void Fl_Counter::lstep(double)</A></H4> + Get or set the increment for the double-arrow buttons. The default +value is 1.0. +<H4><A name=Fl_Counter.type>type(uchar)</A></H4> + Sets the type of counter: +<UL> +<LI><TT>FL_NORMAL_COUNTER</TT> - Displays a counter with 4 arrow + buttons. </LI> +<LI><TT>FL_SIMPLE_COUNTER</TT> - Displays a counter with only 2 arrow +buttons. </LI> +</UL> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Dial.html b/documentation/Fl_Dial.html index 2e732440a..ff70b6db1 100644 --- a/documentation/Fl_Dial.html +++ b/documentation/Fl_Dial.html @@ -1,65 +1,45 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Dial">class Fl_Dial</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Dial>class Fl_Dial</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Dial</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Dial.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Dial</tt> widget provides a circular dial to control a -single floating point value. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Dial.Fl_Dial">Fl_Dial</a> - <li><a href="#Fl_Dial.~Fl_Dial">~Fl_Dial</a> - <li><a href="#Fl_Dial.angles">angles</a> - <li><a href="#Fl_Dial.type">type</a> -</ul> - -<h4><a name="Fl_Dial.Fl_Dial">Fl_Dial::Fl_Dial(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Dial</tt> widget using the given position, size, and -label string. The default type is <tt>FL_NORMAL_DIAL</tt>. - -<h4><a name="Fl_Dial.~Fl_Dial">virtual Fl_Dial::~Fl_Dial()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Dial.angles">void Fl_Dial::angles(short a, short b)</a></h4> - -Sets the angles used for the minimum and maximum values. By default these -are 0 and 360, respectively. - -<h4><a name="Fl_Dial.type">type(uchar)</a></h4> - -Sets the type of the dial to: - -<ul> - <li><tt>FL_NORMAL_DIAL</tt> - Draws a normal dial with a knob. - - <li><tt>FL_LINE_DIAL</tt> - Draws a dial with a line. - - <li><tt>FL_FILL_DIAL</tt> - Draws a dial with a filled arc. -</tt> - -</body> -</html> + +----<B>Fl_Dial</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Dial.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Dial</TT> widget provides a circular dial to control a +single floating point value. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Dial.Fl_Dial>Fl_Dial</A></LI> +<LI><A href=#Fl_Dial.~Fl_Dial>~Fl_Dial</A></LI> +<LI><A href=#Fl_Dial.angles>angles</A></LI> +<LI><A href=#Fl_Dial.type>type</A></LI> +</UL> +<H4><A name=Fl_Dial.Fl_Dial>Fl_Dial::Fl_Dial(int x, int y, int w, int +h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Dial</TT> widget using the given position, size, +and label string. The default type is <TT>FL_NORMAL_DIAL</TT>. +<H4><A name=Fl_Dial.~Fl_Dial>virtual Fl_Dial::~Fl_Dial()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Dial.angles>void Fl_Dial::angles(short a, short b)</A></H4> + Sets the angles used for the minimum and maximum values. By default +these are 0 and 360, respectively. +<H4><A name=Fl_Dial.type>type(uchar)</A></H4> + Sets the type of the dial to: +<UL> +<LI><TT>FL_NORMAL_DIAL</TT> - Draws a normal dial with a knob. </LI> +<LI><TT>FL_LINE_DIAL</TT> - Draws a dial with a line. </LI> +<LI><TT>FL_FILL_DIAL</TT> - Draws a dial with a filled arc. </LI> +</UL> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Double_Window.html b/documentation/Fl_Double_Window.html index 9018b850c..ffe154f76 100644 --- a/documentation/Fl_Double_Window.html +++ b/documentation/Fl_Double_Window.html @@ -1,66 +1,58 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Double_Window">class Fl_Double_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Window">Fl_Window</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Double_Window>class Fl_Double_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Window.html#Fl_Window>Fl_Window</A> | - +----<b>Fl_Double_Window</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Double_Window.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Double_Window</tt> class provides a double-buffered window. -If possible this will use the X double buffering extension (Xdbe). If -not, it will draw the window data into an off-screen pixmap, and then -copy it to the on-screen window. - -<p>It is highly recommended that you put the following code before the -first <tt>show()</tt> of <i>any</i> window in your program: - -<ul><pre> + +----<B>Fl_Double_Window</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Double_Window.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Double_Window</TT> class provides a double-buffered window. + If possible this will use the X double buffering extension (Xdbe). If +not, it will draw the window data into an off-screen pixmap, and then +copy it to the on-screen window. +<P>It is highly recommended that you put the following code before the +first <TT>show()</TT> of <I>any</I> window in your program: </P> +<UL> +<PRE> Fl::visual(FL_DOUBLE|FL_INDEX) -</pre></ul> - -This makes sure you can use Xdbe on servers where double buffering does -not exist for every visual. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Double_Window.Fl_Double_Window">Fl_Double_Window</a> - <li><a href="#Fl_Double_Window.~Fl_Double_Window">~Fl_Double_Window</a> - <li><a href="#Fl_Double_Window.pixmap">pixmap</a> -</ul> - -<h4><a name="Fl_Double_Window.Fl_Double_Window">Fl_Double_Window::Fl_Double_Window(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Double_Window</tt> widget using the given position, size, and -label (title) string. - -<h4><a name="Fl_Double_Window.~Fl_Double_Window">virtual Fl_Double_Window::~Fl_Double_Window()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. - -<h4><a name="Fl_Double_Window.pixmap>ulong Fl_Double_Window::pixmap() const</a></h4> +</PRE> +</UL> + This makes sure you can use Xdbe on servers where double buffering +does not exist for every visual. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Double_Window.Fl_Double_Window>Fl_Double_Window</A></LI> +<LI><A href=#Fl_Double_Window.~Fl_Double_Window>~Fl_Double_Window</A></LI> +<LI><A href=#Fl_Double_Window.pixmap>pixmap</A></LI> +</UL> +<H4><A name=Fl_Double_Window.Fl_Double_Window> +Fl_Double_Window::Fl_Double_Window(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Double_Window</TT> widget using the given +position, size, and label (title) string. +<H4><A name=Fl_Double_Window.~Fl_Double_Window>virtual +Fl_Double_Window::~Fl_Double_Window()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. +<H4><A name="Fl_Double_Window.pixmap>ulong Fl_Double_Window::pixmap() const</a></h4> Returns the off-screen pixmap or back buffer. This value is zero until the first time <tt>flush()</tt> is called. </body> </html> +"> +</H4> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_End.html b/documentation/Fl_End.html index 7c21a8db2..75597f35f 100644 --- a/documentation/Fl_End.html +++ b/documentation/Fl_End.html @@ -1,29 +1,24 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_End">class Fl_End</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Group">Fl_Group</a>----<b>Fl_End</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Group.H> -</pre></ul> - -<h3>Description</h3> - -This is a dummy class that allows you to end a group in a constructor list of a class: - -<ul><pre>class MyClass { +<HTML><BODY> +<HR break> +<H2><A name=Fl_End>class Fl_End</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Group.html#Fl_Group>Fl_Group</A>----<B>Fl_End</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Group.H> +</PRE> +</UL> +<H3>Description</H3> + This is a dummy class that allows you to end a group in a constructor +list of a class: +<UL> +<PRE>class MyClass { Fl_Group group; Fl_Button button_in_group; Fl_End end; @@ -35,17 +30,11 @@ MyClass::MyClass() : button_in_group(20,20,60,30), end(), button_outside_group(10,120,60,30) -{}</pre></ul> - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_End.Fl_End">Fl_End</a> -</ul> - -<h4><a name="Fl_End.Fl_End">Fl_End::Fl_End</a></h4> - -The constructor does <tt>Fl_Group::current()->end()</tt>. - -</body> -</html> +{}</PRE> +</UL> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_End.Fl_End>Fl_End</A></LI> +</UL> +<H4><A name=Fl_End.Fl_End>Fl_End::Fl_End</A></H4> + The constructor does <TT>Fl_Group::current()->end()</TT>. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Float_Input.html b/documentation/Fl_Float_Input.html index ef005b4a8..fe52eadfe 100644 --- a/documentation/Fl_Float_Input.html +++ b/documentation/Fl_Float_Input.html @@ -1,47 +1,35 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Float_Input">class Fl_Float_Input</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Input">Fl_Input</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Float_Input>class Fl_Float_Input</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=functions.html#Fl_Input>Fl_Input</A> | - +----<b>Fl_Float_Input</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Input.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Float_Input</tt> class is a subclass of <tt>Fl_Input</tt> that -displays its input in red when the value string is not a legal floating point -value. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Float_Input.Fl_Float_Input">Fl_Float_Input</a> - <li><a href="#Fl_Float_Input.~Fl_Float_Input">~Fl_Float_Input</a> -</ul> - -<h4><a name="Fl_Float_Input.Fl_Float_Input">Fl_Float_Input::Fl_Float_Input(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Float_Input</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Float_Input.~Fl_Float_Input">virtual Fl_Float_Input::~Fl_Float_Input()</a></h4> - -Destroys the widget and any value associated with it. - -</body> -</html> + +----<B>Fl_Float_Input</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Input.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Float_Input</TT> class is a subclass of <TT>Fl_Input</TT> + that displays its input in red when the value string is not a legal +floating point value. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Float_Input.Fl_Float_Input>Fl_Float_Input</A></LI> +<LI><A href=#Fl_Float_Input.~Fl_Float_Input>~Fl_Float_Input</A></LI> +</UL> +<H4><A name=Fl_Float_Input.Fl_Float_Input> +Fl_Float_Input::Fl_Float_Input(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Float_Input</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>. +<H4><A name=Fl_Float_Input.~Fl_Float_Input>virtual +Fl_Float_Input::~Fl_Float_Input()</A></H4> + Destroys the widget and any value associated with it. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Free.html b/documentation/Fl_Free.html index 55616cb30..c444faebe 100644 --- a/documentation/Fl_Free.html +++ b/documentation/Fl_Free.html @@ -1,74 +1,65 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Free">class Fl_Free</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Free>class Fl_Free</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Free</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Free.H> -</pre></ul> - -<h3>Description</h3> - -Emulation of the Forms "free" widget. This emulation allows the free -demo to run, and appears to be useful for porting programs written in -Forms which use the free widget or make subclasses of the Forms widgets. - -<p>There are five types of free, which determine when the handle -function is called: - -<ul><pre> + +----<B>Fl_Free</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Free.H> +</PRE> +</UL> +<H3>Description</H3> + Emulation of the Forms "free" widget. This emulation allows the free +demo to run, and appears to be useful for porting programs written in +Forms which use the free widget or make subclasses of the Forms +widgets. +<P>There are five types of free, which determine when the handle +function is called: </P> +<UL> +<PRE> #define FL_NORMAL_FREE 1 #define FL_SLEEPING_FREE 2 #define FL_INPUT_FREE 3 #define FL_CONTINUOUS_FREE 4 #define FL_ALL_FREE 5 -</pre></ul> - -<p>An FL_INPUT_FREE accepts FL_FOCUS events. A FL_CONTINUOUS_FREE -sets a timeout callback 100 times a second and provides a FL_STEP -event, this has obvious detrimental effects on machine performance. -FL_ALL_FREE does both. FL_SLEEPING_FREE are deactivated. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Free.Fl_Free">Fl_Free</a> - <li><a href="#Fl_Free.~Fl_Free">~Fl_Free</a> -</ul> - -<h4><a name="Fl_Free.Fl_Free">Fl_Free(uchar type, int, int, int, int, const char*l, FL_HANDLEPTR hdl)</a></h4> - -The constructor takes both the <tt>type</tt> and the <tt>handle</tt> function. -The handle function should be declared as follows: - -<ul><pre> +</PRE> +</UL> +<P>An FL_INPUT_FREE accepts FL_FOCUS events. A FL_CONTINUOUS_FREE sets +a timeout callback 100 times a second and provides a FL_STEP event, +this has obvious detrimental effects on machine performance. +FL_ALL_FREE does both. FL_SLEEPING_FREE are deactivated. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Free.Fl_Free>Fl_Free</A></LI> +<LI><A href=#Fl_Free.~Fl_Free>~Fl_Free</A></LI> +</UL> +<H4><A name=Fl_Free.Fl_Free>Fl_Free(uchar type, int, int, int, int, +const char*l, FL_HANDLEPTR hdl)</A></H4> + The constructor takes both the <TT>type</TT> and the <TT>handle</TT> + function. The handle function should be declared as follows: +<UL> +<PRE> int handle_function(Fl_Widget *w, int event, float event_x, float event_y, char key) -</pre></ul> - -This function is called from the the <tt>handle()</tt> method in -response to most events, and is called by the <tt>draw()</tt> method. -The <tt>event</tt> argument contains the event type: - -<ul><pre> +</PRE> +</UL> + This function is called from the the <TT>handle()</TT> method in +response to most events, and is called by the <TT>draw()</TT> method. +The <TT>event</TT> argument contains the event type: +<UL> +<PRE> // old event names for compatability: #define FL_MOUSE FL_DRAG #define FL_DRAW 0 @@ -76,12 +67,8 @@ The <tt>event</tt> argument contains the event type: #define FL_FREEMEM 12 #define FL_FREEZE FL_UNMAP #define FL_THAW FL_MAP -</pre></ul> - -<h4><a name="Fl_Free.~Fl_Free">virtual Fl_Free::~Fl_Free()</a></h4> - -The destructor will call the handle function with the event -<tt>FL_FREE_MEM</tt>. - -</body> -</html> +</PRE> +</UL> +<H4><A name=Fl_Free.~Fl_Free>virtual Fl_Free::~Fl_Free()</A></H4> + The destructor will call the handle function with the event <TT> +FL_FREE_MEM</TT>. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Gl_Window.html b/documentation/Fl_Gl_Window.html index 47828b47c..205d3225c 100644 --- a/documentation/Fl_Gl_Window.html +++ b/documentation/Fl_Gl_Window.html @@ -1,166 +1,134 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Gl_Window">class Fl_Gl_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Gl_Window>class Fl_Gl_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Gl_Window</b> + +----<B>Fl_Gl_Window</B> | - +----<a href="#Fl_Pack">Fl_Pack</a>, <a href="#Fl_Scroll">Fl_Scroll</a>, <a href="#Fl_Tabs">Fl_Tabs</a>, <a href="#Fl_Tile">Fl_Tile</a>, <a href="#Fl_Window">Fl_Window</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Gl_Window.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Gl_Window</tt> widget sets things up so OpenGL works, and -also keeps an OpenGL "context" for that window, so that changes to the -lighting and projection may be reused between redraws. -</tt>Fl_Gl_Window</tt> also flushes the OpenGL streams and swaps -buffers after <tt>draw()</tt> returns. - -<p>OpenGL hardware typically provides some overlay bit planes, which -are very useful for drawing UI controls atop your 3D graphics. If the -overlay hardware is not provided, FLTK tries to simulate the overlay, -This works pretty well if your graphics are double buffered, but not -very well for single-buffered. - -<h3>Methods</h3> - - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Gl_Window.Fl_Gl_Window">Fl_Gl_Window</a> - <li><a href="#Fl_Gl_Window.~Fl_Gl_Window">~Fl_Gl_Window</a> - <li><a href="#Fl_Gl_Window.can_do">can_do</a> - <li><a href="#Fl_Gl_Window.can_do_overlay">can_do_overlay</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Gl_Window.draw">draw</a> - <li><a href="#Fl_Gl_Window.draw_overlay">draw_overlay</a> - <li><a href="#Fl_Gl_Window.handle">handle</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Gl_Window.hide">hide</a> - <li><a href="#Fl_Gl_Window.invalidate">invalidate</a> - <li><a href="#Fl_Gl_Window.make_current">make_current</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Gl_Window.make_overlay_current">make_overlay_current</a> - <li><a href="#Fl_Gl_Window.mode">mode</a> - <li><a href="#Fl_Gl_Window.ortho">ortho</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Gl_Window.redraw_overlay">redraw_overlay</a> - <li><a href="#Fl_Gl_Window.swap_buffers">swap_buffers</a> - <li><a href="#Fl_Gl_Window.valid">valid</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Gl_Window.Fl_Gl_Window">Fl_Gl_Window::Fl_Gl_Window(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Gl_Window</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. The default mode is -<tt>FL_RGB|FL_DOUBLE|FL_DEPTH</tt>. - -<h4><a name="Fl_Gl_Window.~Fl_Gl_Window">virtual Fl_Gl_Window::~Fl_Gl_Window()</a></h4> - -The destructor removes the widget and destroys the OpenGL context associated -with it. - -<h4><a name="Fl_Gl_Window.draw">virtual void Fl_Gl_Window::draw(void)</a></h4> - -<tt>Fl_Gl_Window::draw()</tt> is a pure virtual method. You must -subclass <tt>Fl_Gl_Window</tt> and provide an implementation for -<tt>draw()</tt>. You may also provide an implementation of -draw_overlay() if you want to draw into the overlay planes. You can -avoid reinitializing the viewport and lights and other things by -checking <tt>valid()</tt> at the start of <tt>draw()</tt> and only -doing the initialization if it is false. - -<p>The <tt>draw()</tt> method can <i>only</i> use OpenGL calls. Do not -attempt to call X, any of the functions in <FL/fl_draw.H>, or -<tt>glX</tt> directly. Do not call <tt>gl_start()</tt> or -<tt>gl_finish()</tt>. - -<p>If double-buffering is enabled in the window, the back and front buffers -are swapped after this function is completed. - -<h4><a name="Fl_Gl_Window.mode">const int Fl_Gl_Window::mode() const<br> -int Fl_Gl_Window::mode(int m)</a></h4> - -Set or change the OpenGL capabilites of the window. The value can be -any of the following OR'd together: - -<ul> - <li><tt>FL_RGB</tt> - RGB color (not indexed) - <li><tt>FL_RGB8</tt> - RGB color with at least 8 bits of each color - <li><tt>FL_INDEX</tt> - Indexed mode - <li><tt>FL_SINGLE</tt> - not double buffered - <li><tt>FL_DOUBLE</tt> - double buffered - <li><tt>FL_ACCUM</tt> - accumulation buffer - <li><tt>FL_ALPHA</tt> - alpha channel in color - <li><tt>FL_DEPTH</tt> - depth buffer - <li><tt>FL_STENCIL</tt> - stencil buffer - <li><tt>FL_MULTISAMPLE</tt> - multisample antialiasing -</ul> - -<tt>FL_RGB</tt> and <tt>FL_SINGLE</tt> have a value of zero, so they are -"on" unless you give <tt>FL_INDEX</tt> or <tt>FL_DOUBLE</tt>. - -<p>If the desired combination cannot be done, FLTK will try turning off -<tt>FL_MULTISAMPLE</tt>. If this also fails the <tt>show()</tt> will call -<tt>Fl::error()</tt> and not show the window. - -<p>You can change the mode while the window is displayed. This -is most useful for turning double-buffering on and off. Under -X this will cause the old X window to be destroyed and a new one to be -created. If this is a top-level window this will unfortunately also -cause the window to blink, raise to the top, and be de-iconized, and -the <tt>xid()</tt> will change, possibly breaking other code. It is best to -make the GL window a child of another window if you wish to do this! - -<h4><a name="Fl_Gl_Window.can_do">static int Fl_Gl_Window::can_do(int)<br> -int Fl_Gl_Window::can_do() const</a></h4> - -Returns non-zero if the hardware supports the given or current OpenGL mode. - -<h4><a name="Fl_Gl_Window.valid">char Fl_Gl_Window::valid() const<br> -void Fl_Gl_Window::valid(char i)</a></h4> - -<tt>Fl_Gl_Window::valid()</tt> is turned off when FLTK creates a -new context for this window or when the window resizes, and is turned -on <i>after</i> <tt>draw()</tt> is called. You can use this inside your <tt>draw()</tt> -method to avoid unneccessarily initializing the OpenGL context. Just -do this: - -<ul><pre> + +----<A href=Fl_Pack.html#Fl_Pack>Fl_Pack</A>, <A href=Fl_Scroll.html#Fl_Scroll>Fl_Scroll</A>, <A href=Fl_Tabs.html#Fl_Tabs>Fl_Tabs</A>, <A href=Fl_Tile.html#Fl_Tile>Fl_Tile</A>, <A href=Fl_Window.html#Fl_Window>Fl_Window</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Gl_Window.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Gl_Window</TT> widget sets things up so OpenGL works, and +also keeps an OpenGL "context" for that window, so that changes to the +lighting and projection may be reused between redraws. Fl_Gl_Window + also flushes the OpenGL streams and swaps buffers after <TT>draw()</TT> + returns. +<P>OpenGL hardware typically provides some overlay bit planes, which +are very useful for drawing UI controls atop your 3D graphics. If the +overlay hardware is not provided, FLTK tries to simulate the overlay, +This works pretty well if your graphics are double buffered, but not +very well for single-buffered. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Gl_Window.Fl_Gl_Window>Fl_Gl_Window</A></LI> +<LI><A href=#Fl_Gl_Window.~Fl_Gl_Window>~Fl_Gl_Window</A></LI> +<LI><A href=#Fl_Gl_Window.can_do>can_do</A></LI> +<LI><A href=#Fl_Gl_Window.can_do_overlay>can_do_overlay</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Gl_Window.draw>draw</A></LI> +<LI><A href=#Fl_Gl_Window.draw_overlay>draw_overlay</A></LI> +<LI><A href=#Fl_Gl_Window.handle>handle</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Gl_Window.hide>hide</A></LI> +<LI><A href=#Fl_Gl_Window.invalidate>invalidate</A></LI> +<LI><A href=#Fl_Gl_Window.make_current>make_current</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Gl_Window.make_overlay_current>make_overlay_current</A></LI> +<LI><A href=#Fl_Gl_Window.mode>mode</A></LI> +<LI><A href=#Fl_Gl_Window.ortho>ortho</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Gl_Window.redraw_overlay>redraw_overlay</A></LI> +<LI><A href=#Fl_Gl_Window.swap_buffers>swap_buffers</A></LI> +<LI><A href=#Fl_Gl_Window.valid>valid</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Gl_Window.Fl_Gl_Window>Fl_Gl_Window::Fl_Gl_Window(int x, +int y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Gl_Window</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. The +default mode is <TT>FL_RGB|FL_DOUBLE|FL_DEPTH</TT>. +<H4><A name=Fl_Gl_Window.~Fl_Gl_Window>virtual +Fl_Gl_Window::~Fl_Gl_Window()</A></H4> + The destructor removes the widget and destroys the OpenGL context +associated with it. +<H4><A name=Fl_Gl_Window.draw>virtual void Fl_Gl_Window::draw(void)</A></H4> +<TT>Fl_Gl_Window::draw()</TT> is a pure virtual method. You must +subclass <TT>Fl_Gl_Window</TT> and provide an implementation for <TT> +draw()</TT>. You may also provide an implementation of draw_overlay() +if you want to draw into the overlay planes. You can avoid +reinitializing the viewport and lights and other things by checking <TT> +valid()</TT> at the start of <TT>draw()</TT> and only doing the +initialization if it is false. +<P>The <TT>draw()</TT> method can <I>only</I> use OpenGL calls. Do not +attempt to call X, any of the functions in <FL/fl_draw.H>, or <TT>glX</TT> + directly. Do not call <TT>gl_start()</TT> or <TT>gl_finish()</TT>. </P> +<P>If double-buffering is enabled in the window, the back and front +buffers are swapped after this function is completed. </P> +<H4><A name=Fl_Gl_Window.mode>const int Fl_Gl_Window::mode() const +<BR> int Fl_Gl_Window::mode(int m)</A></H4> + Set or change the OpenGL capabilites of the window. The value can be +any of the following OR'd together: +<UL> +<LI><TT>FL_RGB</TT> - RGB color (not indexed) </LI> +<LI><TT>FL_RGB8</TT> - RGB color with at least 8 bits of each color </LI> +<LI><TT>FL_INDEX</TT> - Indexed mode </LI> +<LI><TT>FL_SINGLE</TT> - not double buffered </LI> +<LI><TT>FL_DOUBLE</TT> - double buffered </LI> +<LI><TT>FL_ACCUM</TT> - accumulation buffer </LI> +<LI><TT>FL_ALPHA</TT> - alpha channel in color </LI> +<LI><TT>FL_DEPTH</TT> - depth buffer </LI> +<LI><TT>FL_STENCIL</TT> - stencil buffer </LI> +<LI><TT>FL_MULTISAMPLE</TT> - multisample antialiasing </LI> +</UL> +<TT>FL_RGB</TT> and <TT>FL_SINGLE</TT> have a value of zero, so they +are "on" unless you give <TT>FL_INDEX</TT> or <TT>FL_DOUBLE</TT>. +<P>If the desired combination cannot be done, FLTK will try turning off <TT> +FL_MULTISAMPLE</TT>. If this also fails the <TT>show()</TT> will call <TT> +Fl::error()</TT> and not show the window. </P> +<P>You can change the mode while the window is displayed. This is most +useful for turning double-buffering on and off. Under X this will +cause the old X window to be destroyed and a new one to be created. If +this is a top-level window this will unfortunately also cause the +window to blink, raise to the top, and be de-iconized, and the <TT>xid()</TT> + will change, possibly breaking other code. It is best to make the GL +window a child of another window if you wish to do this! </P> +<H4><A name=Fl_Gl_Window.can_do>static int Fl_Gl_Window::can_do(int) +<BR> int Fl_Gl_Window::can_do() const</A></H4> + Returns non-zero if the hardware supports the given or current OpenGL +mode. +<H4><A name=Fl_Gl_Window.valid>char Fl_Gl_Window::valid() const +<BR> void Fl_Gl_Window::valid(char i)</A></H4> +<TT>Fl_Gl_Window::valid()</TT> is turned off when FLTK creates a new +context for this window or when the window resizes, and is turned on <I> +after</I><TT>draw()</TT> is called. You can use this inside your <TT> +draw()</TT> method to avoid unneccessarily initializing the OpenGL +context. Just do this: +<UL> +<PRE> void mywindow::draw() { if (!valid()) { glViewport(0,0,w(),h()); @@ -171,16 +139,17 @@ void mywindow::draw() { ... draw your geometry here ... } -<br>void Fl_Gl_Window::invalidate(); -<br>void Fl_Gl_Window::valid(char i);</a></h4> +<BR>void Fl_Gl_Window::invalidate(); +<BR>void Fl_Gl_Window::valid(char i); -<tt>Fl_Gl_Window::valid()</tt> is turned off when FLTK creates a +<TT>Fl_Gl_Window::valid()</TT> is turned off when FLTK creates a new context for this window and by the window resizing, and is turned -on <i>after</i> draw() is called. You can use this inside your draw() +on <I>after</I> draw() is called. You can use this inside your draw() method to avoid unneccessarily initializing the OpenGL context. Just do this: -<pre><tt>void mywindow::draw() { +</PRE> +<PRE><TT>void mywindow::draw() { if (!valid()) { glViewport(0,0,w(),h()); glFrustum(...); @@ -189,77 +158,61 @@ do this: } ... draw your geometry here ... } -</pre></ul> - -You can turn <tt>valid()</tt> on by calling <tt>valid(1)</tt>. You -should only do this after fixing the transformation inside a -<tt>draw()</tt> or after <tt>make_current()</tt>. This is done -automatically after <tt>draw()</tt> returns. - -<h4><a name="Fl_Gl_Window.invalidate">void Fl_Gl_Window::invalidate()</a></h4> - -The <tt>invalidate()</tt> method turns off <tt>valid()</tt> and is -equivalent to calling <tt>value(0)</tt>. - -<h4><a name="Fl_Gl_Window.ortho">void Fl_Gl_Window::ortho()</a></h4> - -Set the projection so 0,0 is in the lower left of the window and each -pixel is 1 unit wide/tall. If you are drawing 2D images, your -<tt>draw()</tt> method may want to call this if <tt>valid()</tt> is -false. - -<h4><a name="Fl_Gl_Window.make_current">void Fl_Gl_Window::make_current()</a></h4> - -The <tt>make_current()</tt> method selects the OpenGL context for the -widget. It is called automatically prior to the <tt>draw()</tt> method -being called and can also be used to implement feedback and/or selection -within the <tt>handle()</tt> method. - -<h4><a name="Fl_Gl_Window.make_overlay_current">void Fl_Gl_Window::make_overlay_current()</a></h4> - -The <tt>make_overlay_current()</tt> method selects the OpenGL context -for the widget's overlay. It is called automatically prior to the -<tt>draw_overlay()</tt> method being called and can also be used to -implement feedback and/or selection within the <tt>handle()</tt> -method. - -<h4><a name="Fl_Gl_Window.swap_buffers">void Fl_Gl_Window::swap_buffers()</a></h4> - -The <tt>swap_buffers()</tt> method swaps the back and front buffers. -It is called automatically after the <tt>draw()</tt> method is called. - -<h4><a name="Fl_Gl_Window.hide">void Fl_Gl_Window::hide()</a></h4> - -Hides the window and destroys the OpenGL context. - -<h4><a name="Fl_Gl_Window.can_do_overlay">int Fl_Gl_Window::can_do_overlay()</a></h4> - -Returns true if the hardware overlay is possible. If this is false, -FLTK will try to simulate the overlay, with significant loss of update -speed. Calling this will cause FLTK to open the display. - -<h4><a name="Fl_Gl_Window.redraw_overlay">void Fl_Gl_Window::redraw_overlay()</a></h4> - -This method causes <tt>draw_overlay</tt> to be called at a later time. -Initially the overlay is clear, if you want the window to display -something in the overlay when it first appears, you must call this -immediately after you <tt>show()</tt> your window. - -<h4><a name="Fl_Gl_Window.draw_overlay">virtual void Fl_Gl_Window::draw_overlay()</a></h4> - -You must implement this virtual function if you want to draw into the -overlay. The overlay is cleared before this is called. You should -draw anything that is not clear using OpenGL. You must use -<tt>gl_color(i)</tt> to choose colors (it allocates them from the colormap -using system-specific calls), and remember that you are in an indexed -OpenGL mode and drawing anything other than flat-shaded will probably -not work. - -<p>Both this function and <tt>Fl_Gl_Window::draw()</tt> should check -<tt>Fl_Gl_Window::valid()</tt> and set the same transformation. If you -don't your code may not work on other systems. Depending on the OS, -and on whether overlays are real or simulated, the OpenGL context may -be the same or different between the overlay and main window. - -</body> -</html> +</TT></PRE> +</UL> + You can turn <TT>valid()</TT> on by calling <TT>valid(1)</TT>. You +should only do this after fixing the transformation inside a <TT>draw()</TT> + or after <TT>make_current()</TT>. This is done automatically after <TT> +draw()</TT> returns. +<H4><A name=Fl_Gl_Window.invalidate>void Fl_Gl_Window::invalidate()</A></H4> + The <TT>invalidate()</TT> method turns off <TT>valid()</TT> and is +equivalent to calling <TT>value(0)</TT>. +<H4><A name=Fl_Gl_Window.ortho>void Fl_Gl_Window::ortho()</A></H4> + Set the projection so 0,0 is in the lower left of the window and each +pixel is 1 unit wide/tall. If you are drawing 2D images, your <TT> +draw()</TT> method may want to call this if <TT>valid()</TT> is false. +<H4><A name=Fl_Gl_Window.make_current>void Fl_Gl_Window::make_current()</A> +</H4> + The <TT>make_current()</TT> method selects the OpenGL context for the +widget. It is called automatically prior to the <TT>draw()</TT> method +being called and can also be used to implement feedback and/or +selection within the <TT>handle()</TT> method. +<H4><A name=Fl_Gl_Window.make_overlay_current>void +Fl_Gl_Window::make_overlay_current()</A></H4> + The <TT>make_overlay_current()</TT> method selects the OpenGL context +for the widget's overlay. It is called automatically prior to the <TT> +draw_overlay()</TT> method being called and can also be used to +implement feedback and/or selection within the <TT>handle()</TT> + method. +<H4><A name=Fl_Gl_Window.swap_buffers>void Fl_Gl_Window::swap_buffers()</A> +</H4> + The <TT>swap_buffers()</TT> method swaps the back and front buffers. +It is called automatically after the <TT>draw()</TT> method is called. +<H4><A name=Fl_Gl_Window.hide>void Fl_Gl_Window::hide()</A></H4> + Hides the window and destroys the OpenGL context. +<H4><A name=Fl_Gl_Window.can_do_overlay>int +Fl_Gl_Window::can_do_overlay()</A></H4> + Returns true if the hardware overlay is possible. If this is false, +FLTK will try to simulate the overlay, with significant loss of update +speed. Calling this will cause FLTK to open the display. +<H4><A name=Fl_Gl_Window.redraw_overlay>void +Fl_Gl_Window::redraw_overlay()</A></H4> + This method causes <TT>draw_overlay</TT> to be called at a later time. + Initially the overlay is clear, if you want the window to display +something in the overlay when it first appears, you must call this +immediately after you <TT>show()</TT> your window. +<H4><A name=Fl_Gl_Window.draw_overlay>virtual void +Fl_Gl_Window::draw_overlay()</A></H4> + You must implement this virtual function if you want to draw into the +overlay. The overlay is cleared before this is called. You should +draw anything that is not clear using OpenGL. You must use <TT> +gl_color(i)</TT> to choose colors (it allocates them from the colormap +using system-specific calls), and remember that you are in an indexed +OpenGL mode and drawing anything other than flat-shaded will probably +not work. +<P>Both this function and <TT>Fl_Gl_Window::draw()</TT> should check <TT> +Fl_Gl_Window::valid()</TT> and set the same transformation. If you +don't your code may not work on other systems. Depending on the OS, +and on whether overlays are real or simulated, the OpenGL context may +be the same or different between the overlay and main window. </P> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Group.html b/documentation/Fl_Group.html index 315ce1b37..16e8e4f58 100644 --- a/documentation/Fl_Group.html +++ b/documentation/Fl_Group.html @@ -1,178 +1,136 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Group">class Fl_Group</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Group>class Fl_Group</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Group</b> + +----<B>Fl_Group</B> | - +----<a href="#Fl_Pack">Fl_Pack</a>, <a href="#Fl_Scroll">Fl_Scroll</a>, <a href="#Fl_Tabs">Fl_Tabs</a>, <a href="#Fl_Tile">Fl_Tile</a>, <a href="#Fl_Window">Fl_Window</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Group.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Group</tt> class is the FLTK container widget. It maintains -an array of child widgets. These children can themselves be any widget -including <tt>Fl_Group</tt>. The most important subclass of <tt>Fl_Group</tt> -is <a href="#Fl_Window"><tt>Fl_Window</tt></a>, however groups can also -be used to control radio buttons or to enforce resize behavior. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Group.Fl_Group">Fl_Group</a> - <li><a href="#Fl_Group.~Fl_Group">~Fl_Group</a> - <li><a href="#Fl_Group.add">add</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Group.add_resizable">add_resizable</a> - <li><a href="#Fl_Group.array">array</a> - <li><a href="#Fl_Group.begin">begin</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Group.child">child</a> - <li><a href="#Fl_Group.children">children</a> - <li><a href="#Fl_Group.current">current</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Group.end">end</a> - <li><a href="#Fl_Group.find">find</a> - <li><a href="#Fl_Group.insert">insert</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Group.remove">remove</a> - <li><a href="#Fl_Group.resizeable">resizable</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Group.Fl_Group">Fl_Group::Fl_Group(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Group</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Group.~Fl_Group">virtual Fl_Group::~Fl_Group()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Group</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Group</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Group.add">void Fl_Group::add(Fl_Widget &w)<BR> -void Fl_Group::add(Fl_Widget *w)</a></h4> - -Adds a widget to the group at the end of the child array. - -<h4><a name="Fl_Group.add_resizable">Fl_Group &Fl_Group::add_resizable(Fl_Widget &box)</a></h4> - -Adds a widget to the group and makes it the resizable widget. - -<h4><a name="Fl_Group.array">const Fl_Widget **Fl_Group::array() const</a></h4> - -Returns a pointer to the array of children. <i>This pointer can change -when children are added or removed!</i> - -<h4><a name="Fl_Group.begin">void Fl_Group::begin()</a></h4> - -<tt>begin()</tt> sets the current group so you can build the widget tree -by just constructing the widgets. <tt>begin()</tt> is automatically called by -the constructor for Fl_Group (and thus for Fl_Window as well). -<tt>begin()</tt> does <tt>current(this)</tt>. - -<p><i>Don't forget to <tt>end()</tt> the group or window!</i> - -<h4><a name="Fl_Group.child">Fl_Widget *Fl_Group::child(int n) const</a></h4> - -Returns child <tt>n</tt>, where <tt>0 <= n < children()</tt>. - -<h4><a name="Fl_Group.children">int Fl_Group::children() const</a></h4> - -Returns how many child widgets the group has. - -<h4><a name="Fl_Group.current">static Fl_Group *Fl_Group::current()<BR> -static void Fl_Group::current(Fl_Group *w)</a></h4> - -<tt>current()</tt> returns the currently active group in the widget tree. -To prevent widgets from being added to a group, call <tt>current()</tt> -with a <tt>NULL</tt> group. - -<h4><a name="Fl_Group.end">void Fl_Group::end()</a></h4> - -<tt>end()</tt> does <tt>current(this->parent())</tt>. Any new widgets added -to the widget tree will be added to the parent of the group. - -<h4><a name="Fl_Group.find">int Fl_Group::find(const Fl_Widget *w) const<BR> -int Fl_Group::find(const Fl_Widget &w) const</a></h4> - -Searches the child array for the widget and returns the index. Returns -<a href="#Fl_Group.children"><tt>children()</tt></a> if the widget is -<tt>NULL</tt> or not found. - -<h4><a name="Fl_Group.insert">void Fl_Group::insert(Fl_Widget &w, int n)<BR> -void Fl_Group::insert(Fl_Widget &w, Fl_Widget *beforethis)</a></h4> - -Inserts a widget into the child array. It is put at index <tt>n</tt> which -must be less or equal to children(). The second version does a -<tt>find(beforethis)</tt> and inserts using that index. - -<h4><a name="Fl_Group.remove">void Fl_Group::remove(Fl_Widget &w)</a></h4> - -Removes a widget from the group. This does nothing if the widget -is not currently a child of this group. - -<h4><a name="Fl_Group.resizeable">void Fl_Group::resizable(Fl_Widget *box)<BR> -void Fl_Group::resizable(Fl_Widget &box)<BR> -Fl_Widget *Fl_Group::resizable() const</a></h4> - -The resizable widget defines the resizing box for the group. When the -group is resized it calculates a new size and position for all of its -children. Widgets that are horizontally or vertically inside the dimensions -of the box are scaled to the new size. Widgets outside the box are moved. - -<p>In these examples the gray area is the resizable:<br> - -<p align=center><img SRC="resizebox1.gif" align=TOP height=240> -<img SRC="resizebox2.gif" align=TOP height=240> - -<p>The resizable may be set to the group itself (this is the default value -for an <tt>Fl_Group</tt>, although <tt>NULL</tt> is the default for an -<tt>Fl_Window</tt>), in which case all the contents are resized. If the -resizable is <tt>NULL</tt> then all widgets remain a fixed size and -distance from the top-left corner. - -<p>It is possible to achieve any type of resize behavior by using an -invisible <tt>Fl_Box</tt> as the resizable and/or by using a hierarchy of -child <tt>Fl_Group</tt>'s. - -</body> -</html> + +----<A href=Fl_Pack.html#Fl_Pack>Fl_Pack</A>, <A href=Fl_Scroll.html#Fl_Scroll>Fl_Scroll</A>, <A href=Fl_Tabs.html#Fl_Tabs>Fl_Tabs</A>, <A href=Fl_Tile.html#Fl_Tile>Fl_Tile</A>, <A href=Fl_Window.html#Fl_Window>Fl_Window</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Group.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Group</TT> class is the FLTK container widget. It maintains +an array of child widgets. These children can themselves be any widget +including <TT>Fl_Group</TT>. The most important subclass of <TT>Fl_Group</TT> + is <A href=Fl_Window.html#Fl_Window><TT>Fl_Window</TT></A>, however +groups can also be used to control radio buttons or to enforce resize +behavior. +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Group.Fl_Group>Fl_Group</A></LI> +<LI><A href=#Fl_Group.~Fl_Group>~Fl_Group</A></LI> +<LI><A href=#Fl_Group.add>add</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Group.add_resizable>add_resizable</A></LI> +<LI><A href=#Fl_Group.array>array</A></LI> +<LI><A href=#Fl_Group.begin>begin</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Group.child>child</A></LI> +<LI><A href=#Fl_Group.children>children</A></LI> +<LI><A href=#Fl_Group.current>current</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Group.end>end</A></LI> +<LI><A href=#Fl_Group.find>find</A></LI> +<LI><A href=#Fl_Group.insert>insert</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Group.remove>remove</A></LI> +<LI><A href=#Fl_Group.resizeable>resizable</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Group.Fl_Group>Fl_Group::Fl_Group(int x, int y, int w, +int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Group</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Group.~Fl_Group>virtual Fl_Group::~Fl_Group()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Group</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Group</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Group.add>void Fl_Group::add(Fl_Widget &w) +<BR> void Fl_Group::add(Fl_Widget *w)</A></H4> + Adds a widget to the group at the end of the child array. +<H4><A name=Fl_Group.add_resizable>Fl_Group +&Fl_Group::add_resizable(Fl_Widget &box)</A></H4> + Adds a widget to the group and makes it the resizable widget. +<H4><A name=Fl_Group.array>const Fl_Widget **Fl_Group::array() const</A></H4> + Returns a pointer to the array of children. <I>This pointer can change +when children are added or removed!</I> +<H4><A name=Fl_Group.begin>void Fl_Group::begin()</A></H4> +<TT>begin()</TT> sets the current group so you can build the widget +tree by just constructing the widgets. <TT>begin()</TT> is +automatically called by the constructor for Fl_Group (and thus for +Fl_Window as well). <TT>begin()</TT> does <TT>current(this)</TT>. +<P><I>Don't forget to <TT>end()</TT> the group or window!</I></P> +<H4><A name=Fl_Group.child>Fl_Widget *Fl_Group::child(int n) const</A></H4> + Returns child <TT>n</TT>, where <TT>0 +<!--= n < children()</tt--> +. +<H4><A name=Fl_Group.children>int Fl_Group::children() const</A></H4> + Returns how many child widgets the group has. +<H4><A name=Fl_Group.current>static Fl_Group *Fl_Group::current() +<BR> static void Fl_Group::current(Fl_Group *w)</A></H4> +<TT>current()</TT> returns the currently active group in the widget +tree. To prevent widgets from being added to a group, call <TT>current()</TT> + with a <TT>NULL</TT> group. +<H4><A name=Fl_Group.end>void Fl_Group::end()</A></H4> +<TT>end()</TT> does <TT>current(this->parent())</TT>. Any new widgets +added to the widget tree will be added to the parent of the group. +<H4><A name=Fl_Group.find>int Fl_Group::find(const Fl_Widget *w) const +<BR> int Fl_Group::find(const Fl_Widget &w) const</A></H4> + Searches the child array for the widget and returns the index. Returns <A +href=#Fl_Group.children><TT>children()</TT></A> if the widget is <TT> +NULL</TT> or not found. +<H4><A name=Fl_Group.insert>void Fl_Group::insert(Fl_Widget &w, int n) +<BR> void Fl_Group::insert(Fl_Widget &w, Fl_Widget *beforethis)</A></H4> + Inserts a widget into the child array. It is put at index <TT>n</TT> + which must be less or equal to children(). The second version does a <TT> +find(beforethis)</TT> and inserts using that index. +<H4><A name=Fl_Group.remove>void Fl_Group::remove(Fl_Widget &w)</A></H4> + Removes a widget from the group. This does nothing if the widget is +not currently a child of this group. +<H4><A name=Fl_Group.resizeable>void Fl_Group::resizable(Fl_Widget *box) +<BR> void Fl_Group::resizable(Fl_Widget &box) +<BR> Fl_Widget *Fl_Group::resizable() const</A></H4> + The resizable widget defines the resizing box for the group. When the +group is resized it calculates a new size and position for all of its +children. Widgets that are horizontally or vertically inside the +dimensions of the box are scaled to the new size. Widgets outside the +box are moved. +<P>In these examples the gray area is the resizable: +<BR></P> +<P align=center><IMG align=TOP height=240 SRC=./resizebox1.gif> <IMG align=TOP +height=240 SRC=./resizebox2.gif></P> +<P>The resizable may be set to the group itself (this is the default +value for an <TT>Fl_Group</TT>, although <TT>NULL</TT> is the default +for an <TT>Fl_Window</TT>), in which case all the contents are resized. +If the resizable is <TT>NULL</TT> then all widgets remain a fixed size +and distance from the top-left corner. </P> +<P>It is possible to achieve any type of resize behavior by using an +invisible <TT>Fl_Box</TT> as the resizable and/or by using a hierarchy +of child <TT>Fl_Group</TT>'s. </P> +</TT></BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Hold_Browser.html b/documentation/Fl_Hold_Browser.html index 591d61a27..489520e4e 100644 --- a/documentation/Fl_Hold_Browser.html +++ b/documentation/Fl_Hold_Browser.html @@ -1,74 +1,55 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Hold_Browser">class Fl_Hold_Browser</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Browser">Fl_Browser</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Hold_Browser>class Fl_Hold_Browser</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Browser.html#Fl_Browser>Fl_Browser</A> | - +----<b>Fl_Hold_Browser</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Hold_Browser.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Hold_Browser</tt> class is a subclass of <tt>Fl_Browser</tt> -which lets the user select a single item, or no items by clicking on -the empty space. As long as the mouse button is held down the item -pointed to by it is highlighted, and this highlighting remains on when -the mouse button is released. Normally the callback is done when the -user releases the mouse, but you can change this with <tt>when()</tt>. - -<p>See <a href="#Fl_Browser"><tt>Fl_Browser</tt></a> for methods to add -and remove lines from the browser. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Hold_Browser.Fl_Hold_Browser">Fl_Hold_Browser</a> - <li><a href="#Fl_Hold_Browser.~Fl_Hold_Browser">~Fl_Hold_Browser</a> - <li><a href="#Fl_Hold_Browser.deselect">deselect</a> - <li><a href="#Fl_Hold_Browser.select">select</a> - <li><a href="#Fl_Hold_Browser.value">value</a> -</ul> - -<h4><a name="Fl_Hold_Browser.Fl_Hold_Browser">Fl_Hold_Browser::Fl_Hold_Browser(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Hold_Browser</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Hold_Browser.~Fl_Hold_Browser">virtual Fl_Hold_Browser::~Fl_Hold_Browser()</a></h4> - -The destructor <i>also deletes all the items in the list</i>. - -<h4><a name="Fl_Hold_Browser.deselect">int Fl_Browser::deselect()</a></h4> - -Same as <tt>value(0)</tt>. - -<h4><a name="Fl_Hold_Browser.select">int Fl_Browser::select(int,int=1)<br> -int Fl_Browser::selected(int) const</a></h4> - -You can use these for compatibility with -<a href="#Fl_Multi_Browser"><tt>Fl_Multi_Browser</tt></a>. If you -turn on the selection of more than one line the results are -unpredictable. - -<h4><a name="Fl_Hold_Browser.value">int Fl_Browser::value() const<br> -void Fl_Browser::value(int)</a></h4> - -Set or get which line is selected. This returns zero if no line is -selected, so be aware that this can happen in a callback. - -</body> -</html> + +----<B>Fl_Hold_Browser</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Hold_Browser.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Hold_Browser</TT> class is a subclass of <TT>Fl_Browser</TT> + which lets the user select a single item, or no items by clicking on +the empty space. As long as the mouse button is held down the item +pointed to by it is highlighted, and this highlighting remains on when +the mouse button is released. Normally the callback is done when the +user releases the mouse, but you can change this with <TT>when()</TT>. +<P>See <A href=Fl_Browser.html#Fl_Browser><TT>Fl_Browser</TT></A> for +methods to add and remove lines from the browser. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Hold_Browser.Fl_Hold_Browser>Fl_Hold_Browser</A></LI> +<LI><A href=#Fl_Hold_Browser.~Fl_Hold_Browser>~Fl_Hold_Browser</A></LI> +<LI><A href=#Fl_Hold_Browser.deselect>deselect</A></LI> +<LI><A href=#Fl_Hold_Browser.select>select</A></LI> +<LI><A href=#Fl_Hold_Browser.value>value</A></LI> +</UL> +<H4><A name=Fl_Hold_Browser.Fl_Hold_Browser> +Fl_Hold_Browser::Fl_Hold_Browser(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Hold_Browser</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Hold_Browser.~Fl_Hold_Browser>virtual +Fl_Hold_Browser::~Fl_Hold_Browser()</A></H4> + The destructor <I>also deletes all the items in the list</I>. +<H4><A name=Fl_Hold_Browser.deselect>int Fl_Browser::deselect()</A></H4> + Same as <TT>value(0)</TT>. +<H4><A name=Fl_Hold_Browser.select>int Fl_Browser::select(int,int=1) +<BR> int Fl_Browser::selected(int) const</A></H4> + You can use these for compatibility with <A href=Fl_Multi_Browser.html#Fl_Multi_Browser> +<TT>Fl_Multi_Browser</TT></A>. If you turn on the selection of more +than one line the results are unpredictable. +<H4><A name=Fl_Hold_Browser.value>int Fl_Browser::value() const +<BR> void Fl_Browser::value(int)</A></H4> + Set or get which line is selected. This returns zero if no line is +selected, so be aware that this can happen in a callback. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Input.html b/documentation/Fl_Input.html index 89e10d235..98614ffb9 100644 --- a/documentation/Fl_Input.html +++ b/documentation/Fl_Input.html @@ -1,256 +1,179 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Input">class Fl_Input</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Input_">Fl_Input_</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Input>class Fl_Input</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Input_.html#Fl_Input_>Fl_Input_</A> | - +----<b>Fl_Input</b> + +----<B>Fl_Input</B> | - +----<a href="#Fl_Float_Input">Fl_Float_Input</a>, <a href="#Fl_Int_Input">Fl_Int_Input</a>, - <a href="#Fl_Multiline_Input">Fl_Multiline_Input</a>, <a href="#Fl_Secret_Input">Fl_Secret_Input</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Input.H> -</pre></ul> - -<h3>Description</h3> - -This is the FLTK text input widget. It displays a single line of text -and lets the user edit it. Normally it is drawn with an inset box and -a white background. The text may contain any characters (even 0), and -will correctly display anything, using ^X notation for unprintable -control characters and \nnn notation for unprintable characters with -the high bit set. It assummes the font can draw any characters in the -ISO8859-1 character set. - -<table border=1> - -<tr><td><b>Mouse button 1</b></td> -<td>Moves the cursor to this point. Drag selects characters. Double -click selects words. Triple click selects all text. Shift+click -extends the selection.</td> - -<tr><td><b>Mouse button 2</b></td> -<td>Insert the current X selection at the cursor (unlike Motif this -does not move the insertion point to the mouse). If the widget does -not have the input focus (and thus no cursor) it puts the cursor where -clicked and inserts the selection there.</td> - -<tr><td><b>Mouse button 3</b></td> -<td>Currently acts like button 1.</td> - -<tr><td><b>Backspace</b></td> -<td>Deletes one character to the left, or deletes the -selected region.</td> - -<tr><td><b>Enter</b></td> -<td>May cause the callback, see when().</td> - -<tr><td><b>^A or Home</b></td> -<td>Go to start of line.</td> - -<tr><td><b>^B or Left</b></td> -<td>Move left</td> - -<tr><td><b>^C</b></td> -<td>Copy the selection to the clipboard</td> - -<tr><td><b>^D or Delete</b></td> -<td>Deletes one character to the right or deletes the selected region. -<i>Due to silly historical X problems, the Delete key will act like -Backspace until you type a "real" backspace.</i></td> - -<tr><td><b>^E or End</b></td> -<td>Go to the end of line.</td> - -<tr><td><b>^F or Right</b></td> -<td>Move right</td> - -<tr><td><b>^K</b></td> -<td>Delete to the end of line (next \n character) or deletes -a single \n character. These deletions are all concatenated into the -clipboard.</td> - -<tr><td><b>^N or Down</b></td> -<td>Move down (for Fl_Multiline_Input only, otherwise it moves to the -next input field).</td> - -<tr><td><b>^P or Up</b></td> -<td>Move up (for Fl_Multiline_Input only, otherwise it moves to the -previous input field).</td> - -<tr><td><b>^Q or<br>RightCtrl or<br>Compose</b></td> -<td>Start a <a href=compose.html>compose-character</a> sequence. The -next one or two keys typed define the character to insert. This also -can be used to "quote" control characters.</td> - -<tr><td><b>^U</b></td> -<td>Delete everything.</td> - -<tr><td><b>^V or ^Y</b></td> -<td>Paste the clipboard</td> - -<tr><td><b>^X or ^W</b></td> -<td>Copy the region to the clipboard and delete it.</td> - -<tr><td><b>^Z or ^_</b></td> -<td>Undo. This is a single-level undo mechanism, but all adjacent -deletions and insertions are concatenated into a single "undo". Often -this will undo a lot more than you expected.</td> - -<tr><td><b>Shift+move</b></td> -<td>Move the cursor but also extend the selection.</td> - -</table> - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input.Fl_Input">Fl_Input</a> - <li><a href="#Fl_Input.~Fl_Input">~Fl_Input</a> - <li><a href="#Fl_Input.cursor_color">cursor_color</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input.index">index</a> - <li><a href="#Fl_Input.size">size</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input.static_value">static_value</a> - <li><a href="#Fl_Input.textcolor">textcolor</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input.textfont">textfont</a> - <li><a href="#Fl_Input.textsize">textsize</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input.value">value</a> - <li><a href="#Fl_Input.when">when</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Input.Fl_Input">Fl_Input::Fl_Input(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Input</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Input.~Fl_Input">virtual Fl_Input::~Fl_Input()</a></h4> - -Destroys the widget and any value associated with it. - -<h4><a name="Fl_Input.value">const char *Fl_Input::value() const<br> -int Fl_Input::value(const char*)<br> -int Fl_Input::value(const char*, int)</a></h4> - -The first form returns the current value, which is a pointer to the -internal buffer and is valid only until the next event is -handled. - -<p>The second two forms change the text and set the mark and the point -to the end of it. The string is copied to the internal buffer. Passing -<tt>NULL</tt> is the same as "". This returns non-zero if the new -value is different than the current one. You can use the second -version to directly set the length if you know it already or want to -put nul's in the text. - -<h4><a name="Fl_Input.static_value">int Fl_Input::static_value(const char*)<br> -int Fl_Input::static_value(const char*, int)</a></h4> - -Change the text and set the mark and the point to the end of it. The -string is <i>not</i> copied. If the user edits the string it is copied -to the internal buffer then. This can save a great deal of time and -memory if your program is rapidly changing the values of text fields, -but this will only work if the passed string remains unchanged until -either the <tt>Fl_Input</tt> is destroyed or <tt>value()</tt> is called -again. - -<h4><a name="Fl_Input.size">int Fl_Input::size() const</a></h4> - -Returns the number of characters in <tt>value()</tt>. This may be greater than -<tt>strlen(value())</tt> if there are nul characters in it. - -<h4><a name="Fl_Input.index">char Fl_Input::index(int) const</a></h4> - -Same as <tt>value()[n]</tt>, but may be faster in plausible implementations. -No bounds checking is done. - -<h4><a name="Fl_Input.when">Fl_When Fl_Widget::when() const<br> -void Fl_Widget::when(Fl_When)</a></h4> - -Controls when callbacks are done. The following values are useful, -the default value is <tt>FL_WHEN_RELEASE</tt>: - -<ul> - <li><tt>0</tt>: The callback is not done, but <tt>changed()</tt> is - turned on. - - <li><tt>FL_WHEN_CHANGED</tt>: The callback is done each time the - text is changed by the user. - - <li><tt>FL_WHEN_RELEASE</tt>: The callback will - be done when this widget loses the focus, including when the window is - unmapped. This is a useful value for text fields in a panel where - doing the callback on every change is wasteful. However the callback - will also happen if the mouse is moved out of the window, which means - it should not do anything visible (like pop up an error message). You - might do better setting this to zero, and scanning all the items for - <tt>changed()</tt> when the OK button on a panel is pressed. - - <li><tt>FL_WHEN_ENTER_KEY</tt>: If the user types the Enter - key, the entire text is selected, and the callback is done if - the text has changed. Normally the Enter key will navigate to - the next field (or insert a newline for a - <tt>Fl_Mulitline_Input</tt>), this changes the behavior. - - <li><tt>FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED</tt>: The Enter key - will do the callback even if the text has not changed. Useful for - command fields. -</ul> - -<h4><a name="Fl_Input.textcolor">Fl_Color Fl_Input::textcolor() const<br> -void Fl_Input::textcolor(Fl_Color)</a></h4> - -Gets or sets the color of the text in the input field. - -<h4><a name="Fl_Input.textfont">Fl_Font Fl_Input::textfont() const<br> -void Fl_Input::textfont(Fl_Font)</a></h4> - -Gets or sets the font of the text in the input field. - -<h4><a name="Fl_Input.textsize">uchar Fl_Input::textsize() const<br> -void Fl_Input::textsize(uchar)</a></h4> - -Gets or sets the size of the text in the input field. - -<h4><a name="Fl_Input.cursor_color">Fl_Color Fl_Input::cursor_color() const<br> -void Fl_Input::cursor_color(Fl_Color)</a></h4> - -Get or set the color of the cursor. This is black by default. - -</body> -</html> + +----<A href=Fl_Float_Input.html#Fl_Float_Input>Fl_Float_Input</A>, <A href=Fl_Int_Input.html#Fl_Int_Input>Fl_Int_Input</A>, + <A href=Fl_Multiline_Input.html#Fl_Multiline_Input>Fl_Multiline_Input</A>, <A href=Fl_Secret_Input.html#Fl_Secret_Input>Fl_Secret_Input</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Input.H> +</PRE> +</UL> +<H3>Description</H3> + This is the FLTK text input widget. It displays a single line of text +and lets the user edit it. Normally it is drawn with an inset box and +a white background. The text may contain any characters (even 0), and +will correctly display anything, using ^X notation for unprintable +control characters and \nnn notation for unprintable characters with +the high bit set. It assummes the font can draw any characters in the +ISO8859-1 character set. +<TABLE border=1> +<TR><TD><B>Mouse button 1</B></TD><TD>Moves the cursor to this point. + Drag selects characters. Double click selects words. Triple click +selects all text. Shift+click extends the selection.</TD></TR> +<TR><TD><B>Mouse button 2</B></TD><TD>Insert the current X selection at +the cursor (unlike Motif this does not move the insertion point to the +mouse). If the widget does not have the input focus (and thus no +cursor) it puts the cursor where clicked and inserts the selection +there.</TD></TR> +<TR><TD><B>Mouse button 3</B></TD><TD>Currently acts like button 1.</TD></TR> +<TR><TD><B>Backspace</B></TD><TD>Deletes one character to the left, or +deletes the selected region.</TD></TR> +<TR><TD><B>Enter</B></TD><TD>May cause the callback, see when().</TD></TR> +<TR><TD><B>^A or Home</B></TD><TD>Go to start of line.</TD></TR> +<TR><TD><B>^B or Left</B></TD><TD>Move left</TD></TR> +<TR><TD><B>^C</B></TD><TD>Copy the selection to the clipboard</TD></TR> +<TR><TD><B>^D or Delete</B></TD><TD>Deletes one character to the right +or deletes the selected region. <I>Due to silly historical X problems, +the Delete key will act like Backspace until you type a "real" +backspace.</I></TD></TR> +<TR><TD><B>^E or End</B></TD><TD>Go to the end of line.</TD></TR> +<TR><TD><B>^F or Right</B></TD><TD>Move right</TD></TR> +<TR><TD><B>^K</B></TD><TD>Delete to the end of line (next \n character) +or deletes a single \n character. These deletions are all concatenated +into the clipboard.</TD></TR> +<TR><TD><B>^N or Down</B></TD><TD>Move down (for Fl_Multiline_Input +only, otherwise it moves to the next input field).</TD></TR> +<TR><TD><B>^P or Up</B></TD><TD>Move up (for Fl_Multiline_Input only, +otherwise it moves to the previous input field).</TD></TR> +<TR><TD><B>^Q or +<BR>RightCtrl or +<BR>Compose</B></TD><TD>Start a <A href=compose.html>compose-character</A> + sequence. The next one or two keys typed define the character to +insert. This also can be used to "quote" control characters.</TD></TR> +<TR><TD><B>^U</B></TD><TD>Delete everything.</TD></TR> +<TR><TD><B>^V or ^Y</B></TD><TD>Paste the clipboard</TD></TR> +<TR><TD><B>^X or ^W</B></TD><TD>Copy the region to the clipboard and +delete it.</TD></TR> +<TR><TD><B>^Z or ^_</B></TD><TD>Undo. This is a single-level undo +mechanism, but all adjacent deletions and insertions are concatenated +into a single "undo". Often this will undo a lot more than you +expected.</TD></TR> +<TR><TD><B>Shift+move</B></TD><TD>Move the cursor but also extend the +selection.</TD></TR> +</TABLE> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input.Fl_Input>Fl_Input</A></LI> +<LI><A href=#Fl_Input.~Fl_Input>~Fl_Input</A></LI> +<LI><A href=#Fl_Input.cursor_color>cursor_color</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input.index>index</A></LI> +<LI><A href=#Fl_Input.size>size</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input.static_value>static_value</A></LI> +<LI><A href=#Fl_Input.textcolor>textcolor</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input.textfont>textfont</A></LI> +<LI><A href=#Fl_Input.textsize>textsize</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input.value>value</A></LI> +<LI><A href=#Fl_Input.when>when</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Input.Fl_Input>Fl_Input::Fl_Input(int x, int y, int w, +int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Input</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>. +<H4><A name=Fl_Input.~Fl_Input>virtual Fl_Input::~Fl_Input()</A></H4> + Destroys the widget and any value associated with it. +<H4><A name=Fl_Input.value>const char *Fl_Input::value() const +<BR> int Fl_Input::value(const char*) +<BR> int Fl_Input::value(const char*, int)</A></H4> + The first form returns the current value, which is a pointer to the +internal buffer and is valid only until the next event is handled. +<P>The second two forms change the text and set the mark and the point +to the end of it. The string is copied to the internal buffer. Passing <TT> +NULL</TT> is the same as "". This returns non-zero if the new value is +different than the current one. You can use the second version to +directly set the length if you know it already or want to put nul's in +the text. </P> +<H4><A name=Fl_Input.static_value>int Fl_Input::static_value(const +char*) +<BR> int Fl_Input::static_value(const char*, int)</A></H4> + Change the text and set the mark and the point to the end of it. The +string is <I>not</I> copied. If the user edits the string it is copied +to the internal buffer then. This can save a great deal of time and +memory if your program is rapidly changing the values of text fields, +but this will only work if the passed string remains unchanged until +either the <TT>Fl_Input</TT> is destroyed or <TT>value()</TT> is called +again. +<H4><A name=Fl_Input.size>int Fl_Input::size() const</A></H4> + Returns the number of characters in <TT>value()</TT>. This may be +greater than <TT>strlen(value())</TT> if there are nul characters in +it. +<H4><A name=Fl_Input.index>char Fl_Input::index(int) const</A></H4> + Same as <TT>value()[n]</TT>, but may be faster in plausible +implementations. No bounds checking is done. +<H4><A name=Fl_Input.when>Fl_When Fl_Widget::when() const +<BR> void Fl_Widget::when(Fl_When)</A></H4> + Controls when callbacks are done. The following values are useful, +the default value is <TT>FL_WHEN_RELEASE</TT>: +<UL> +<LI><TT>0</TT>: The callback is not done, but <TT>changed()</TT> is + turned on. </LI> +<LI><TT>FL_WHEN_CHANGED</TT>: The callback is done each time the text +is changed by the user. </LI> +<LI><TT>FL_WHEN_RELEASE</TT>: The callback will be done when this +widget loses the focus, including when the window is unmapped. This +is a useful value for text fields in a panel where doing the callback +on every change is wasteful. However the callback will also happen if +the mouse is moved out of the window, which means it should not do +anything visible (like pop up an error message). You might do better +setting this to zero, and scanning all the items for <TT>changed()</TT> + when the OK button on a panel is pressed. </LI> +<LI><TT>FL_WHEN_ENTER_KEY</TT>: If the user types the Enter key, the +entire text is selected, and the callback is done if the text has +changed. Normally the Enter key will navigate to the next field (or +insert a newline for a <TT>Fl_Mulitline_Input</TT>), this changes the +behavior. </LI> +<LI><TT>FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED</TT>: The Enter key will +do the callback even if the text has not changed. Useful for command +fields. </LI> +</UL> +<H4><A name=Fl_Input.textcolor>Fl_Color Fl_Input::textcolor() const +<BR> void Fl_Input::textcolor(Fl_Color)</A></H4> + Gets or sets the color of the text in the input field. +<H4><A name=Fl_Input.textfont>Fl_Font Fl_Input::textfont() const +<BR> void Fl_Input::textfont(Fl_Font)</A></H4> + Gets or sets the font of the text in the input field. +<H4><A name=Fl_Input.textsize>uchar Fl_Input::textsize() const +<BR> void Fl_Input::textsize(uchar)</A></H4> + Gets or sets the size of the text in the input field. +<H4><A name=Fl_Input.cursor_color>Fl_Color Fl_Input::cursor_color() +const +<BR> void Fl_Input::cursor_color(Fl_Color)</A></H4> + Get or set the color of the cursor. This is black by default. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Input_.html b/documentation/Fl_Input_.html index 7dd9f6c63..a270f5f57 100644 --- a/documentation/Fl_Input_.html +++ b/documentation/Fl_Input_.html @@ -1,220 +1,172 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Input_">class Fl_Input_</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Input_>class Fl_Input_</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Input_</b> + +----<B>Fl_Input_</B> | - +----<a href="#Fl_Input">Fl_Input</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Input_.H> -</pre></ul> - -<h3>Description</h3> - -This is a virtual base class below -<a href="#Fl_Input"><tt>Fl_Input</tt></a>. It has all the same interfaces, -but lacks the <tt>handle()</tt> and <tt>draw()</tt> method. You may -want to subclass it if you are one of those people who likes to change -how the editing keys work. - -<p>This can act like any of the subclasses of Fl_Input, by setting -<tt>type()</tt> to one of the following values: - -<ul><pre> + +----<A href=functions.html#Fl_Input>Fl_Input</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Input_.H> +</PRE> +</UL> +<H3>Description</H3> + This is a virtual base class below <A href=functions.html#Fl_Input><TT> +Fl_Input</TT></A>. It has all the same interfaces, but lacks the <TT> +handle()</TT> and <TT>draw()</TT> method. You may want to subclass it +if you are one of those people who likes to change how the editing keys +work. +<P>This can act like any of the subclasses of Fl_Input, by setting <TT> +type()</TT> to one of the following values: </P> +<UL> +<PRE> #define FL_NORMAL_INPUT 0 #define FL_FLOAT_INPUT 1 #define FL_INT_INPUT 2 #define FL_MULTILINE_INPUT 4 #define FL_SECRET_INPUT 5 -</pre></ul> - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input_.Fl_Input_">Fl_Input_</a> - <li><a href="#Fl_Input_.~Fl_Input_">~Fl_Input_</a> - <li><a href="#Fl_Input_.copy">copy</a> - <li><a href="#Fl_Input_.copy_cuts">copy_cuts</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input_.cut">cut</a> - <li><a href="#Fl_Input_.drawtext">drawtext</a> - <li><a href="#Fl_Input_.handletext">handletext</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input_.insert">insert</a> - <li><a href="#Fl_Input_.lineboundary">lineboundary</a> - <li><a href="#Fl_Input_.mark">mark</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input_.maybe_do_callback">maybe_do_callback</a> - <li><a href="#Fl_Input_.position">position</a> - <li><a href="#Fl_Input_.replace">replace</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Input_.undo">undo</a> - <li><a href="#Fl_Input_.up_down_position">up_down_position</a> - <li><a href="#Fl_Input_.wordboundary">wordboundary</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Input_.Fl_Input_">Fl_Input_::Fl_Input_(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Input_</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Input_.~Fl_Input_">virtual Fl_Input_::~Fl_Input_()</a></h4> - -The destructor removes the widget and any value associated with it. - -<h4><a name="Fl_Input_.wordboundary">int Fl_Input_::wordboundary(int i) const</a></h4> - -Returns true if position <tt>i</tt> is at the start or end of a word. - -<h4><a name="Fl_Input_.lineboundary">int Fl_Input_::lineboundary(int i) const</a></h4> - -Returns true if position <tt>i</tt> is at the start or end of a line. - -<h4><a name="Fl_Input_.drawtext">void Fl_Input_::drawtext(int,int,int,int)</a></h4> - -Draw the text in the passed bounding box. If <tt>damage() & -FL_DAMAGE_ALL</tt> is true, this assummes the area has already been -erased to <tt>color()</tt>. Otherwise it does minimal update and -erases the area itself. - -<h4><a name="Fl_Input_.handletext">void Fl_Input_::handletext(int e,int,int,int,int)</a></h4> - -Default handler for all event types. Your <tt>handle()</tt> method +</PRE> +</UL> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input_.Fl_Input_>Fl_Input_</A></LI> +<LI><A href=#Fl_Input_.~Fl_Input_>~Fl_Input_</A></LI> +<LI><A href=#Fl_Input_.copy>copy</A></LI> +<LI><A href=#Fl_Input_.copy_cuts>copy_cuts</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input_.cut>cut</A></LI> +<LI><A href=#Fl_Input_.drawtext>drawtext</A></LI> +<LI><A href=#Fl_Input_.handletext>handletext</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input_.insert>insert</A></LI> +<LI><A href=#Fl_Input_.lineboundary>lineboundary</A></LI> +<LI><A href=#Fl_Input_.mark>mark</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input_.maybe_do_callback>maybe_do_callback</A></LI> +<LI><A href=#Fl_Input_.position>position</A></LI> +<LI><A href=#Fl_Input_.replace>replace</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Input_.undo>undo</A></LI> +<LI><A href=#Fl_Input_.up_down_position>up_down_position</A></LI> +<LI><A href=#Fl_Input_.wordboundary>wordboundary</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Input_.Fl_Input_>Fl_Input_::Fl_Input_(int x, int y, int +w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Input_</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>. +<H4><A name=Fl_Input_.~Fl_Input_>virtual Fl_Input_::~Fl_Input_()</A></H4> + The destructor removes the widget and any value associated with it. +<H4><A name=Fl_Input_.wordboundary>int Fl_Input_::wordboundary(int i) +const</A></H4> + Returns true if position <TT>i</TT> is at the start or end of a word. +<H4><A name=Fl_Input_.lineboundary>int Fl_Input_::lineboundary(int i) +const</A></H4> + Returns true if position <TT>i</TT> is at the start or end of a line. +<H4><A name=Fl_Input_.drawtext>void Fl_Input_::drawtext(int,int,int,int)</A> +</H4> + Draw the text in the passed bounding box. If <TT>damage() +FL_DAMAGE_ALL</TT> is true, this assummes the area has already been +erased to <TT>color()</TT>. Otherwise it does minimal update and +erases the area itself. +<H4><A name=Fl_Input_.handletext>void Fl_Input_::handletext(int +e,int,int,int,int)</A></H4> + Default handler for all event types. Your <TT>handle()</TT> method should call this for all events that it does not handle completely. -You must pass it the same bounding box as passed to <tt>draw()</tt>. -Handles <tt>FL_PUSH</tt>, <tt>FL_DRAG</tt>, <tt>FL_RELEASE</tt> to -select text, handles <tt>FL_FOCUS</tt> and <tt>FL_UNFOCUS</tt> to show -and hide the cursor. - -<h4><a name="Fl_Input_.up_down_position">int Fl_Input_::up_down_position(int i, int keepmark=0)</a></h4> - -Do the correct thing for arrow keys. Sets the position (and mark if -<i>keepmark</i> is zero) to somewhere in the same line as -<i>i</i>, such that pressing the arrows repeatedly will cause the -point to move up and down. - -<h4><a name="Fl_Input_.maybe_do_callback">void Fl_Input_::maybe_do_callback()</a></h4> - -Does the callback if <tt>changed()</tt> is true or if <tt>when() & -FL_WHEN_NOT_CHANGED</tt> is non-zero. You should call this at any -point you think you should generate a callback. - -<h4><a name="Fl_Input_.position">int Fl_Input_::position() const<br> -int Fl_Input_::position(int new_position, int new_mark)<br> -int Fl_Input_::position(int new_position_and_new_mark)</a></h4> - -The input widget maintains two pointers into the string. The "position" is -where the cursor is. The "mark" is the other end of the selected -text. If they are equal then there is no selection. Changing this -does not affect the clipboard (use <tt>copy()</tt> to do that). - -<p>Changing these values causes a <tt>redraw()</tt>. The new values -are bounds checked. The return value is non-zero if the new position -is different than the old one. <tt>position(n)</tt> is the same as -<tt>position(n,n)</tt>. <tt>mark(n)</tt> is the same as -<tt>position(position(),n)</tt>. - -<h4><a name="Fl_Input_.mark">int Fl_Input_::mark() const<br> -int Fl_Input_::mark(int new_mark)</a></h4> - -Gets or sets the current selection mark. <tt>mark(n)</tt> is the same -as <tt>position(position(),n)</tt>. - -<h4><a name="Fl_Input_.replace">int Fl_Input_::replace(int a, int b, const char *insert, int length=0)</a></h4> - -This call does all editing of the text. It deletes the region between -<tt>a</tt> and <tt>b</tt> (either one may be less or equal to the -other), and then inserts the string <tt>insert</tt> at that point and -leaves the <tt>mark()</tt> and <tt>position()</tt> after the -insertion. Does the callback if <tt>when() & FL_WHEN_CHANGED</tt> and -there is a change. - -<p>Set <tt>start</tt> and <tt>end</tt> equal to not delete anything. Set -<tt>insert</tt> to <tt>NULL</tt> to not insert anything. - -<p><tt>length</tt> must be zero or <tt>strlen(insert)</tt>, this saves -a tiny bit of time if you happen to already know the length of the -insertion, or can be used to insert a portion of a string or a string -containing nul's. - -<p><tt>a</tt> and <tt>b</tt> are clamped to the 0..<tt>size()</tt> -range, so it is safe to pass any values. - -<p><tt>cut()</tt> and <tt>insert()</tt> are just inline functions that -call <tt>replace()</tt>. - -<h4><a name="Fl_Input_.cut">int Fl_Input_::cut()<br> -int Fl_Input_::cut(int n)<br> -int Fl_Input_::cut(int a, int b);</a></h4> - -<tt>Fl_Input_::cut()</tt> deletes the current selection. -<tt>cut(n)</tt> deletes <tt>n</tt> characters after the -<tt>position()</tt>. <tt>cut(-n)</tt> deletes <tt>n</tt> characters -before the <tt>position()</tt>. <tt>cut(a,b)</tt> deletes the -characters between offsets <tt>a</tt> and <tt>b</tt>. <tt>A</tt>, -<tt>b</tt>, and <tt>n</tt> are all clamped to the size of the string. -The mark and point are left where the deleted text was. - -<p>If you want the data to go into the clipboard, do -<tt>Fl_Input_::copy()</tt> before calling <tt>Fl_Input_::cut()</tt>, or -do <tt>Fl_Input_::copy_cuts()</tt> afterwards. - -<h4><a name="Fl_Input_.insert">int Fl_Input_::insert(const char *t,int l=0)</a></h4> - -Insert the string <tt>t</tt> at the current position, and leave the -mark and position after it. If <tt>l</tt> is not zero then it is -assummed to be <tt>strlen(t)</tt>. - -<h4><a name="Fl_Input_.copy">int Fl_Input_::copy()</a></h4> - -Put the current selection between <tt>mark()</tt> and -<tt>position()</tt> into the clipboard. Does not replace the old -clipboard contents if <tt>position()</tt> and <tt>mark()</tt> are -equal. - -<h4><a name="Fl_Input_.undo">int Fl_Input_::undo()</a></h4> - -Does undo of several previous calls to <tt>replace()</tt>. Returns -non-zero if any change was made. - -<h4><a name="Fl_Input_.copy_cuts">int Fl_Input_::copy_cuts()</a></h4> - -Copy all the previous contiguous cuts from the undo information to the -clipboard. This is used to make ^K work. - -</body> -</html> + You must pass it the same bounding box as passed to <TT>draw()</TT>. + Handles <TT>FL_PUSH</TT>, <TT>FL_DRAG</TT>, <TT>FL_RELEASE</TT> to +select text, handles <TT>FL_FOCUS</TT> and <TT>FL_UNFOCUS</TT> to show +and hide the cursor. +<H4><A name=Fl_Input_.up_down_position>int +Fl_Input_::up_down_position(int i, int keepmark=0)</A></H4> + Do the correct thing for arrow keys. Sets the position (and mark if <I> +keepmark</I> is zero) to somewhere in the same line as <I>i</I>, such +that pressing the arrows repeatedly will cause the point to move up and +down. +<H4><A name=Fl_Input_.maybe_do_callback>void +Fl_Input_::maybe_do_callback()</A></H4> + Does the callback if <TT>changed()</TT> is true or if <TT>when() +FL_WHEN_NOT_CHANGED</TT> is non-zero. You should call this at any +point you think you should generate a callback. +<H4><A name=Fl_Input_.position>int Fl_Input_::position() const +<BR> int Fl_Input_::position(int new_position, int new_mark) +<BR> int Fl_Input_::position(int new_position_and_new_mark)</A></H4> + The input widget maintains two pointers into the string. The +"position" is where the cursor is. The "mark" is the other end of the +selected text. If they are equal then there is no selection. Changing +this does not affect the clipboard (use <TT>copy()</TT> to do that). +<P>Changing these values causes a <TT>redraw()</TT>. The new values +are bounds checked. The return value is non-zero if the new position +is different than the old one. <TT>position(n)</TT> is the same as <TT> +position(n,n)</TT>. <TT>mark(n)</TT> is the same as <TT> +position(position(),n)</TT>. </P> +<H4><A name=Fl_Input_.mark>int Fl_Input_::mark() const +<BR> int Fl_Input_::mark(int new_mark)</A></H4> + Gets or sets the current selection mark. <TT>mark(n)</TT> is the same +as <TT>position(position(),n)</TT>. +<H4><A name=Fl_Input_.replace>int Fl_Input_::replace(int a, int b, +const char *insert, int length=0)</A></H4> + This call does all editing of the text. It deletes the region between <TT> +a</TT> and <TT>b</TT> (either one may be less or equal to the other), +and then inserts the string <TT>insert</TT> at that point and leaves +the <TT>mark()</TT> and <TT>position()</TT> after the insertion. Does +the callback if <TT>when() FL_WHEN_CHANGED</TT> and there is a change. +<P>Set <TT>start</TT> and <TT>end</TT> equal to not delete anything. + Set <TT>insert</TT> to <TT>NULL</TT> to not insert anything. </P> +<P><TT>length</TT> must be zero or <TT>strlen(insert)</TT>, this saves +a tiny bit of time if you happen to already know the length of the +insertion, or can be used to insert a portion of a string or a string +containing nul's. </P> +<P><TT>a</TT> and <TT>b</TT> are clamped to the 0..<TT>size()</TT> + range, so it is safe to pass any values. </P> +<P><TT>cut()</TT> and <TT>insert()</TT> are just inline functions that +call <TT>replace()</TT>. </P> +<H4><A name=Fl_Input_.cut>int Fl_Input_::cut() +<BR> int Fl_Input_::cut(int n) +<BR> int Fl_Input_::cut(int a, int b);</A></H4> +<TT>Fl_Input_::cut()</TT> deletes the current selection. <TT>cut(n)</TT> + deletes <TT>n</TT> characters after the <TT>position()</TT>. <TT> +cut(-n)</TT> deletes <TT>n</TT> characters before the <TT>position()</TT> +. <TT>cut(a,b)</TT> deletes the characters between offsets <TT>a</TT> + and <TT>b</TT>. <TT>A</TT>, <TT>b</TT>, and <TT>n</TT> are all clamped +to the size of the string. The mark and point are left where the +deleted text was. +<P>If you want the data to go into the clipboard, do <TT> +Fl_Input_::copy()</TT> before calling <TT>Fl_Input_::cut()</TT>, or do <TT> +Fl_Input_::copy_cuts()</TT> afterwards. </P> +<H4><A name=Fl_Input_.insert>int Fl_Input_::insert(const char *t,int +l=0)</A></H4> + Insert the string <TT>t</TT> at the current position, and leave the +mark and position after it. If <TT>l</TT> is not zero then it is +assummed to be <TT>strlen(t)</TT>. +<H4><A name=Fl_Input_.copy>int Fl_Input_::copy()</A></H4> + Put the current selection between <TT>mark()</TT> and <TT>position()</TT> + into the clipboard. Does not replace the old clipboard contents if <TT> +position()</TT> and <TT>mark()</TT> are equal. +<H4><A name=Fl_Input_.undo>int Fl_Input_::undo()</A></H4> + Does undo of several previous calls to <TT>replace()</TT>. Returns +non-zero if any change was made. +<H4><A name=Fl_Input_.copy_cuts>int Fl_Input_::copy_cuts()</A></H4> + Copy all the previous contiguous cuts from the undo information to the +clipboard. This is used to make ^K work. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Int_Input.html b/documentation/Fl_Int_Input.html index e76cc43ef..78382ebc2 100644 --- a/documentation/Fl_Int_Input.html +++ b/documentation/Fl_Int_Input.html @@ -1,47 +1,34 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Int_Input">class Fl_Int_Input</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Input">Fl_Input</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Int_Input>class Fl_Int_Input</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=functions.html#Fl_Input>Fl_Input</A> | - +----<b>Fl_Int_Input</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Input.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Int_Input</tt> class is a subclass of <tt>Fl_Input</tt> that -displays its input in red when the value string is not a legal integer -value. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Int_Input.Fl_Int_Input">Fl_Int_Input</a> - <li><a href="#Fl_Int_Input.~Fl_Int_Input">~Fl_Int_Input</a> -</ul> - -<h4><a name="Fl_Int_Input.Fl_Int_Input">Fl_Int_Input::Fl_Int_Input(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Int_Input</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Int_Input.~Fl_Int_Input">virtual Fl_Int_Input::~Fl_Int_Input()</a></h4> - -Destroys the widget and any value associated with it. - -</body> -</html> + +----<B>Fl_Int_Input</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Input.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Int_Input</TT> class is a subclass of <TT>Fl_Input</TT> + that displays its input in red when the value string is not a legal +integer value. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Int_Input.Fl_Int_Input>Fl_Int_Input</A></LI> +<LI><A href=#Fl_Int_Input.~Fl_Int_Input>~Fl_Int_Input</A></LI> +</UL> +<H4><A name=Fl_Int_Input.Fl_Int_Input>Fl_Int_Input::Fl_Int_Input(int x, +int y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Int_Input</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>. +<H4><A name=Fl_Int_Input.~Fl_Int_Input>virtual +Fl_Int_Input::~Fl_Int_Input()</A></H4> + Destroys the widget and any value associated with it. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Light_Button.html b/documentation/Fl_Light_Button.html index d60af5c97..658e24b1a 100644 --- a/documentation/Fl_Light_Button.html +++ b/documentation/Fl_Light_Button.html @@ -1,53 +1,40 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Light_Button">class Fl_Light_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Button">Fl_Button</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Light_Button>class Fl_Light_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Button.html#Fl_Button>Fl_Button</A> | - +----<b>Fl_Light_Button</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Light_Button.H> -</pre></ul> - -<h3>Description</h3> - -Buttons generate callbacks when they are clicked by the user. You -control exactly when and how by changing the values for <tt>type()</tt> and -<tt>when()</tt>. - -<P>The <tt>Fl_Light_Button</tt> subclass display the "on" state by -turning on a light, rather than drawing pushed in. The shape of the -"light" is initially set to FL_DOWN_BOX. The color of the -light when on is controlled with <tt>selection_color()<tt>, which defaults to -FL_YELLOW. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Light_Button.Fl_Light_Button">Fl_Light_Button</a> - <li><a href="#Fl_Light_Button.~Fl_Light_Button">~Fl_Light_Button</a> -</ul> - -<h4><a name="Fl_Light_Button.Fl_Light_Button">Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Light_Button</tt> widget using the given position, -size, and label string. - -<h4><a name="Fl_Light_Button.~Fl_Light_Button">Fl_Light_Button::~Fl_Light_Button()</a></h4> - -The destructor deletes the check button. - -</body> -</html> + +----<B>Fl_Light_Button</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Light_Button.H> +</PRE> +</UL> +<H3>Description</H3> + Buttons generate callbacks when they are clicked by the user. You +control exactly when and how by changing the values for <TT>type()</TT> + and <TT>when()</TT>. +<P>The <TT>Fl_Light_Button</TT> subclass display the "on" state by +turning on a light, rather than drawing pushed in. The shape of the +"light" is initially set to FL_DOWN_BOX. The color of the light when +on is controlled with <TT>selection_color()<TT>, which defaults to +FL_YELLOW. </TT></TT></P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Light_Button.Fl_Light_Button>Fl_Light_Button</A></LI> +<LI><A href=#Fl_Light_Button.~Fl_Light_Button>~Fl_Light_Button</A></LI> +</UL> +<H4><A name=Fl_Light_Button.Fl_Light_Button> +Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Light_Button</TT> widget using the given +position, size, and label string. +<H4><A name=Fl_Light_Button.~Fl_Light_Button> +Fl_Light_Button::~Fl_Light_Button()</A></H4> + The destructor deletes the check button. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Menu_.html b/documentation/Fl_Menu_.html index f35816496..93fafc7e7 100644 --- a/documentation/Fl_Menu_.html +++ b/documentation/Fl_Menu_.html @@ -1,220 +1,163 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Menu_">class Fl_Menu_</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Menu_>class Fl_Menu_</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Menu_</b>----<a href="#Fl_Menu_Item">Fl_Menu_Item</a> + +----<B>Fl_Menu_</B>----<A href=Fl_Menu_Item.html#Fl_Menu_Item>Fl_Menu_Item</A> | - +----<a href="#Fl_Choice">Fl_Choice</a>, <a href="#Fl_Menu_Bar">Fl_Menu_Bar</a>, <a href="#Fl_Menu_Button">Fl_Menu_Button</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Menu_.H> -</pre></ul> - -<h3>Description</h3> - -All widgets that have a menu in FLTK are subclassed off of this class. -Currently FLTK provides you with -<a href="#Fl_Menu_Button"><tt>Fl_Menu_Button</tt></a>, -<a href="#Fl_Menu_Bar"><tt>Fl_Menu_Bar</tt></a>, and -<a href="#Fl_Choice"><tt>Fl_Choice</tt></a>. - -<p>The class contains a pointer to an array of structures of type -<a href="#Fl_Menu_Item"><tt>Fl_Menu_Item</tt></a>. -These describe the contents of the menu. Usually the array is a large -initialization constant, but there are methods to build it -dynamically. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_.Fl_Menu_">Fl_Menu_</a> - <li><a href="#Fl_Menu_.~Fl_Menu_">~Fl_Menu_</a> - <li><a href="#Fl_Menu_.add">add</a> - <li><a href="#Fl_Menu_.clear">clear</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_.down_box">down_box</a> - <li><a href="#Fl_Menu_.global">global</a> - <li><a href="#Fl_Menu_.menu">menu</a> - <li><a href="#Fl_Menu_.mode">mode</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_.remove">remove</a> - <li><a href="#Fl_Menu_.replace">replace</a> - <li><a href="#Fl_Menu_.shortcut">shortcut</a> - <li><a href="#Fl_Menu_.size">size</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_.test_shortcut">test_shortcut</a> - <li><a href="#Fl_Menu_.text">text</a> - <li><a href="#Fl_Menu_.textcolor">textcolor</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_.textfont">textfont</a> - <li><a href="#Fl_Menu_.textsize">textsize</a> - <li><a href="#Fl_Menu_.value">value</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Menu_.Fl_Menu_">Fl_Menu_::Fl_Menu_(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Menu_</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Menu_.~Fl_Menu_">virtual Fl_Menu_::~Fl_Menu_()</a></h4> - -Destroys the menu and its items. - -<h4><a name="Fl_Menu_.menu">const Fl_Menu_Item* Fl_Menu_::menu() const<br> -void Fl_Menu_::menu(const Fl_Menu_Item*)</a></h4> - -Get or set the menu array directly. Setting it to <tt>NULL</tt> indicates that -you want the widget to allocate its own array. - -<h4><a name="Fl_Menu_.value">int Fl_Menu_::value() const<br> -int Fl_Menu_::value(int)<br> -int Fl_Menu_::value(const Fl_Menu_Item*)</a></h4> - -The value is the index into <tt>menu()</tt> of the last item chosen by the -user. It is zero initially. You can set it as an integer, or set it -with a pointer to a menu item. The set routines return non-zero if -the new value is different than the old one. - -<h4><a name="Fl_Menu_.test_shortcut">const Fl_Menu_Item* Fl_Menu_::test_shortcut()</a></h4> - -Only call this in response to <tt>FL_SHORTCUT events</tt>. If the event -matches an entry in the menu that entry is selected and the callback -will be done (or <tt>changed()</tt> will be set). This allows shortcuts -directed at one window to call menus in another. - -<h4><a name="Fl_Menu_.global">void Fl_Menu_::global()</a></h4> - -Make the shortcuts for this menu work no matter what window has the -focus when you type it. This is done by using <a -href="#add_handler"><tt>Fl::add_handler()</tt></a>. This -<tt>Fl_Menu_</tt> widget does not have to be visible (ie the window it -is in can be hidden, or it does not have to be put in a window at all). - -<p>Currently there can be only one <tt>global()<tt> menu. Setting a new one -will replace the old one. There is no way to remove the <tt>global()</tt> -setting (including destroying the menu). - -<h4><a name="Fl_Menu_.text">const char* Fl_Menu_::text() const<br> -const char* Fl_Menu_::text(int i) const</a></h4> - -Returns the title of the last item chosen, or of item <tt>i</tt>. - -<h4><a name="Fl_Menu_.size">int Fl_Menu_::size() const</a></h4> - -This returns <tt>menu()->size()</tt>, which is how many entries are in -the array, not counting the <tt>NULL</tt> ending, but including all -submenus titles and the <tt>NULL</tt>'s that end them. If the menu is -<tt>NULL</tt> this returns zero. - -<h4><a name="Fl_Menu_.add">int Fl_Menu_::add(const char *,const char *,Fl_Callback *,void *v=0,int f=0)<br> -int Fl_Menu_::add(const char *)</a></h4> - -The first form adds a new menu item, with a <tt>title</tt> string, -<tt>shortcut</tt> string, <tt>callback</tt>, argument to the callback, -and flags. If <tt>menu()</tt> was originally set with <tt>NULL</tt> -then space is allocated for the new item. If instead you gave it an -array then the array must have enough empty space for the new item. -The title string is copied, but the shortcut is not. - -<p>The second form splits the string at any | characters and then does -<tt>add(s,0,0,0,0)</tt> with each section. This is often useful if you -are just using the value, and is compatable with some Forms programs. - -<p>Text is a string of the form "foo/bar/baz", this example will result -in a submenu called "foo" and one in that called "bar" and and entry -called "baz". The text is copied to new memory and can be freed. The -other arguments are copied into the menu item unchanged. - -<P>If an item exists already with that name then it is replaced with -this new one. Otherwise this new one is added to the end of the -correct menu or submenu. The return value is the offset into the -array that the new entry was placed at. - -<p>No bounds checking is done, the table must be big enough for all the -entries you plan to add. Don't forget that there is a <tt>NULL</tt> terminator -on the end, and the first time a item is added to a submenu three -items are added (the title and the <tt>NULL</tt> terminator, as well as the -actual menu item) - -<P>The return value is the index into the array that the entry was put. - -<h4><a name="Fl_Menu_.clear">void Fl_Menu_::clear()</a></h4> - -Delete all the menu items. Don't do this if you used <tt>menu(x)</tt> to -set it to your own array. You should do this before destroying the -<tt>Fl_Menu_</tt> widget if it uses it's own array. - -<h4><a name="Fl_Menu_.replace">void Fl_Menu_::replace(int n, const char *)</a></h4> - -Changes the text of item <tt>n</tt>. The passed string is copied. - -<h4><a name="Fl_Menu_.remove">void Fl_Menu_::remove(int n)</a></h4> - -Deletes item <tt>n</tt> from the menu. - -<h4><a name="Fl_Menu_.shortcut">void Fl_Menu_::shortcut(int i, int n);</a></h4> - -Changes the shortcut of item <tt>i</tt> to <tt>n</tt>. - -<h4><a name="Fl_Menu_.mode">void Fl_Menu_::mode(int i,int x);</a></h4> - -Changes the flags of item <tt>i</tt>. - -<h4><a name="Fl_Menu_.textcolor">Fl_Color Fl_Menu_::textcolor() const<br> -void Fl_Menu_::textcolor(Fl_Color)</a></h4> - -Get or set the current color of menu item labels. - -<h4><a name="Fl_Menu_.textfont">Fl_Font Fl_Menu_::textfont() const<br> -void Fl_Menu_::textfont(Fl_Font)</a></h4> - -Get or set the current font of menu item labels. - -<h4><a name="Fl_Menu_.textsize">uchar Fl_Menu_::textsize() const<br> -void Fl_Menu_::textsize(uchar)</a></h4> - -Get or set the font size of menu item labels. - -<h4><a name="Fl_Menu_.down_box">Fl_Boxtype Fl_Menu_::down_box() const<br> -void Fl_Menu_::down_box(Fl_Boxtype)</a></h4> - -This box type is used to surround the currently-selected items in the -menus. If this is <tt>FL_NO_BOX</tt> then it acts like -<tt>FL_THIN_UP_BOX</tt> and <tt>selection_color()</tt> acts like -<tt>FL_WHITE</tt>, for back compatability. - -</body> -</html> + +----<A href=functions.html#Fl_Choice>Fl_Choice</A>, <A href=Fl_Menu_Bar.html#Fl_Menu_Bar>Fl_Menu_Bar</A>, <A href=Fl_Menu_Button.html#Fl_Menu_Button>Fl_Menu_Button</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Menu_.H> +</PRE> +</UL> +<H3>Description</H3> + All widgets that have a menu in FLTK are subclassed off of this class. +Currently FLTK provides you with <A href=Fl_Menu_Button.html#Fl_Menu_Button> +<TT>Fl_Menu_Button</TT></A>, <A href=Fl_Menu_Bar.html#Fl_Menu_Bar><TT> +Fl_Menu_Bar</TT></A>, and <A href=functions.html#Fl_Choice><TT>Fl_Choice</TT> +</A>. +<P>The class contains a pointer to an array of structures of type <A href=Fl_Menu_Item.html#Fl_Menu_Item> +<TT>Fl_Menu_Item</TT></A>. These describe the contents of the menu. + Usually the array is a large initialization constant, but there are +methods to build it dynamically. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_.Fl_Menu_>Fl_Menu_</A></LI> +<LI><A href=#Fl_Menu_.~Fl_Menu_>~Fl_Menu_</A></LI> +<LI><A href=#Fl_Menu_.add>add</A></LI> +<LI><A href=#Fl_Menu_.clear>clear</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_.down_box>down_box</A></LI> +<LI><A href=#Fl_Menu_.global>global</A></LI> +<LI><A href=#Fl_Menu_.menu>menu</A></LI> +<LI><A href=#Fl_Menu_.mode>mode</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_.remove>remove</A></LI> +<LI><A href=#Fl_Menu_.replace>replace</A></LI> +<LI><A href=#Fl_Menu_.shortcut>shortcut</A></LI> +<LI><A href=#Fl_Menu_.size>size</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_.test_shortcut>test_shortcut</A></LI> +<LI><A href=#Fl_Menu_.text>text</A></LI> +<LI><A href=#Fl_Menu_.textcolor>textcolor</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_.textfont>textfont</A></LI> +<LI><A href=#Fl_Menu_.textsize>textsize</A></LI> +<LI><A href=#Fl_Menu_.value>value</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Menu_.Fl_Menu_>Fl_Menu_::Fl_Menu_(int x, int y, int w, +int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Menu_</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Menu_.~Fl_Menu_>virtual Fl_Menu_::~Fl_Menu_()</A></H4> + Destroys the menu and its items. +<H4><A name=Fl_Menu_.menu>const Fl_Menu_Item* Fl_Menu_::menu() const +<BR> void Fl_Menu_::menu(const Fl_Menu_Item*)</A></H4> + Get or set the menu array directly. Setting it to <TT>NULL</TT> + indicates that you want the widget to allocate its own array. +<H4><A name=Fl_Menu_.value>int Fl_Menu_::value() const +<BR> int Fl_Menu_::value(int) +<BR> int Fl_Menu_::value(const Fl_Menu_Item*)</A></H4> + The value is the index into <TT>menu()</TT> of the last item chosen by +the user. It is zero initially. You can set it as an integer, or set +it with a pointer to a menu item. The set routines return non-zero if +the new value is different than the old one. +<H4><A name=Fl_Menu_.test_shortcut>const Fl_Menu_Item* +Fl_Menu_::test_shortcut()</A></H4> + Only call this in response to <TT>FL_SHORTCUT events</TT>. If the +event matches an entry in the menu that entry is selected and the +callback will be done (or <TT>changed()</TT> will be set). This allows +shortcuts directed at one window to call menus in another. +<H4><A name=Fl_Menu_.global>void Fl_Menu_::global()</A></H4> + Make the shortcuts for this menu work no matter what window has the +focus when you type it. This is done by using <A href=osissues.html#add_handler> +<TT>Fl::add_handler()</TT></A>. This <TT>Fl_Menu_</TT> widget does not +have to be visible (ie the window it is in can be hidden, or it does +not have to be put in a window at all). +<P>Currently there can be only one <TT>global()<TT>menu. Setting a new +one will replace the old one. There is no way to remove the <TT> +global()</TT> setting (including destroying the menu). </TT></TT></P> +<H4><A name=Fl_Menu_.text>const char* Fl_Menu_::text() const +<BR> const char* Fl_Menu_::text(int i) const</A></H4> + Returns the title of the last item chosen, or of item <TT>i</TT>. +<H4><A name=Fl_Menu_.size>int Fl_Menu_::size() const</A></H4> + This returns <TT>menu()->size()</TT>, which is how many entries are in +the array, not counting the <TT>NULL</TT> ending, but including all +submenus titles and the <TT>NULL</TT>'s that end them. If the menu is <TT> +NULL</TT> this returns zero. +<H4><A name=Fl_Menu_.add>int Fl_Menu_::add(const char *,const char +*,Fl_Callback *,void *v=0,int f=0) +<BR> int Fl_Menu_::add(const char *)</A></H4> + The first form adds a new menu item, with a <TT>title</TT> string, <TT> +shortcut</TT> string, <TT>callback</TT>, argument to the callback, and +flags. If <TT>menu()</TT> was originally set with <TT>NULL</TT> then +space is allocated for the new item. If instead you gave it an array +then the array must have enough empty space for the new item. The +title string is copied, but the shortcut is not. +<P>The second form splits the string at any | characters and then does <TT> +add(s,0,0,0,0)</TT> with each section. This is often useful if you are +just using the value, and is compatable with some Forms programs. </P> +<P>Text is a string of the form "foo/bar/baz", this example will result +in a submenu called "foo" and one in that called "bar" and and entry +called "baz". The text is copied to new memory and can be freed. The +other arguments are copied into the menu item unchanged. </P> +<P>If an item exists already with that name then it is replaced with +this new one. Otherwise this new one is added to the end of the +correct menu or submenu. The return value is the offset into the array +that the new entry was placed at. </P> +<P>No bounds checking is done, the table must be big enough for all the +entries you plan to add. Don't forget that there is a <TT>NULL</TT> + terminator on the end, and the first time a item is added to a submenu +three items are added (the title and the <TT>NULL</TT> terminator, as +well as the actual menu item) </P> +<P>The return value is the index into the array that the entry was put. </P> +<H4><A name=Fl_Menu_.clear>void Fl_Menu_::clear()</A></H4> + Delete all the menu items. Don't do this if you used <TT>menu(x)</TT> + to set it to your own array. You should do this before destroying the <TT> +Fl_Menu_</TT> widget if it uses it's own array. +<H4><A name=Fl_Menu_.replace>void Fl_Menu_::replace(int n, const char *)</A> +</H4> + Changes the text of item <TT>n</TT>. The passed string is copied. +<H4><A name=Fl_Menu_.remove>void Fl_Menu_::remove(int n)</A></H4> + Deletes item <TT>n</TT> from the menu. +<H4><A name=Fl_Menu_.shortcut>void Fl_Menu_::shortcut(int i, int n);</A></H4> + Changes the shortcut of item <TT>i</TT> to <TT>n</TT>. +<H4><A name=Fl_Menu_.mode>void Fl_Menu_::mode(int i,int x);</A></H4> + Changes the flags of item <TT>i</TT>. +<H4><A name=Fl_Menu_.textcolor>Fl_Color Fl_Menu_::textcolor() const +<BR> void Fl_Menu_::textcolor(Fl_Color)</A></H4> + Get or set the current color of menu item labels. +<H4><A name=Fl_Menu_.textfont>Fl_Font Fl_Menu_::textfont() const +<BR> void Fl_Menu_::textfont(Fl_Font)</A></H4> + Get or set the current font of menu item labels. +<H4><A name=Fl_Menu_.textsize>uchar Fl_Menu_::textsize() const +<BR> void Fl_Menu_::textsize(uchar)</A></H4> + Get or set the font size of menu item labels. +<H4><A name=Fl_Menu_.down_box>Fl_Boxtype Fl_Menu_::down_box() const +<BR> void Fl_Menu_::down_box(Fl_Boxtype)</A></H4> + This box type is used to surround the currently-selected items in the +menus. If this is <TT>FL_NO_BOX</TT> then it acts like <TT> +FL_THIN_UP_BOX</TT> and <TT>selection_color()</TT> acts like <TT> +FL_WHITE</TT>, for back compatability. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Menu_Bar.html b/documentation/Fl_Menu_Bar.html index d8ff312cf..38cfbe521 100644 --- a/documentation/Fl_Menu_Bar.html +++ b/documentation/Fl_Menu_Bar.html @@ -1,85 +1,63 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Menu_Bar">class Fl_Menu_Bar</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Menu_">Fl_Menu_</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Menu_Bar>class Fl_Menu_Bar</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Menu_.html#Fl_Menu_>Fl_Menu_</A> | - +----<b>Fl_Menu_Bar</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Menu_Bar.H> -</pre></ul> - -<h3>Description</h3> - -This widget provides a standard menubar interface. Usually you will -put this widget along the top edge of your window. The height of the -widget should be 30 for the menu titles to draw correctly with the default -font. - -<p>The items on the bar and the menus they bring up are defined by a -single <a href="#Fl_Menu_Item"><tt>Fl_Menu_Item</tt></a> array. Because a -<tt>Fl_Menu_Item</tt> array defines a hierarchy, the top level menu defines the -items in the menubar, while the submenus define the pull-down menus. -Sub-sub menus and lower pop up to the right of the submenus. - -<p><img src=menubar.gif> - -<P>If there is an item in the top menu that is not a title of a -submenu, then it acts like a "button" in the menubar. Clicking on -it will pick it. - -<P>When the user picks an item off the menu, the item's callback is -done with the menubar as the <tt>Fl_Widget*</tt> argument. If the item -does not have a callback the menubar's callback is done instead. - -<p>Submenus will also pop up in response to shortcuts indicated by -putting a '&' character in the name field of the menu item. If you -put a '&' character in a top-level "button" then the shortcut picks -it. The '&' character in submenus is ignored until the menu is popped -up. - -<p>Typing the <tt>shortcut()</tt> of any of the menu items will cause callbacks -exactly the same as when you pick the item with the mouse. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Menu_Bar.Fl_Menu_Bar">Fl_Menu_Bar</a> - <li><a href="#Fl_Menu_Bar.~Fl_Menu_Bar">~Fl_Menu_Bar</a> -</ul> - -<h4><a name="Fl_Menu_Bar.Fl_Menu_Bar">Fl_Menu_Bar::Fl_Menu_Bar(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Menu_Bar</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_UP_BOX</tt>. - -<p>The constructor sets <tt>menu()</tt> to <tt>NULL</tt>. See <a -href="#Fl_Menu_"><tt>Fl_Menu_</tt></a> for the methods to set or change -the menu. - -<P><tt>labelsize()</tt>, <tt>labelfont()</tt>, and -<tt>labelcolor()</tt> are used to control how the menubar items are -drawn. They are initialized from the <tt>Fl_Menu</tt> static -variables, but you can change them if desired. - -<p><tt>label()</tt> is ignored unless you change <tt>align()</tt> to -put it outside the menubar. - -<h4><a name="Fl_Menu_Bar.~Fl_Menu_Bar">virtual Fl_Menu_Bar::~Fl_Menu_Bar()</a></h4> - -The destructor removes the <tt>Fl_Menu_Bar</tt> widget and all of its menu items. - -</body> -</html> + +----<B>Fl_Menu_Bar</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Menu_Bar.H> +</PRE> +</UL> +<H3>Description</H3> + This widget provides a standard menubar interface. Usually you will +put this widget along the top edge of your window. The height of the +widget should be 30 for the menu titles to draw correctly with the +default font. +<P>The items on the bar and the menus they bring up are defined by a +single <A href=Fl_Menu_Item.html#Fl_Menu_Item><TT>Fl_Menu_Item</TT></A> + array. Because a <TT>Fl_Menu_Item</TT> array defines a hierarchy, the +top level menu defines the items in the menubar, while the submenus +define the pull-down menus. Sub-sub menus and lower pop up to the right +of the submenus. </P> +<P><IMG src=./menubar.gif></P> +<P>If there is an item in the top menu that is not a title of a +submenu, then it acts like a "button" in the menubar. Clicking on it +will pick it. </P> +<P>When the user picks an item off the menu, the item's callback is +done with the menubar as the <TT>Fl_Widget*</TT> argument. If the item +does not have a callback the menubar's callback is done instead. </P> +<P>Submenus will also pop up in response to shortcuts indicated by +putting a ''character in the name field of the menu item. If you put a +''character in a top-level "button" then the shortcut picks it. The +''character in submenus is ignored until the menu is popped up. </P> +<P>Typing the <TT>shortcut()</TT> of any of the menu items will cause +callbacks exactly the same as when you pick the item with the mouse. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Menu_Bar.Fl_Menu_Bar>Fl_Menu_Bar</A></LI> +<LI><A href=#Fl_Menu_Bar.~Fl_Menu_Bar>~Fl_Menu_Bar</A></LI> +</UL> +<H4><A name=Fl_Menu_Bar.Fl_Menu_Bar>Fl_Menu_Bar::Fl_Menu_Bar(int x, int +y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Menu_Bar</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_UP_BOX</TT>. +<P>The constructor sets <TT>menu()</TT> to <TT>NULL</TT>. See <A href=Fl_Menu_.html#Fl_Menu_> +<TT>Fl_Menu_</TT></A> for the methods to set or change the menu. </P> +<P><TT>labelsize()</TT>, <TT>labelfont()</TT>, and <TT>labelcolor()</TT> + are used to control how the menubar items are drawn. They are +initialized from the <TT>Fl_Menu</TT> static variables, but you can +change them if desired. </P> +<P><TT>label()</TT> is ignored unless you change <TT>align()</TT> to +put it outside the menubar. </P> +<H4><A name=Fl_Menu_Bar.~Fl_Menu_Bar>virtual Fl_Menu_Bar::~Fl_Menu_Bar()</A> +</H4> + The destructor removes the <TT>Fl_Menu_Bar</TT> widget and all of its +menu items. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Menu_Button.html b/documentation/Fl_Menu_Button.html index 43bd2d6a6..f3b7eaac0 100644 --- a/documentation/Fl_Menu_Button.html +++ b/documentation/Fl_Menu_Button.html @@ -1,101 +1,79 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Menu_Button">class Fl_Menu_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Menu_">Fl_Menu_</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Menu_Button>class Fl_Menu_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Menu_.html#Fl_Menu_>Fl_Menu_</A> | - +----<b>Fl_Menu_Button</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Menu_Button.H> -</pre></ul> - -<h3>Description</h3> - -This is a button that when pushed pops up a menu (or hierarchy of -menus) defined by an array of <a href="#Fl_Menu_Item"><tt>Fl_Menu_Item</tt></a> -objects. - -<P><img src=menu_button.gif> - -<p>Normally any mouse button will pop up a menu and it is lined up -below the button as shown in the picture. However an <tt>Fl_Menu_Button</tt> -may also control a pop-up menu. This is done by setting the -<tt>type()</tt>, -see below. - -<p>The menu will also pop up in response to shortcuts indicated by -putting a '&' character in the <tt>label()</tt>. - -<p>Typing the <tt>shortcut()</tt> of any of the menu items will cause + +----<B>Fl_Menu_Button</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Menu_Button.H> +</PRE> +</UL> +<H3>Description</H3> + This is a button that when pushed pops up a menu (or hierarchy of +menus) defined by an array of <A href=Fl_Menu_Item.html#Fl_Menu_Item><TT> +Fl_Menu_Item</TT></A> objects. +<P><IMG src=./menu_button.gif></P> +<P>Normally any mouse button will pop up a menu and it is lined up +below the button as shown in the picture. However an <TT>Fl_Menu_Button</TT> + may also control a pop-up menu. This is done by setting the <TT>type()</TT> +, see below. </P> +<P>The menu will also pop up in response to shortcuts indicated by +putting a ''character in the <TT>label()</TT>. </P> +<P>Typing the <TT>shortcut()</TT> of any of the menu items will cause callbacks exactly the same as when you pick the item with the mouse. -The '&' character in menu item names are only looked at when the menu -is popped up, however. - -<P>When the user picks an item off the menu, the item's callback is -done with the menu_button as the <tt>Fl_Widget*</tt> argument. If the item -does not have a callback the menu_button's callback is done instead. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Menu_Button.Fl_Menu_Button">Fl_Menu_Button</a> - <li><a href="#Fl_Menu_Button.~Fl_Menu_Button">~Fl_Menu_Button</a> - <li><a href="#Fl_Menu_Button.popup">popup</a> - <li><a href="#Fl_Menu_Button.type">type</a> -</ul> - -<h4><a name="Fl_Menu_Button.Fl_Menu_Button">Fl_Menu_Button::Fl_Menu_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Menu_Button</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_UP_BOX</tt>. - -<p>The constructor sets <tt>menu()</tt> to <tt>NULL</tt>. See <a -href="#Fl_Menu_"><tt>Fl_Menu_</tt></a> for the methods to set or change -the menu. - -<h4><a name="Fl_Menu_Button.~Fl_Menu_Button">virtual Fl_Menu_Button::~Fl_Menu_Button()</a></h4> - -The destructor removes the <tt>Fl_Menu_Button</tt> widget and all of its menu items. - -<h4><a name="Fl_Menu_Button.popup">const Fl_Menu* Fl_Menu_Button::popup()</a></h4> - -Act exactly as though the user clicked the button or typed the shortcut -key. The menu appears, it waits for the user to pick an item, and if -they pick one it sets <tt>value()</tt> and does the callback or sets -<tt>changed()</tt> as described above. The menu item is returned or -<tt>NULL<tt> if the user dismisses the menu. - -<h4><a name="Fl_Menu_Button.type">void Fl_Widget::type(uchar)</a></h4> - -If <tt>type()</tt> is zero a normal menu button is produced. If it is -nonzero then this is a pop-up menu. The bits in <tt>type()</tt> -indicate what mouse buttons pop up the menu. For convienece the -constants <tt>Fl_Menu_Button::POPUP1, POPUP2, POPUP3, POPUP12, POPUP13, -POPUP23</tt>, and <tt>POPUP123</tt> are defined. -<tt>Fl_Menu_Button::POPUP3</tt> is usually what you want. - -<p>A popup menu button is invisible and does not interfere with any -events other than the mouse button specified (and any shortcuts). The -widget can be stretched to cover all your other widgets by putting it last -in the hierarchy so it is "on top". You can also make several widgets -covering different areas for context-sensitive popup menus. - -<p>The popup menus appear with the cursor pointing at the previously -selected item. This is a <i>feature</i>. If you don't like it, do -<tt>value(0)</tt> after the menu items are picked to forget the current -item. - -</body> -</html> + The ''character in menu item names are only looked at when the menu is +popped up, however. </P> +<P>When the user picks an item off the menu, the item's callback is +done with the menu_button as the <TT>Fl_Widget*</TT> argument. If the +item does not have a callback the menu_button's callback is done +instead. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Menu_Button.Fl_Menu_Button>Fl_Menu_Button</A></LI> +<LI><A href=#Fl_Menu_Button.~Fl_Menu_Button>~Fl_Menu_Button</A></LI> +<LI><A href=#Fl_Menu_Button.popup>popup</A></LI> +<LI><A href=#Fl_Menu_Button.type>type</A></LI> +</UL> +<H4><A name=Fl_Menu_Button.Fl_Menu_Button> +Fl_Menu_Button::Fl_Menu_Button(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Menu_Button</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_UP_BOX</TT>. +<P>The constructor sets <TT>menu()</TT> to <TT>NULL</TT>. See <A href=Fl_Menu_.html#Fl_Menu_> +<TT>Fl_Menu_</TT></A> for the methods to set or change the menu. </P> +<H4><A name=Fl_Menu_Button.~Fl_Menu_Button>virtual +Fl_Menu_Button::~Fl_Menu_Button()</A></H4> + The destructor removes the <TT>Fl_Menu_Button</TT> widget and all of +its menu items. +<H4><A name=Fl_Menu_Button.popup>const Fl_Menu* Fl_Menu_Button::popup()</A> +</H4> + Act exactly as though the user clicked the button or typed the +shortcut key. The menu appears, it waits for the user to pick an item, +and if they pick one it sets <TT>value()</TT> and does the callback or +sets <TT>changed()</TT> as described above. The menu item is returned +or <TT>NULL<TT>if the user dismisses the menu. +<H4><A name=Fl_Menu_Button.type>void Fl_Widget::type(uchar)</A></H4> + If <TT>type()</TT> is zero a normal menu button is produced. If it is +nonzero then this is a pop-up menu. The bits in <TT>type()</TT> + indicate what mouse buttons pop up the menu. For convienece the +constants <TT>Fl_Menu_Button::POPUP1, POPUP2, POPUP3, POPUP12, POPUP13, +POPUP23</TT>, and <TT>POPUP123</TT> are defined. <TT> +Fl_Menu_Button::POPUP3</TT> is usually what you want. +<P>A popup menu button is invisible and does not interfere with any +events other than the mouse button specified (and any shortcuts). The +widget can be stretched to cover all your other widgets by putting it +last in the hierarchy so it is "on top". You can also make several +widgets covering different areas for context-sensitive popup menus. </P> +<P>The popup menus appear with the cursor pointing at the previously +selected item. This is a <I>feature</I>. If you don't like it, do <TT> +value(0)</TT> after the menu items are picked to forget the current +item. </P> +</TT></TT></BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Menu_Item.html b/documentation/Fl_Menu_Item.html index 4dc738c26..bdce5feb9 100644 --- a/documentation/Fl_Menu_Item.html +++ b/documentation/Fl_Menu_Item.html @@ -1,33 +1,27 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Menu_Item">struct Fl_Menu_Item</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Menu_Item>struct Fl_Menu_Item</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Menu_Item</b>----<a href="#Fl_Menu_">Fl_Menu_</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Menu_Item.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Menu_Item</tt> structure defines a single menu item that is -used by the <tt>Fl_Menu_</tt> class. This structure is defined in -<tt><FL/Fl_Menu_Item.H></tt> - -<ul><pre> + +----<B>Fl_Menu_Item</B>----<A href=Fl_Menu_.html#Fl_Menu_>Fl_Menu_</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Menu_Item.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Menu_Item</TT> structure defines a single menu item that is +used by the <TT>Fl_Menu_</TT> class. This structure is defined in <TT> +<FL/Fl_Menu_Item.H></TT> +<UL> +<PRE> struct Fl_Menu_Item { const char* text; // label() ulong shortcut_; @@ -51,316 +45,251 @@ enum { // values for flags: FL_MENU_DIVIDER = 0x80, FL_MENU_HORIZONTAL = 0x100 }; -</pre></ul> - -Typically menu items are statically defined; for example: - -<table> -<tr valign=top> - <td><img align=left src=menu.gif></td> - <td><pre> +</PRE> +</UL> + Typically menu items are statically defined; for example: +<TABLE> +<TR valign=top><TD><IMG align=left src=./menu.gif></TD><TD> +<PRE> Fl_Menu_Item popup[] = { - {"&alpha", FL_ALT+'a', the_cb, (void*)1}, - {"&beta", FL_ALT+'b', the_cb, (void*)2}, - {"gamma", FL_ALT+'c', the_cb, (void*)3, FL_MENU_DIVIDER}, - {"&strange", 0, strange_cb}, - {"&charm", 0, charm_cb}, - {"&truth", 0, truth_cb}, - {"b&eauty", 0, beauty_cb}, - {"sub&menu", 0, 0, 0, FL_SUBMENU}, - {"one"}, - {"two"}, - {"three"}, + {", FL_ALT+'a', the_cb, (void*)1}, + {", FL_ALT+'b', the_cb, (void*)2}, + {"gamma", FL_ALT+'c', the_cb, (void*)3, FL_MENU_DIVIDER}, + {", 0, strange_cb}, + {", 0, charm_cb}, + {", 0, truth_cb}, + {"b, 0, beauty_cb}, + {"sub, 0, 0, 0, FL_SUBMENU}, + {"one"}, + {"two"}, + {"three"}, {0}, - {"inactive", FL_ALT+'i', 0, 0, FL_MENU_INACTIVE|FL_MENU_DIVIDER}, - {"invisible",FL_ALT+'i', 0, 0, FL_MENU_INVISIBLE}, - {"check", FL_ALT+'i', 0, 0, FL_MENU_TOGGLE|FL_MENU_VALUE}, - {"box", FL_ALT+'i', 0, 0, FL_MENU_TOGGLE}, + {"inactive", FL_ALT+'i', 0, 0, FL_MENU_INACTIVE|FL_MENU_DIVIDER}, + {"invisible",FL_ALT+'i', 0, 0, FL_MENU_INVISIBLE}, + {"check", FL_ALT+'i', 0, 0, FL_MENU_TOGGLE|FL_MENU_VALUE}, + {"box", FL_ALT+'i', 0, 0, FL_MENU_TOGGLE}, {0}}; - </pre></td> -</tr> -</table> - -A submenu title is identified by the bit <tt>FL_SUBMENU</tt> in the -<tt>flags</tt> field, and ends with a <tt>label()</tt> that is -<tt>NULL</tt>. You can nest menus to any depth. A pointer to the -first item in the submenu can be treated as an <tt>Fl_Menu</tt> array -itself. It is also possible to make seperate submenu arrays with -<tt>FL_SUBMENU_POINTER</tt> flags. - -<p>You should use the method functions to access structure members and -not access them directly to avoid compatibility problems with future -releases of FLTK. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_Item.label">label</a> - <li><a href="#Fl_Menu_Item.labeltype">labeltype</a> - <li><a href="#Fl_Menu_Item.labelcolor">labelcolor</a> - <li><a href="#Fl_Menu_Item.labelfont">labelfont</a> - <li><a href="#Fl_Menu_Item.labelsize">labelsize</a> - <li><a href="#Fl_Menu_Item.callback">callback</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_Item.user_data">user_data</a> - <li><a href="#Fl_Menu_Item.argument">argument</a> - <li><a href="#Fl_Menu_Item.do_callback">do_callback</a> - <li><a href="#Fl_Menu_Item.shortcut">shortcut</a> - <li><a href="#Fl_Menu_Item.submenu">submenu</a> - <li><a href="#Fl_Menu_Item.checkbox">checkbox</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_Item.radio">radio</a> - <li><a href="#Fl_Menu_Item.value">value</a> - <li><a href="#Fl_Menu_Item.set">set</a> - <li><a href="#Fl_Menu_Item.setonly">setonly</a> - <li><a href="#Fl_Menu_Item.clear">clear</a> - <li><a href="#Fl_Menu_Item.visible">visible</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_Item.show">show</a> - <li><a href="#Fl_Menu_Item.hide">hide</a> - <li><a href="#Fl_Menu_Item.active">active</a> - <li><a href="#Fl_Menu_Item.activate">activate</a> - <li><a href="#Fl_Menu_Item.deactivate">deactivate</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Menu_Item.popup">popup</a> - <li><a href="#Fl_Menu_Item.pulldown">pulldown</a> - <li><a href="#Fl_Menu_Item.test_shortcut">test_shortcut</a> - <li><a href="#Fl_Menu_Item.size">size</a> - <li><a href="#Fl_Menu_Item.next">next</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Menu_Item.label">const char* Fl_Menu_Item::label() const<br> -void Fl_Menu_Item::label(const char*)<br> -void Fl_Menu_Item::label(Fl_Labeltype, const char*)</a></h4> - -This is the title of the item. A <tt>NULL</tt> here indicates the end of the -menu (or of a submenu). A '&' in the item will print an underscore -under the next letter, and if the menu is popped up that letter will -be a "shortcut" to pick that item. To get a real '&' put two in a -row. - -<h4><a name="Fl_Menu_Item.labeltype">Fl_Labeltype Fl_Menu_Item::labeltype() const<br> -void Fl_Menu_Item::labeltype(Fl_Labeltype)</a></h4> - -A <tt>labeltype</tt> identifies a routine that draws the label of the -widget. This can be used for special effects such as emboss, or to use -the <tt>label()</tt> pointer as another form of data such as a bitmap. -The value <tt>FL_NORMAL_LABEL</tt> prints the label as text. - -<h4><a name="Fl_Menu_Item.labelcolor">Fl_Color Fl_Menu_Item::labelcolor() const<br> -void Fl_Menu_Item::labelcolor(Fl_Color)</a></h4> - -This color is passed to the labeltype routine, and is typically the -color of the label text. This defaults to <tt>FL_BLACK</tt>. If this -color is not black fltk will <i>not</i> use overlay bitplanes to draw -the menu - this is so that images put in the menu draw correctly. - -<h4><a name="Fl_Menu_Item.labelfont">Fl_Font Fl_Menu_Item::labelfont() const<br> -void Fl_Menu_Item::labelfont(Fl_Font)</a></h4> - -Fonts are identified by small 8-bit indexes into a table. See the <a -href="#Enumerations">enumeration list</a> for predefined fonts. The -default value is a Helvetica font. The function <a -href="#set_font"><tt>Fl::set_font()</tt></a> can define new fonts. - -<h4><a name="Fl_Menu_Item.labelsize">uchar Fl_Menu_Item::labelsize() const<br> -void Fl_Menu_Item::labelsize(uchar)</a></h4> - -Gets or sets the label font pixel size/height. - -<h4><a name="Fl_Menu_Item.callback">typedef void (Fl_Callback)(Fl_Widget*, void*)<br> -Fl_Callback* Fl_Menu_Item::callback() const<br> -void Fl_Menu_Item::callback(Fl_Callback*, void* = 0)<br> -void Fl_Menu_Item::callback(void (*)(Fl_Widget*))</a></h4> - -Each item has space for a callback function and an argument for that -function. Due to back compatability, the <tt>Fl_Menu_Item</tt> itself -is not passed to the callback, instead you have to get it by calling -<tt>((Fl_Menu_*)w)->mvalue()</tt> where <tt>w</tt> is the widget -argument. - -<h4><a name="Fl_Menu_Item.user_data">void* Fl_Menu_Item::user_data() const<br> -void Fl_Menu_Item::user_data(void*)</a></h4> - -Get or set the <tt>user_data</tt> argument that is sent to the callback -function. - -<h4><a name="Fl_Menu_Item.argument">void Fl_Menu_Item::callback(void (*)(Fl_Widget*, long), long = 0)<br> -long Fl_Menu_Item::argument() const<br> -void Fl_Menu_Item::argument(long)</a></h4> - -For convenience you can also define the callback as taking a -<tt>long</tt> argument. This is implemented by casting this to a -<tt>Fl_Callback</tt> and casting the <tt>long</tt> to a <tt>void*</tt> -and may not be portable to some machines. - -<h4><a name="Fl_Menu_Item.do_callback">void Fl_Menu_Item::do_callback(Fl_Widget*)<br> -void Fl_Menu_Item::do_callback(Fl_Widget*, void*)<br> -void Fl_Menu_Item::do_callback(Fl_Widget*, long)</a></h4> - -Call the <tt>Fl_Menu_Item</tt> item's callback, and provide the -<tt>Fl_Widget</tt> argument (and optionally override the user_data() -argument). You must first check that <tt>callback()</tt> is non-zero before -calling this. - -<h4><a name="Fl_Menu_Item.shortcut">ulong Fl_Menu_Item::shortcut() const<br> -void Fl_Menu_Item::shortcut(ulong)</a></h4> - -Sets exactly what key combination will trigger the menu item. The -value is a logical 'or' of a key and a set of shift flags, for -instance <tt>FL_ALT+'a'</tt> or <tt>FL_ALT+FL_F+10</tt> or -just 'a'. A value of zero disables the shortcut. - -<p>The key can be any value returned by <a -href="#event_key"><tt>Fl::event_key()</tt></a>, but will usually be an -ASCII letter. Use a lower-case letter unless you require the shift key -to be held down. - -<p>The shift flags can be any set of values accepted by <a -href="#event_state"><tt>Fl::event_state()</tt></a>. If the bit is on -that shift key must be pushed. Meta, Alt, Ctrl, and Shift must be off -if they are not in the shift flags (zero for the other bits indicates -a "don't care" setting). - -<h4><a name="Fl_Menu_Item.submenu">int Fl_Menu_Item::submenu() const</a></h4> - -Returns true if either <tt>FL_SUBMENU</tt> or -<tt>FL_SUBMENU_POINTER</tt> is on in the flags. <tt>FL_SUBMENU</tt> -indicates an embedded submenu that goes from the next item through the -next one with a <tt>NULL</tt> <tt>label()</tt>. -<tt>FL_SUBMENU_POINTER</tt> indicates that <tt>user_data()</tt> is a -pointer to another menu array. - -<h4><a name="Fl_Menu_Item.checkbox">int Fl_Menu_Item::checkbox() const</a></h4> - -Returns true if a checkbox will be drawn next to this item. This is -true if <tt>FL_MENU_TOGGLE</tt> or <tt>FL_MENU_RADIO</tt> is set in the flags. - -<h4><a name="Fl_Menu_Item.radio">int Fl_Menu_Item::radio() const</a></h4> - -Returns true if this item is a radio item. When a radio button is -selected all "adjacent" radio buttons are turned off. A set of radio -items is delimited by an item that has <tt>radio()</tt> false, or by an item -with <tt>FL_MENU_DIVIDER</tt> turned on. - -<h4><a name="Fl_Menu_Item.value">int Fl_Menu_Item::value() const</a></h4> - -Returns the current value of the check or radio item. - -<h4><a name="Fl_Menu_Item.set">void Fl_Menu_Item::set()</a></h4> - -Turns the check or radio item "on" for the menu item. Note that this does not -turn off any adjacent radio items like <tt>set_only()</tt> does. - -<h4><a name="Fl_Menu_Item.setonly">void Fl_Menu_Item::setonly()</a></h4> - -Turns the radio item "on" for the menu item and turns off adjacent radio -item. - -<h4><a name="Fl_Menu_Item.clear">void Fl_Menu_Item::clear()</a></h4> - -Turns the check or radio item "off" for the menu item. - -<h4><a name="Fl_Menu_Item.visible">int Fl_Menu_Item::visible() const</a></h4> - -Gets the visibility of an item. - -<h4><a name="Fl_Menu_Item.show">void Fl_Menu_Item::show()</a></h4> - -Makes an item visible in the menu. - -<h4><a name="Fl_Menu_Item.hide">void Fl_Menu_Item::hide()</a></h4> - -Hides an item in the menu. - -<h4><a name="Fl_Menu_Item.active">int Fl_Menu_Item::active() const</a></h4> - -Get whether or not the item can be picked. - -<h4><a name="Fl_Menu_Item.activate">void Fl_Menu_Item::activate()</a></h4> - -Allows a menu item to be picked. - -<h4><a name="Fl_Menu_Item.deactivate">void Fl_Menu_Item::deactivate()</a></h4> - -Prevents a menu item from being picked. Note that this will also cause the -menu item to appear grayed-out. - -<h4><a name="Fl_Menu_Item.popup">const Fl_Menu_Item *Fl_Menu_Item::popup(int X, int Y, const char* title = 0, const Fl_Menu_Item* picked = 0, const Fl_Menu_* button = 0) const</a></h4> - -This method is called by widgets that want to display menus. The menu -stays up until the user picks an item or dismisses it. The selected -item (or <tt>NULL</tt> if none) is returned. <i>This does not do the -callbacks or change the state of check or radio items.</i> - -<p><tt>X,Y</tt> is the position of the mouse cursor, relative to the -window that got the most recent event (usually you can pass -<tt>Fl::event_x()</tt> and <tt>Fl::event_y()</tt> unchanged here). - -<p><tt>title</tt> is a character string title for the menu. If non-zero -a small box appears above the menu with the title in it. - -<p>The menu is positioned so the cursor is centered over the item -<tt>picked</tt>. This will work even if <tt>picked</tt> is in a submenu. -If <tt>picked</tt> is zero or not in the menu item table the menu is -positioned with the cursor in the top-left corner. - -<p><tt>button</tt> is a pointer to an <a href="#Fl_Menu_"><tt>Fl_Menu_</tt></a> -from which the color and boxtypes for the menu are pulled. If <tt>NULL</tt> -then defaults are used. - -<h4><a name="Fl_Menu_Item.pulldown">const Fl_Menu_Item *Fl_Menu_Item::pulldown(int X, int Y, int W, int H, const Fl_Menu_Item* picked = 0, const Fl_Menu_* button = 0, const Fl_Menu_Item* title = 0, int menubar=0) const</a></h4> - -<tt>pulldown()</tt> is similar to <tt>popup()</tt>, but a rectangle is -provided to position the menu. The menu is made at least <tt>W</tt> -wide, and the <tt>picked</tt> item is centered over the rectangle (like -<tt>Fl_Choice</tt> uses). If <tt>picked</tt> is zero or not found, the -menu is aligned just below the rectangle (like a pulldown menu). - -<p>The <tt>title</tt> and <tt>menubar</tt> arguments are used internally by -the <tt>Fl_Menu_</tt> widget. - -<h4><a name="Fl_Menu_Item.test_shortcut">const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const</a></h4> - -This is designed to be called by a widgets <tt>handle()</tt> method in -response to a <tt>FL_SHORTCUT</tt> event. If the current event matches -one of the items shortcut, that item is returned. If the keystroke -does not match any shortcuts then <tt>NULL</tt> is returned. This only -matches the <tt>shortcut()</tt> fields, not the letters in the title -preceeded by '&'. - -<h4><a name="Fl_Menu_Item.size">int Fl_Menu_Item::size()</a></h4> - -Return the offset of the <tt>NULL</tt> terminator that ends this menu, -correctly skipping over submenus. To copy a menu you should copy -<tt>size() + 1</tt> structures. - -<h4><a name="Fl_Menu_Item.next">const Fl_Menu_Item* Fl_Menu_Item::next(int n=1) const<br> -Fl_Menu_Item* Fl_Menu_Item::next(int n=1);</a></h4> - -Advance a pointer by <tt>n</tt> items through a menu array, skipping the -contents of submenus and invisible items. There are two calls so that -you can advance through const and non-const data. - -</body> -</html> + </PRE> +</TD></TR> +</TABLE> + A submenu title is identified by the bit <TT>FL_SUBMENU</TT> in the <TT> +flags</TT> field, and ends with a <TT>label()</TT> that is <TT>NULL</TT> +. You can nest menus to any depth. A pointer to the first item in the +submenu can be treated as an <TT>Fl_Menu</TT> array itself. It is also +possible to make seperate submenu arrays with <TT>FL_SUBMENU_POINTER</TT> + flags. +<P>You should use the method functions to access structure members and +not access them directly to avoid compatibility problems with future +releases of FLTK. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_Item.label>label</A></LI> +<LI><A href=#Fl_Menu_Item.labeltype>labeltype</A></LI> +<LI><A href=#Fl_Menu_Item.labelcolor>labelcolor</A></LI> +<LI><A href=#Fl_Menu_Item.labelfont>labelfont</A></LI> +<LI><A href=#Fl_Menu_Item.labelsize>labelsize</A></LI> +<LI><A href=#Fl_Menu_Item.callback>callback</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_Item.user_data>user_data</A></LI> +<LI><A href=#Fl_Menu_Item.argument>argument</A></LI> +<LI><A href=#Fl_Menu_Item.do_callback>do_callback</A></LI> +<LI><A href=#Fl_Menu_Item.shortcut>shortcut</A></LI> +<LI><A href=#Fl_Menu_Item.submenu>submenu</A></LI> +<LI><A href=#Fl_Menu_Item.checkbox>checkbox</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_Item.radio>radio</A></LI> +<LI><A href=#Fl_Menu_Item.value>value</A></LI> +<LI><A href=#Fl_Menu_Item.set>set</A></LI> +<LI><A href=#Fl_Menu_Item.setonly>setonly</A></LI> +<LI><A href=#Fl_Menu_Item.clear>clear</A></LI> +<LI><A href=#Fl_Menu_Item.visible>visible</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_Item.show>show</A></LI> +<LI><A href=#Fl_Menu_Item.hide>hide</A></LI> +<LI><A href=#Fl_Menu_Item.active>active</A></LI> +<LI><A href=#Fl_Menu_Item.activate>activate</A></LI> +<LI><A href=#Fl_Menu_Item.deactivate>deactivate</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Menu_Item.popup>popup</A></LI> +<LI><A href=#Fl_Menu_Item.pulldown>pulldown</A></LI> +<LI><A href=#Fl_Menu_Item.test_shortcut>test_shortcut</A></LI> +<LI><A href=#Fl_Menu_Item.size>size</A></LI> +<LI><A href=#Fl_Menu_Item.next>next</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Menu_Item.label>const char* Fl_Menu_Item::label() const +<BR> void Fl_Menu_Item::label(const char*) +<BR> void Fl_Menu_Item::label(Fl_Labeltype, const char*)</A></H4> + This is the title of the item. A <TT>NULL</TT> here indicates the end +of the menu (or of a submenu). A ''in the item will print an +underscore under the next letter, and if the menu is popped up that +letter will be a "shortcut" to pick that item. To get a real ''put two +in a row. +<H4><A name=Fl_Menu_Item.labeltype>Fl_Labeltype +Fl_Menu_Item::labeltype() const +<BR> void Fl_Menu_Item::labeltype(Fl_Labeltype)</A></H4> + A <TT>labeltype</TT> identifies a routine that draws the label of the +widget. This can be used for special effects such as emboss, or to use +the <TT>label()</TT> pointer as another form of data such as a bitmap. + The value <TT>FL_NORMAL_LABEL</TT> prints the label as text. +<H4><A name=Fl_Menu_Item.labelcolor>Fl_Color Fl_Menu_Item::labelcolor() +const +<BR> void Fl_Menu_Item::labelcolor(Fl_Color)</A></H4> + This color is passed to the labeltype routine, and is typically the +color of the label text. This defaults to <TT>FL_BLACK</TT>. If this +color is not black fltk will <I>not</I> use overlay bitplanes to draw +the menu - this is so that images put in the menu draw correctly. +<H4><A name=Fl_Menu_Item.labelfont>Fl_Font Fl_Menu_Item::labelfont() +const +<BR> void Fl_Menu_Item::labelfont(Fl_Font)</A></H4> + Fonts are identified by small 8-bit indexes into a table. See the <A href=enumerations.html#Enumerations> +enumeration list</A> for predefined fonts. The default value is a +Helvetica font. The function <A href=functions.html#set_font><TT> +Fl::set_font()</TT></A> can define new fonts. +<H4><A name=Fl_Menu_Item.labelsize>uchar Fl_Menu_Item::labelsize() const +<BR> void Fl_Menu_Item::labelsize(uchar)</A></H4> + Gets or sets the label font pixel size/height. +<H4><A name=Fl_Menu_Item.callback>typedef void +(Fl_Callback)(Fl_Widget*, void*) +<BR> Fl_Callback* Fl_Menu_Item::callback() const +<BR> void Fl_Menu_Item::callback(Fl_Callback*, void* = 0) +<BR> void Fl_Menu_Item::callback(void (*)(Fl_Widget*))</A></H4> + Each item has space for a callback function and an argument for that +function. Due to back compatability, the <TT>Fl_Menu_Item</TT> itself +is not passed to the callback, instead you have to get it by calling <TT> +((Fl_Menu_*)w)->mvalue()</TT> where <TT>w</TT> is the widget argument. +<H4><A name=Fl_Menu_Item.user_data>void* Fl_Menu_Item::user_data() const +<BR> void Fl_Menu_Item::user_data(void*)</A></H4> + Get or set the <TT>user_data</TT> argument that is sent to the +callback function. +<H4><A name=Fl_Menu_Item.argument>void Fl_Menu_Item::callback(void +(*)(Fl_Widget*, long), long = 0) +<BR> long Fl_Menu_Item::argument() const +<BR> void Fl_Menu_Item::argument(long)</A></H4> + For convenience you can also define the callback as taking a <TT>long</TT> + argument. This is implemented by casting this to a <TT>Fl_Callback</TT> + and casting the <TT>long</TT> to a <TT>void*</TT> and may not be +portable to some machines. +<H4><A name=Fl_Menu_Item.do_callback>void +Fl_Menu_Item::do_callback(Fl_Widget*) +<BR> void Fl_Menu_Item::do_callback(Fl_Widget*, void*) +<BR> void Fl_Menu_Item::do_callback(Fl_Widget*, long)</A></H4> + Call the <TT>Fl_Menu_Item</TT> item's callback, and provide the <TT> +Fl_Widget</TT> argument (and optionally override the user_data() +argument). You must first check that <TT>callback()</TT> is non-zero +before calling this. +<H4><A name=Fl_Menu_Item.shortcut>ulong Fl_Menu_Item::shortcut() const +<BR> void Fl_Menu_Item::shortcut(ulong)</A></H4> + Sets exactly what key combination will trigger the menu item. The +value is a logical 'or' of a key and a set of shift flags, for instance <TT> +FL_ALT+'a'</TT> or <TT>FL_ALT+FL_F+10</TT> or just 'a'. A value of +zero disables the shortcut. +<P>The key can be any value returned by <A href=functions.html#event_key> +<TT>Fl::event_key()</TT></A>, but will usually be an ASCII letter. Use +a lower-case letter unless you require the shift key to be held down. </P> +<P>The shift flags can be any set of values accepted by <A href=events.html#event_state> +<TT>Fl::event_state()</TT></A>. If the bit is on that shift key must +be pushed. Meta, Alt, Ctrl, and Shift must be off if they are not in +the shift flags (zero for the other bits indicates a "don't care" +setting). </P> +<H4><A name=Fl_Menu_Item.submenu>int Fl_Menu_Item::submenu() const</A></H4> + Returns true if either <TT>FL_SUBMENU</TT> or <TT>FL_SUBMENU_POINTER</TT> + is on in the flags. <TT>FL_SUBMENU</TT> indicates an embedded submenu +that goes from the next item through the next one with a <TT>NULL</TT><TT> +label()</TT>. <TT>FL_SUBMENU_POINTER</TT> indicates that <TT>user_data()</TT> + is a pointer to another menu array. +<H4><A name=Fl_Menu_Item.checkbox>int Fl_Menu_Item::checkbox() const</A></H4> + Returns true if a checkbox will be drawn next to this item. This is +true if <TT>FL_MENU_TOGGLE</TT> or <TT>FL_MENU_RADIO</TT> is set in the +flags. +<H4><A name=Fl_Menu_Item.radio>int Fl_Menu_Item::radio() const</A></H4> + Returns true if this item is a radio item. When a radio button is +selected all "adjacent" radio buttons are turned off. A set of radio +items is delimited by an item that has <TT>radio()</TT> false, or by an +item with <TT>FL_MENU_DIVIDER</TT> turned on. +<H4><A name=Fl_Menu_Item.value>int Fl_Menu_Item::value() const</A></H4> + Returns the current value of the check or radio item. +<H4><A name=Fl_Menu_Item.set>void Fl_Menu_Item::set()</A></H4> + Turns the check or radio item "on" for the menu item. Note that this +does not turn off any adjacent radio items like <TT>set_only()</TT> + does. +<H4><A name=Fl_Menu_Item.setonly>void Fl_Menu_Item::setonly()</A></H4> + Turns the radio item "on" for the menu item and turns off adjacent +radio item. +<H4><A name=Fl_Menu_Item.clear>void Fl_Menu_Item::clear()</A></H4> + Turns the check or radio item "off" for the menu item. +<H4><A name=Fl_Menu_Item.visible>int Fl_Menu_Item::visible() const</A></H4> + Gets the visibility of an item. +<H4><A name=Fl_Menu_Item.show>void Fl_Menu_Item::show()</A></H4> + Makes an item visible in the menu. +<H4><A name=Fl_Menu_Item.hide>void Fl_Menu_Item::hide()</A></H4> + Hides an item in the menu. +<H4><A name=Fl_Menu_Item.active>int Fl_Menu_Item::active() const</A></H4> + Get whether or not the item can be picked. +<H4><A name=Fl_Menu_Item.activate>void Fl_Menu_Item::activate()</A></H4> + Allows a menu item to be picked. +<H4><A name=Fl_Menu_Item.deactivate>void Fl_Menu_Item::deactivate()</A></H4> + Prevents a menu item from being picked. Note that this will also cause +the menu item to appear grayed-out. +<H4><A name=Fl_Menu_Item.popup>const Fl_Menu_Item +*Fl_Menu_Item::popup(int X, int Y, const char* title = 0, const +Fl_Menu_Item* picked = 0, const Fl_Menu_* button = 0) const</A></H4> + This method is called by widgets that want to display menus. The menu +stays up until the user picks an item or dismisses it. The selected +item (or <TT>NULL</TT> if none) is returned. <I>This does not do the +callbacks or change the state of check or radio items.</I> +<P><TT>X,Y</TT> is the position of the mouse cursor, relative to the +window that got the most recent event (usually you can pass <TT> +Fl::event_x()</TT> and <TT>Fl::event_y()</TT> unchanged here). </P> +<P><TT>title</TT> is a character string title for the menu. If +non-zero a small box appears above the menu with the title in it. </P> +<P>The menu is positioned so the cursor is centered over the item <TT> +picked</TT>. This will work even if <TT>picked</TT> is in a submenu. +If <TT>picked</TT> is zero or not in the menu item table the menu is +positioned with the cursor in the top-left corner. </P> +<P><TT>button</TT> is a pointer to an <A href=Fl_Menu_.html#Fl_Menu_><TT> +Fl_Menu_</TT></A> from which the color and boxtypes for the menu are +pulled. If <TT>NULL</TT> then defaults are used. </P> +<H4><A name=Fl_Menu_Item.pulldown>const Fl_Menu_Item +*Fl_Menu_Item::pulldown(int X, int Y, int W, int H, const Fl_Menu_Item* +picked = 0, const Fl_Menu_* button = 0, const Fl_Menu_Item* title = 0, +int menubar=0) const</A></H4> +<TT>pulldown()</TT> is similar to <TT>popup()</TT>, but a rectangle is +provided to position the menu. The menu is made at least <TT>W</TT> + wide, and the <TT>picked</TT> item is centered over the rectangle +(like <TT>Fl_Choice</TT> uses). If <TT>picked</TT> is zero or not +found, the menu is aligned just below the rectangle (like a pulldown +menu). +<P>The <TT>title</TT> and <TT>menubar</TT> arguments are used +internally by the <TT>Fl_Menu_</TT> widget. </P> +<H4><A name=Fl_Menu_Item.test_shortcut>const Fl_Menu_Item* +Fl_Menu_Item::test_shortcut() const</A></H4> + This is designed to be called by a widgets <TT>handle()</TT> method in +response to a <TT>FL_SHORTCUT</TT> event. If the current event matches +one of the items shortcut, that item is returned. If the keystroke +does not match any shortcuts then <TT>NULL</TT> is returned. This only +matches the <TT>shortcut()</TT> fields, not the letters in the title +preceeded by ' +<H4><A name=Fl_Menu_Item.size>int Fl_Menu_Item::size()</A></H4> + Return the offset of the <TT>NULL</TT> terminator that ends this menu, +correctly skipping over submenus. To copy a menu you should copy <TT> +size() + 1</TT> structures. +<H4><A name=Fl_Menu_Item.next>const Fl_Menu_Item* +Fl_Menu_Item::next(int n=1) const +<BR> Fl_Menu_Item* Fl_Menu_Item::next(int n=1);</A></H4> + Advance a pointer by <TT>n</TT> items through a menu array, skipping +the contents of submenus and invisible items. There are two calls so +that you can advance through const and non-const data. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Menu_Window.html b/documentation/Fl_Menu_Window.html index a58017f96..3772e328c 100644 --- a/documentation/Fl_Menu_Window.html +++ b/documentation/Fl_Menu_Window.html @@ -1,59 +1,45 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Menu_Window">class Fl_Menu_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Single_Window">Fl_Single_Window</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Menu_Window>class Fl_Menu_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Single_Window.html#Fl_Single_Window>Fl_Single_Window</A> | - +----<b>Fl_Menu_Window</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Menu_Window.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Menu_Window</tt> widget is a window type used for menus. By -default the window is drawn in the hardware overlay planes if they are -available so that the menu don't force the rest of the window to -redraw. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Menu_Window.Fl_Menu_Window">Fl_Menu_Window</a> - <li><a href="#Fl_Menu_Window.~Fl_Menu_Window">~Fl_Menu_Window</a> - <li><a href="#Fl_Menu_Window.clear_overlay">clear_overlay</a> - <li><a href="#Fl_Menu_Window.set_overlay">set_overlay</a> -</ul> - -<h4><a name="Fl_Menu_Window.Fl_Menu_Window">Fl_Menu_Window::Fl_Menu_Window(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Menu_Window</tt> widget using the given position, size, and -label string. - -<h4><a name="Fl_Menu_Window.~Fl_Menu_Window">virtual Fl_Menu_Window::~Fl_Menu_Window()</a></h4> - -Destroys the window and all of its children. - -<h4><a name="Fl_Menu_Window.clear_overlay">Fl_Menu_Window::clear_overlay();</a></h4> - -Tells FLTK to use normal drawing planes instead of overlay planes. This is -usually necessary if your menu contains multi-color pixmaps. - -<h4><a name="Fl_Menu_Window.set_overlay">Fl_Menu_Window::set_overlay()</a></h4> - -Tells FLTK to use hardware overlay planes if they are available. - -</body> -</html> + +----<B>Fl_Menu_Window</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Menu_Window.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Menu_Window</TT> widget is a window type used for menus. By +default the window is drawn in the hardware overlay planes if they are +available so that the menu don't force the rest of the window to +redraw. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Menu_Window.Fl_Menu_Window>Fl_Menu_Window</A></LI> +<LI><A href=#Fl_Menu_Window.~Fl_Menu_Window>~Fl_Menu_Window</A></LI> +<LI><A href=#Fl_Menu_Window.clear_overlay>clear_overlay</A></LI> +<LI><A href=#Fl_Menu_Window.set_overlay>set_overlay</A></LI> +</UL> +<H4><A name=Fl_Menu_Window.Fl_Menu_Window> +Fl_Menu_Window::Fl_Menu_Window(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Menu_Window</TT> widget using the given position, +size, and label string. +<H4><A name=Fl_Menu_Window.~Fl_Menu_Window>virtual +Fl_Menu_Window::~Fl_Menu_Window()</A></H4> + Destroys the window and all of its children. +<H4><A name=Fl_Menu_Window.clear_overlay> +Fl_Menu_Window::clear_overlay();</A></H4> + Tells FLTK to use normal drawing planes instead of overlay planes. +This is usually necessary if your menu contains multi-color pixmaps. +<H4><A name=Fl_Menu_Window.set_overlay>Fl_Menu_Window::set_overlay()</A></H4> + Tells FLTK to use hardware overlay planes if they are available. </BODY> +</HTML>
\ No newline at end of file diff --git a/documentation/Fl_Multi_Browser.html b/documentation/Fl_Multi_Browser.html index fb868c42d..f02b4e27b 100644 --- a/documentation/Fl_Multi_Browser.html +++ b/documentation/Fl_Multi_Browser.html @@ -1,73 +1,56 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Multi_Browser">class Fl_Multi_Browser</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Browser">Fl_Browser</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Multi_Browser>class Fl_Multi_Browser</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Browser.html#Fl_Browser>Fl_Browser</A> | - +----<b>Fl_Multi_Browser</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Multi_Browser.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Multi_Browser</tt> class is a subclass of -<tt>Fl_Browser</tt> which lets the user select any set of the lines. -The user interface is Macintosh style: clicking an item turns off all -the others and selects that one, dragging selects all the items the -mouse moves over, and shift + click toggles the items. This is -different then how forms did it. Normally the callback is done when -the user releases the mouse, but you can change this with -<tt>when()</tt>. - -<p>See <a href="#Fl_Browser"><tt>Fl_Browser</tt></a> for methods to add -and remove lines from the browser. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Multi_Browser.Fl_Multi_Browser">Fl_Multi_Browser</a> - <li><a href="#Fl_Multi_Browser.~Fl_Multi_Browser">~Fl_Multi_Browser</a> - <li><a href="#Fl_Multi_Browser.deselect">deselect</a> - <li><a href="#Fl_Multi_Browser.select">select</a> - <li><a href="#Fl_Multi_Browser.value">value</a> -</ul> - -<h4><a name="Fl_Multi_Browser.Fl_Multi_Browser">Fl_Multi_Browser::Fl_Multi_Browser(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Multi_Browser</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Multi_Browser.~Fl_Multi_Browser">virtual Fl_Multi_Browser::~Fl_Multi_Browser()</a></h4> - -The destructor <i>also deletes all the items in the list</i>. - -<h4><a name="Fl_Multi_Browser.deselect">int Fl_Browser::deselect()</a></h4> - -Deselects all lines. - -<h4><a name="Fl_Multi_Browser.select">int Fl_Browser::select(int,int=1)<br> -int Fl_Browser::selected(int) const</a></h4> - -Selects one or more lines or gets the current selection state of a line. - -<h4><a name="Fl_Multi_Browser.value">int Fl_Browser::value() const<br> -void Fl_Browser::value(int)</a></h4> - -Selects a single line or gets the last toggled line. This returns zero -if no line has been toggled, so be aware that this can happen in a callback. - -</body> -</html> + +----<B>Fl_Multi_Browser</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Multi_Browser.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Multi_Browser</TT> class is a subclass of <TT>Fl_Browser</TT> + which lets the user select any set of the lines. The user interface +is Macintosh style: clicking an item turns off all the others and +selects that one, dragging selects all the items the mouse moves over, +and shift + click toggles the items. This is different then how forms +did it. Normally the callback is done when the user releases the +mouse, but you can change this with <TT>when()</TT>. +<P>See <A href=Fl_Browser.html#Fl_Browser><TT>Fl_Browser</TT></A> for +methods to add and remove lines from the browser. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Multi_Browser.Fl_Multi_Browser>Fl_Multi_Browser</A></LI> +<LI><A href=#Fl_Multi_Browser.~Fl_Multi_Browser>~Fl_Multi_Browser</A></LI> +<LI><A href=#Fl_Multi_Browser.deselect>deselect</A></LI> +<LI><A href=#Fl_Multi_Browser.select>select</A></LI> +<LI><A href=#Fl_Multi_Browser.value>value</A></LI> +</UL> +<H4><A name=Fl_Multi_Browser.Fl_Multi_Browser> +Fl_Multi_Browser::Fl_Multi_Browser(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Multi_Browser</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Multi_Browser.~Fl_Multi_Browser>virtual +Fl_Multi_Browser::~Fl_Multi_Browser()</A></H4> + The destructor <I>also deletes all the items in the list</I>. +<H4><A name=Fl_Multi_Browser.deselect>int Fl_Browser::deselect()</A></H4> + Deselects all lines. +<H4><A name=Fl_Multi_Browser.select>int Fl_Browser::select(int,int=1) +<BR> int Fl_Browser::selected(int) const</A></H4> + Selects one or more lines or gets the current selection state of a +line. +<H4><A name=Fl_Multi_Browser.value>int Fl_Browser::value() const +<BR> void Fl_Browser::value(int)</A></H4> + Selects a single line or gets the last toggled line. This returns zero +if no line has been toggled, so be aware that this can happen in a +callback. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Multiline_Input.html b/documentation/Fl_Multiline_Input.html index 1b157eace..278b591a3 100644 --- a/documentation/Fl_Multiline_Input.html +++ b/documentation/Fl_Multiline_Input.html @@ -1,53 +1,43 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Multiline_Input">class Fl_Multiline_Input</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Input">Fl_Input</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Multiline_Input>class Fl_Multiline_Input</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=functions.html#Fl_Input>Fl_Input</A> | - +----<b>Fl_Multiline_Input</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Input.H> -</pre></ul> - -<h3>Description</h3> - -This input field displays '\n' characters as new lines rather than ^J, -and accepts the Return, Tab, and up and down arrow keys. This is for -editing multiline text. - -<p>This is far from the nirvana of text editors, and is probably only -good for small bits of text, 10 lines at most. I think FLTK can be -used to write a powerful text editor, but it is not going to be a -built-in feature. Powerful text editors in a toolkit are a big source -of bloat. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Multiline_Input.Fl_Multiline_Input">Fl_Multiline_Input</a> - <li><a href="#Fl_Multiline_Input.~Fl_Multiline_Input">~Fl_Multiline_Input</a> -</ul> - -<h4><a name="Fl_Multiline_Input.Fl_Multiline_Input">Fl_Multiline_Input::Fl_Multiline_Input(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Multiline_Input</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Multiline_Input.~Fl_Multiline_Input">virtual Fl_Multiline_Input::~Fl_Multiline_Input()</a></h4> - -Destroys the widget and any value associated with it. - -</body> -</html> + +----<B>Fl_Multiline_Input</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Input.H> +</PRE> +</UL> +<H3>Description</H3> + This input field displays '\n' characters as new lines rather than ^J, +and accepts the Return, Tab, and up and down arrow keys. This is for +editing multiline text. +<P>This is far from the nirvana of text editors, and is probably only +good for small bits of text, 10 lines at most. I think FLTK can be +used to write a powerful text editor, but it is not going to be a +built-in feature. Powerful text editors in a toolkit are a big source +of bloat. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Multiline_Input.Fl_Multiline_Input>Fl_Multiline_Input</A> +</LI> +<LI><A href=#Fl_Multiline_Input.~Fl_Multiline_Input>~Fl_Multiline_Input</A> +</LI> +</UL> +<H4><A name=Fl_Multiline_Input.Fl_Multiline_Input> +Fl_Multiline_Input::Fl_Multiline_Input(int x, int y, int w, int h, +const char *label = 0)</A></H4> + Creates a new <TT>Fl_Multiline_Input</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Multiline_Input.~Fl_Multiline_Input>virtual +Fl_Multiline_Input::~Fl_Multiline_Input()</A></H4> + Destroys the widget and any value associated with it. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Multiline_Output.html b/documentation/Fl_Multiline_Output.html index d6d53bd24..19445661d 100644 --- a/documentation/Fl_Multiline_Output.html +++ b/documentation/Fl_Multiline_Output.html @@ -1,46 +1,38 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Multiline_Output">class Fl_Multiline_Output</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Output">Fl_Output</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Multiline_Output>class Fl_Multiline_Output</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Output.html#Fl_Output>Fl_Output</A> | - +----<b>Fl_Multiline_Output</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Multiline_Output.H> -</pre></ul> - -<h3>Description</h3> - -This widget is a subclass of <tt>Fl_Output</tt> that displays multiple lines -of text. It also displays tab characters as whitespace to the next column. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Multiline_Output.Fl_Multiline_Output">Fl_Multiline_Output</a> - <li><a href="#Fl_Multiline_Output.~Fl_Multiline_Output">~Fl_Multiline_Output</a> -</ul> - -<h4><a name="Fl_Multiline_Output.Fl_Multiline_Output">Fl_Multiline_Output::Fl_Multiline_Output(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Multiline_Output</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Multiline_Output.~Fl_Multiline_Output">virtual Fl_Multiline_Output::~Fl_Multiline_Output()</a></h4> - -Destroys the widget and any value associated with it. - -</body> -</html> + +----<B>Fl_Multiline_Output</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Multiline_Output.H> +</PRE> +</UL> +<H3>Description</H3> + This widget is a subclass of <TT>Fl_Output</TT> that displays multiple +lines of text. It also displays tab characters as whitespace to the +next column. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Multiline_Output.Fl_Multiline_Output>Fl_Multiline_Output</A> +</LI> +<LI><A href=#Fl_Multiline_Output.~Fl_Multiline_Output> +~Fl_Multiline_Output</A></LI> +</UL> +<H4><A name=Fl_Multiline_Output.Fl_Multiline_Output> +Fl_Multiline_Output::Fl_Multiline_Output(int x, int y, int w, int h, +const char *label = 0)</A></H4> + Creates a new <TT>Fl_Multiline_Output</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Multiline_Output.~Fl_Multiline_Output>virtual +Fl_Multiline_Output::~Fl_Multiline_Output()</A></H4> + Destroys the widget and any value associated with it. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Output.html b/documentation/Fl_Output.html index 0039eebb0..7e9c91679 100644 --- a/documentation/Fl_Output.html +++ b/documentation/Fl_Output.html @@ -1,108 +1,80 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Output">class Fl_Output</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Input_">Fl_Input_</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Output>class Fl_Output</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Input_.html#Fl_Input_>Fl_Input_</A> | - +----<b>Fl_Output</b> + +----<B>Fl_Output</B> | - +----<a href="#Fl_Multiline_Output">Fl_Multiline_Output</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Output.H> -</pre></ul> - -<h3>Description</h3> - -This widget displays a piece of text. When you set the <tt>value()</tt>, -<tt>Fl_Output</tt> does a <tt>strcpy()</tt> to it's own storage, which is useful for -program-generated values. The user may select portions of the text -using the mouse and paste the contents into other fields or programs. - -<p><img src=text.gif> - -<p>There is a single subclass, <a -href="#Fl_Multiline_Output">Fl_Multiline_Output</a>, which allows you to -display multiple lines of text. - -<p>The text may contain any characters except \0, and will correctly -display anything, using ^X notation for unprintable control characters -and \nnn notation for unprintable characters with the high bit set. It -assummes the font can draw any characters in the ISO-Latin1 character -set. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Output.Fl_Output">Fl_Output</a> - <li><a href="#Fl_Output.~Fl_Output">~Fl_Output</a> - <li><a href="#Fl_Output.cursor_color">cursor_color</a> - <li><a href="#Fl_Output.index">index</a> - <li><a href="#Fl_Output.size">size</a> - <li><a href="#Fl_Output.textcolor">textcolor</a> - <li><a href="#Fl_Output.textfont">textfont</a> - <li><a href="#Fl_Output.textsize">textsize</a> - <li><a href="#Fl_Output.value">value</a> -</ul> - -<h4><a name="Fl_Output.Fl_Output">Fl_Output::Fl_Output(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Output</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Output.~Fl_Output">virtual Fl_Output::~Fl_Output()</a></h4> - -Destroys the widget and any value associated with it. - -<h4><a name="Fl_Output.value">const char *Fl_Output::value() const<br> -int Fl_Output::value(const char*)<br> -int Fl_Output::value(const char*, int)</a></h4> - -The first form returns the current value, which is a pointer to the -internal buffer and is valid only until the value is changed. - -<p>The second two forms change the text and set the mark and the point -to the end of it. The string is copied to the internal buffer. Passing -<tt>NULL</tt> is the same as "". This returns non-zero if the new -value is different than the current one. You can use the second -version to directly set the length if you know it already or want to -put nul's in the text. - -<h4><a name="Fl_Output.size">int Fl_Output::size() const</a></h4> - -Returns the number of characters in <tt>value()</tt>. This may be greater than -<tt>strlen(value())</tt> if there are nul characters in it. - -<h4><a name="Fl_Output.index">char Fl_Output::index(int) const</a></h4> - -Same as <tt>value()[n]</tt>, but may be faster in plausible implementations. -No bounds checking is done. - -<h4><a name="Fl_Output.textcolor">Fl_Color Fl_Output::textcolor() const<br> -void Fl_Output::textcolor(Fl_Color)</a></h4> - -Gets or sets the color of the text in the input field. - -<h4><a name="Fl_Output.textfont">Fl_Font Fl_Output::textfont() const<br> -void Fl_Output::textfont(Fl_Font)</a></h4> - -Gets or sets the font of the text in the input field. - -<h4><a name="Fl_Output.textsize">uchar Fl_Output::textsize() const<br> -void Fl_Output::textsize(uchar)</a></h4> - -Gets or sets the size of the text in the input field. - -</body> -</html> + +----<A href=Fl_Multiline_Output.html#Fl_Multiline_Output>Fl_Multiline_Output</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Output.H> +</PRE> +</UL> +<H3>Description</H3> + This widget displays a piece of text. When you set the <TT>value()</TT> +, <TT>Fl_Output</TT> does a <TT>strcpy()</TT> to it's own storage, +which is useful for program-generated values. The user may select +portions of the text using the mouse and paste the contents into other +fields or programs. +<CENTER><IMG src=./text.gif></CENTER> +<P>There is a single subclass, <A href=Fl_Multiline_Output.html#Fl_Multiline_Output> +Fl_Multiline_Output</A>, which allows you to display multiple lines of +text. </P> +<P>The text may contain any characters except \0, and will correctly +display anything, using ^X notation for unprintable control characters +and \nnn notation for unprintable characters with the high bit set. It +assummes the font can draw any characters in the ISO-Latin1 character +set. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Output.Fl_Output>Fl_Output</A></LI> +<LI><A href=#Fl_Output.~Fl_Output>~Fl_Output</A></LI> +<LI><A href=#Fl_Output.cursor_color>cursor_color</A></LI> +<LI><A href=#Fl_Output.index>index</A></LI> +<LI><A href=#Fl_Output.size>size</A></LI> +<LI><A href=#Fl_Output.textcolor>textcolor</A></LI> +<LI><A href=#Fl_Output.textfont>textfont</A></LI> +<LI><A href=#Fl_Output.textsize>textsize</A></LI> +<LI><A href=#Fl_Output.value>value</A></LI> +</UL> +<H4><A name=Fl_Output.Fl_Output>Fl_Output::Fl_Output(int x, int y, int +w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Output</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT>. +<H4><A name=Fl_Output.~Fl_Output>virtual Fl_Output::~Fl_Output()</A></H4> + Destroys the widget and any value associated with it. +<H4><A name=Fl_Output.value>const char *Fl_Output::value() const +<BR> int Fl_Output::value(const char*) +<BR> int Fl_Output::value(const char*, int)</A></H4> + The first form returns the current value, which is a pointer to the +internal buffer and is valid only until the value is changed. +<P>The second two forms change the text and set the mark and the point +to the end of it. The string is copied to the internal buffer. Passing <TT> +NULL</TT> is the same as "". This returns non-zero if the new value is +different than the current one. You can use the second version to +directly set the length if you know it already or want to put nul's in +the text. </P> +<H4><A name=Fl_Output.size>int Fl_Output::size() const</A></H4> + Returns the number of characters in <TT>value()</TT>. This may be +greater than <TT>strlen(value())</TT> if there are nul characters in +it. +<H4><A name=Fl_Output.index>char Fl_Output::index(int) const</A></H4> + Same as <TT>value()[n]</TT>, but may be faster in plausible +implementations. No bounds checking is done. +<H4><A name=Fl_Output.textcolor>Fl_Color Fl_Output::textcolor() const +<BR> void Fl_Output::textcolor(Fl_Color)</A></H4> + Gets or sets the color of the text in the input field. +<H4><A name=Fl_Output.textfont>Fl_Font Fl_Output::textfont() const +<BR> void Fl_Output::textfont(Fl_Font)</A></H4> + Gets or sets the font of the text in the input field. +<H4><A name=Fl_Output.textsize>uchar Fl_Output::textsize() const +<BR> void Fl_Output::textsize(uchar)</A></H4> + Gets or sets the size of the text in the input field. </BODY></HTML> diff --git a/documentation/Fl_Overlay_Window.html b/documentation/Fl_Overlay_Window.html index b9b0218de..aff4ef694 100644 --- a/documentation/Fl_Overlay_Window.html +++ b/documentation/Fl_Overlay_Window.html @@ -1,70 +1,56 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Overlay_Window">class Fl_Overlay_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Double_Window">Fl_Double_Window</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Overlay_Window>class Fl_Overlay_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Double_Window.html#Fl_Double_Window>Fl_Double_Window</A> | - +----<b>Fl_Overlay_Window</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Overlay_Window.H> -</pre></ul> - -<h3>Description</h3> - -This window provides double buffering and also the ability to draw the -"overlay" which is another picture placed on top of the main image. -The overlay is designed to be a rapidly-changing but simple graphic -such as a mouse selection box. <tt>Fl_Overlay_Window</tt> uses the -overlay planes provided by your graphics hardware if they are available. - -<p>If no hardware support is found the overlay is simulated by drawing -directly into the on-screen copy of the double-buffered window, and -"erased" by copying the backbuffer over it again. This means the -overlay will blink if you change the image in the window. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Overlay_Window.Fl_Overlay_Window">Fl_Overlay_Window</a> - <li><a href="#Fl_Overlay_Window.~Fl_Overlay_Window">~Fl_Overlay_Window</a> - <li><a href="#Fl_Overlay_Window.draw_overlay">draw_overlay</a> - <li><a href="#Fl_Overlay_Window.redraw_overlay">redraw_overlay</a> -</ul> - -<h4><a name="Fl_Overlay_Window.Fl_Overlay_Window">Fl_Overlay_Window::Fl_Overlay_Window(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Overlay_Window</tt> widget using the given position, size, and -label (title) string. - -<h4><a name="Fl_Overlay_Window.~Fl_Overlay_Window">virtual Fl_Overlay_Window::~Fl_Overlay_Window()</a></h4> - -Destroys the window and all child widgets. - -<h4><a name="Fl_Overlay_Window.">virtual void Fl_Overlay_Window::draw_overlay() = 0</a></h4> - -You must subclass <tt>Fl_Overlay_Window</tt> and provide this method. It is -just like a <tt>draw()</tt> method, except it draws the overlay. The overlay -will have already been "cleared" when this is called. You can use any -of the routines described in <a href="#Drawing"><FL/fl_draw.H></a>. - -<h4><a name="Fl_Overlay_Window.">void Fl_Overlay_Window::redraw_overlay()</a></h4> - -Call this to indicate that the overlay data has changed and needs to -be redrawn. The overlay will be clear until the first time this is -called, so if you want an initial display you must call this after -calling <tt>show()</tt>. - -</body> -</html> + +----<B>Fl_Overlay_Window</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Overlay_Window.H> +</PRE> +</UL> +<H3>Description</H3> + This window provides double buffering and also the ability to draw the +"overlay" which is another picture placed on top of the main image. The +overlay is designed to be a rapidly-changing but simple graphic such as +a mouse selection box. <TT>Fl_Overlay_Window</TT> uses the overlay +planes provided by your graphics hardware if they are available. +<P>If no hardware support is found the overlay is simulated by drawing +directly into the on-screen copy of the double-buffered window, and +"erased" by copying the backbuffer over it again. This means the +overlay will blink if you change the image in the window. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Overlay_Window.Fl_Overlay_Window>Fl_Overlay_Window</A></LI> +<LI><A href=#Fl_Overlay_Window.~Fl_Overlay_Window>~Fl_Overlay_Window</A></LI> +<LI><A href=#Fl_Overlay_Window.draw_overlay>draw_overlay</A></LI> +<LI><A href=#Fl_Overlay_Window.redraw_overlay>redraw_overlay</A></LI> +</UL> +<H4><A name=Fl_Overlay_Window.Fl_Overlay_Window> +Fl_Overlay_Window::Fl_Overlay_Window(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Overlay_Window</TT> widget using the given +position, size, and label (title) string. +<H4><A name=Fl_Overlay_Window.~Fl_Overlay_Window>virtual +Fl_Overlay_Window::~Fl_Overlay_Window()</A></H4> + Destroys the window and all child widgets. +<H4><A name=Fl_Overlay_Window.>virtual void +Fl_Overlay_Window::draw_overlay() = 0</A></H4> + You must subclass <TT>Fl_Overlay_Window</TT> and provide this method. + It is just like a <TT>draw()</TT> method, except it draws the overlay. + The overlay will have already been "cleared" when this is called. You +can use any of the routines described in <A href=drawing.html#Drawing> +<FL/fl_draw.H></A>. +<H4><A name=Fl_Overlay_Window.>void Fl_Overlay_Window::redraw_overlay()</A> +</H4> + Call this to indicate that the overlay data has changed and needs to +be redrawn. The overlay will be clear until the first time this is +called, so if you want an initial display you must call this after +calling <TT>show()</TT>. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Pack.html b/documentation/Fl_Pack.html index b7e70cb9e..5eb0a324e 100644 --- a/documentation/Fl_Pack.html +++ b/documentation/Fl_Pack.html @@ -1,103 +1,80 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Pack">class Fl_Pack</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Group">Fl_Group</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Pack>class Fl_Pack</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Group.html#Fl_Group>Fl_Group</A> | - +----<b>Fl_Pack</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Pack.H> -</pre></ul> - -<h3>Description</h3> - -This widget was designed to add the functionality of compressing -and aligning widgets. - -<p>If <tt>type()</tt> is <tt>FL_HORIZONTAL</tt> all the children are resized to the -height of the <tt>Fl_Pack</tt>, and are moved next to each other horizontally. -If <tt>type()</tt> is not <tt>FL_HORIZONTAL</tt> then the children are resized to the -width and are stacked below each other. Then the <tt>Fl_Pack</tt> resizes -itself to surround the child widgets. - -<p>This widget is needed for the <a href="#Fl_Tab"><tt>Fl_Tab</tt></a>. In -addition you may want to put the <tt>Fl_Pack</tt> inside an -<a href="#Fl_Scroll"><tt>Fl_Scroll</tt></a>. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Pack.Fl_Pack">Fl_Pack</a> - <li><a href="#Fl_Pack.~Fl_Pack">~Fl_Pack</a> - <li><a href="#Fl_Pack.add">add</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Pack.add_resizeable">add_resizeable</a> - <li><a href="#Fl_Pack.array">array</a> - <li><a href="#Fl_Pack.begin">begin</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Pack.child">child</a> - <li><a href="#Fl_Pack.children">children</a> - <li><a href="#Fl_Pack.current">current</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Pack.end">end</a> - <li><a href="#Fl_Pack.find">find</a> - <li><a href="#Fl_Pack.insert">insert</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Pack.remove">remove</a> - <li><a href="#Fl_Pack.resizeable">resizeable</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Pack.Fl_Pack">Fl_Pack::Fl_Pack(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Pack</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Pack.~Fl_Pack">virtual Fl_Pack::~Fl_Pack()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Pack</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Pack</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Pack.spacing">int Fl_Pack::spacing() const<br> -void Fl_Pack::spacing(int)</a></h4> - -Gets or sets the number of extra pixels of blank space that are added between -the children. - -</body> -</html> + +----<B>Fl_Pack</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Pack.H> +</PRE> +</UL> +<H3>Description</H3> + This widget was designed to add the functionality of compressing and +aligning widgets. +<P>If <TT>type()</TT> is <TT>FL_HORIZONTAL</TT> all the children are +resized to the height of the <TT>Fl_Pack</TT>, and are moved next to +each other horizontally. If <TT>type()</TT> is not <TT>FL_HORIZONTAL</TT> + then the children are resized to the width and are stacked below each +other. Then the <TT>Fl_Pack</TT> resizes itself to surround the child +widgets. </P> +<P>This widget is needed for the <A href=#Fl_Tab><TT>Fl_Tab</TT></A>. + In addition you may want to put the <TT>Fl_Pack</TT> inside an <A href=Fl_Scroll.html#Fl_Scroll> +<TT>Fl_Scroll</TT></A>. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Pack.Fl_Pack>Fl_Pack</A></LI> +<LI><A href=#Fl_Pack.~Fl_Pack>~Fl_Pack</A></LI> +<LI><A href=#Fl_Pack.add>add</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Pack.add_resizeable>add_resizeable</A></LI> +<LI><A href=#Fl_Pack.array>array</A></LI> +<LI><A href=#Fl_Pack.begin>begin</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Pack.child>child</A></LI> +<LI><A href=#Fl_Pack.children>children</A></LI> +<LI><A href=#Fl_Pack.current>current</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Pack.end>end</A></LI> +<LI><A href=#Fl_Pack.find>find</A></LI> +<LI><A href=#Fl_Pack.insert>insert</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Pack.remove>remove</A></LI> +<LI><A href=#Fl_Pack.resizeable>resizeable</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Pack.Fl_Pack>Fl_Pack::Fl_Pack(int x, int y, int w, int +h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Pack</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Pack.~Fl_Pack>virtual Fl_Pack::~Fl_Pack()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Pack</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Pack</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Pack.spacing>int Fl_Pack::spacing() const +<BR> void Fl_Pack::spacing(int)</A></H4> + Gets or sets the number of extra pixels of blank space that are added +between the children. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Positioner.html b/documentation/Fl_Positioner.html index 30c3ac288..d714cc6b1 100644 --- a/documentation/Fl_Positioner.html +++ b/documentation/Fl_Positioner.html @@ -1,97 +1,69 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Positioner">class Fl_Positioner</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Positioner>class Fl_Positioner</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Positioner</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Positioner.H> -</pre></ul> - -<h3>Description</h3> - -This class is provided for Forms compatibility. It provides 2D input. -It would be useful if this could be put atop another widget so that the -crosshairs are on top, but this is not implemented. The color of the -crosshairs is <tt>selection_color()</tt>. - -<p><img src=positioner.gif> - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Positioner.Fl_Positioner">Fl_Positioner</a> - <li><a href="#Fl_Positioner.~Fl_Positioner">~Fl_Positioner</a> - <li><a href="#Fl_Positioner.value">value</a> - <li><a href="#Fl_Positioner.xbounds">xbounds</a> - <li><a href="#Fl_Positioner.xstep">xstep</a> - <li><a href="#Fl_Positioner.xvalue">xvalue</a> - <li><a href="#Fl_Positioner.ybounds">ybounds</a> - <li><a href="#Fl_Positioner.ystep">ystep</a> - <li><a href="#Fl_Positioner.yvalue">yvalue</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Positioner.Fl_Positioner">Fl_Positioner::Fl_Positioner(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Positioner</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Positioner.~Fl_Positioner">virtual Fl_Positioner::~Fl_Positioner()</a></h4> - -Deletes the widget. - -<h4><a name="Fl_Positioner.value">void Fl_Positioner::value(float *x, float *y) const</a></h4> - -Returns the current position in <tt>x</tt> and <tt>y</tt>. - -<h4><a name="Fl_Positioner.xbounds">void xbounds(float *xmin, float *xmax)<br> -void xbounds(float xmin, float xmax)</a></h4> - -Gets or sets the X axis bounds. - -<h4><a name="Fl_Positioner.xstep">void xstep(float x)</a></h4> - -Sets the stepping value for the X axis. - -<h4><a name="Fl_Positioner.xvalue">float Fl_Positioner::xvalue(void) const<br> -void Fl_Positioner::xvalue(float x)</a></h4> - -Gets or sets the X axis coordinate. - -<h4><a name="Fl_Positioner.ybounds">void ybounds(float *ymin, float *ymay)<br> -void ybounds(float ymin, float ymay)</a></h4> - -Gets or sets the Y axis bounds. - -<h4><a name="Fl_Positioner.ystep">void ystep(float y)</a></h4> - -Sets the stepping value for the Y axis. - -<h4><a name="Fl_Positioner.yvalue">float Fl_Positioner::yvalue(void) const<br> -void Fl_Positioner::yvalue(float y)</a></h4> - -Gets or sets the Y axis coordinate. - -</body> -</html> + +----<B>Fl_Positioner</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Positioner.H> +</PRE> +</UL> +<H3>Description</H3> + This class is provided for Forms compatibility. It provides 2D input. +It would be useful if this could be put atop another widget so that the +crosshairs are on top, but this is not implemented. The color of the +crosshairs is <TT>selection_color()</TT>. +<P><IMG src=./positioner.gif></P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Positioner.Fl_Positioner>Fl_Positioner</A></LI> +<LI><A href=#Fl_Positioner.~Fl_Positioner>~Fl_Positioner</A></LI> +<LI><A href=#Fl_Positioner.value>value</A></LI> +<LI><A href=#Fl_Positioner.xbounds>xbounds</A></LI> +<LI><A href=#Fl_Positioner.xstep>xstep</A></LI> +<LI><A href=#Fl_Positioner.xvalue>xvalue</A></LI> +<LI><A href=#Fl_Positioner.ybounds>ybounds</A></LI> +<LI><A href=#Fl_Positioner.ystep>ystep</A></LI> +<LI><A href=#Fl_Positioner.yvalue>yvalue</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Positioner.Fl_Positioner> +Fl_Positioner::Fl_Positioner(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Positioner</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Positioner.~Fl_Positioner>virtual +Fl_Positioner::~Fl_Positioner()</A></H4> + Deletes the widget. +<H4><A name=Fl_Positioner.value>void Fl_Positioner::value(float *x, +float *y) const</A></H4> + Returns the current position in <TT>x</TT> and <TT>y</TT>. +<H4><A name=Fl_Positioner.xbounds>void xbounds(float *xmin, float *xmax) +<BR> void xbounds(float xmin, float xmax)</A></H4> + Gets or sets the X axis bounds. +<H4><A name=Fl_Positioner.xstep>void xstep(float x)</A></H4> + Sets the stepping value for the X axis. +<H4><A name=Fl_Positioner.xvalue>float Fl_Positioner::xvalue(void) const +<BR> void Fl_Positioner::xvalue(float x)</A></H4> + Gets or sets the X axis coordinate. +<H4><A name=Fl_Positioner.ybounds>void ybounds(float *ymin, float *ymay) +<BR> void ybounds(float ymin, float ymay)</A></H4> + Gets or sets the Y axis bounds. +<H4><A name=Fl_Positioner.ystep>void ystep(float y)</A></H4> + Sets the stepping value for the Y axis. +<H4><A name=Fl_Positioner.yvalue>float Fl_Positioner::yvalue(void) const +<BR> void Fl_Positioner::yvalue(float y)</A></H4> + Gets or sets the Y axis coordinate. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Repeat_Button.html b/documentation/Fl_Repeat_Button.html index 60129ffdc..078011daa 100644 --- a/documentation/Fl_Repeat_Button.html +++ b/documentation/Fl_Repeat_Button.html @@ -1,45 +1,34 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Repeat_Button">class Fl_Repeat_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre><a href="#Fl_Button">Fl_Button</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Repeat_Button>class Fl_Repeat_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE><A href=Fl_Button.html#Fl_Button>Fl_Button</A> | - +----<b>Fl_Repeat_Button</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre>#include <FL/Fl_Repeat_Button.H></pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Repeat_Button</tt> is a subclass of <tt>Fl_Button</tt> that -generates a callback when it is pressed and then repeatedly generates -callbacks as long as it is held down. The speed of the repeat is fixed -and depends on the implementation. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Repeat_Button.Fl_Repeat_Button">Fl_Repeat_Button</a> - <li><a href="#Fl_Repeat_Button.~Fl_Repeat_Button">~Fl_Repeat_Button</a> -</ul> - -<h4><a name="Fl_Repeat_Button.Fl_Repeat_Button">Fl_Repeat_Button::Fl_Repeat_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Repeat_Button</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_UP_BOX</tt>. - -<h4><a name="Fl_Repeat_Button.~Fl_Repeat_Button">virtual Fl_Repeat_Button::~Fl_Repeat_Button()</a></h4> - -Deletes the button. - -</body> -</html> + +----<B>Fl_Repeat_Button</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE>#include <FL/Fl_Repeat_Button.H></PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Repeat_Button</TT> is a subclass of <TT>Fl_Button</TT> that +generates a callback when it is pressed and then repeatedly generates +callbacks as long as it is held down. The speed of the repeat is fixed +and depends on the implementation. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Repeat_Button.Fl_Repeat_Button>Fl_Repeat_Button</A></LI> +<LI><A href=#Fl_Repeat_Button.~Fl_Repeat_Button>~Fl_Repeat_Button</A></LI> +</UL> +<H4><A name=Fl_Repeat_Button.Fl_Repeat_Button> +Fl_Repeat_Button::Fl_Repeat_Button(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Repeat_Button</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_UP_BOX</TT> +. +<H4><A name=Fl_Repeat_Button.~Fl_Repeat_Button>virtual +Fl_Repeat_Button::~Fl_Repeat_Button()</A></H4> + Deletes the button. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Return_Button.html b/documentation/Fl_Return_Button.html index 8ecfbef31..a6a740ea9 100644 --- a/documentation/Fl_Return_Button.html +++ b/documentation/Fl_Return_Button.html @@ -1,44 +1,33 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Return_Button">class Fl_Return_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre><a href="#Fl_Button">Fl_Button</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Return_Button>class Fl_Return_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE><A href=Fl_Button.html#Fl_Button>Fl_Button</A> | - +----<b>Fl_Return_Button</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre>#include <FL/Fl_Return_Button.H></pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Return_Button</tt> is a subclass of <tt>Fl_Button</tt> that -generates a callback when it is pressed or when the user presses the -Enter key. A carriage-return symbol is drawn next to the button label. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Return_Button.Fl_Return_Button">Fl_Return_Button</a> - <li><a href="#Fl_Return_Button.~Fl_Return_Button">~Fl_Return_Button</a> -</ul> - -<h4><a name="Fl_Return_Button.Fl_Return_Button">Fl_Return_Button::Fl_Return_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Return_Button</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_UP_BOX</tt>. - -<h4><a name="Fl_Return_Button.~Fl_Return_Button">virtual Fl_Return_Button::~Fl_Return_Button()</a></h4> - -Deletes the button. - -</body> -</html> + +----<B>Fl_Return_Button</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE>#include <FL/Fl_Return_Button.H></PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Return_Button</TT> is a subclass of <TT>Fl_Button</TT> that +generates a callback when it is pressed or when the user presses the +Enter key. A carriage-return symbol is drawn next to the button label. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Return_Button.Fl_Return_Button>Fl_Return_Button</A></LI> +<LI><A href=#Fl_Return_Button.~Fl_Return_Button>~Fl_Return_Button</A></LI> +</UL> +<H4><A name=Fl_Return_Button.Fl_Return_Button> +Fl_Return_Button::Fl_Return_Button(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Return_Button</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_UP_BOX</TT> +. +<H4><A name=Fl_Return_Button.~Fl_Return_Button>virtual +Fl_Return_Button::~Fl_Return_Button()</A></H4> + Deletes the button. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Roller.html b/documentation/Fl_Roller.html index 5bc7f0c74..e2f4e199d 100644 --- a/documentation/Fl_Roller.html +++ b/documentation/Fl_Roller.html @@ -1,46 +1,32 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Roller">class Fl_Roller</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Roller>class Fl_Roller</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Roller</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Roller.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Roller</tt> widget is a "dolly" control commonly used to -move 3D objects. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Roller.Fl_Roller">Fl_Roller</a> - <li><a href="#Fl_Roller.~Fl_Roller">~Fl_Roller</a> -</ul> - -<h4><a name="Fl_Roller.Fl_Roller">Fl_Roller::Fl_Roller(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Roller</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Roller.~Fl_Roller">virtual Fl_Roller::~Fl_Roller()</a></h4> - -Destroys the valuator. - -</body> -</html> + +----<B>Fl_Roller</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Roller.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Roller</TT> widget is a "dolly" control commonly used to +move 3D objects. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Roller.Fl_Roller>Fl_Roller</A></LI> +<LI><A href=#Fl_Roller.~Fl_Roller>~Fl_Roller</A></LI> +</UL> +<H4><A name=Fl_Roller.Fl_Roller>Fl_Roller::Fl_Roller(int x, int y, int +w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Roller</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Roller.~Fl_Roller>virtual Fl_Roller::~Fl_Roller()</A></H4> + Destroys the valuator. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Round_Button.html b/documentation/Fl_Round_Button.html index 648d17a0a..2c7ea9d3a 100644 --- a/documentation/Fl_Round_Button.html +++ b/documentation/Fl_Round_Button.html @@ -1,53 +1,40 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Round_Button">class Fl_Round_Button</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Button">Fl_Button</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Round_Button>class Fl_Round_Button</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Button.html#Fl_Button>Fl_Button</A> | - +----<b>Fl_Round_Button</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Round_Button.H> -</pre></ul> - -<h3>Description</h3> - -Buttons generate callbacks when they are clicked by the user. You -control exactly when and how by changing the values for <tt>type()</tt> and -<tt>when()</tt>. - -<P>The <tt>Fl_Round_Button</tt> subclass display the "on" state by -turning on a light, rather than drawing pushed in. The shape of the -"light" is initially set to FL_ROUND_DOWN_BOX. The color of the -light when on is controlled with <tt>selection_color()<tt>, which defaults to -FL_RED. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Round_Button.Fl_Round_Button">Fl_Round_Button</a> - <li><a href="#Fl_Round_Button.~Fl_Round_Button">~Fl_Round_Button</a> -</ul> - -<h4><a name="Fl_Round_Button.Fl_Round_Button">Fl_Round_Button::Fl_Round_Button(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Round_Button</tt> widget using the given position, -size, and label string. - -<h4><a name="Fl_Round_Button.~Fl_Round_Button">Fl_Round_Button::~Fl_Round_Button()</a></h4> - -The destructor deletes the check button. - -</body> -</html> + +----<B>Fl_Round_Button</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Round_Button.H> +</PRE> +</UL> +<H3>Description</H3> + Buttons generate callbacks when they are clicked by the user. You +control exactly when and how by changing the values for <TT>type()</TT> + and <TT>when()</TT>. +<P>The <TT>Fl_Round_Button</TT> subclass display the "on" state by +turning on a light, rather than drawing pushed in. The shape of the +"light" is initially set to FL_ROUND_DOWN_BOX. The color of the light +when on is controlled with <TT>selection_color()<TT>, which defaults to +FL_RED. </TT></TT></P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Round_Button.Fl_Round_Button>Fl_Round_Button</A></LI> +<LI><A href=#Fl_Round_Button.~Fl_Round_Button>~Fl_Round_Button</A></LI> +</UL> +<H4><A name=Fl_Round_Button.Fl_Round_Button> +Fl_Round_Button::Fl_Round_Button(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Round_Button</TT> widget using the given +position, size, and label string. +<H4><A name=Fl_Round_Button.~Fl_Round_Button> +Fl_Round_Button::~Fl_Round_Button()</A></H4> + The destructor deletes the check button. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Scroll.html b/documentation/Fl_Scroll.html index 41136476c..2140e93d1 100644 --- a/documentation/Fl_Scroll.html +++ b/documentation/Fl_Scroll.html @@ -1,135 +1,99 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Scroll">class Fl_Scroll</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Group">Fl_Group</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Scroll>class Fl_Scroll</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Group.html#Fl_Group>Fl_Group</A> | - +----<b>Fl_Scroll</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Scroll.H> -</pre></ul> - -<h3>Description</h3> - -This container widget lets you maneuver around a set of widgets -much larger than your window. If the child widgets are larger than -the size of this object then scrollbars will appear so that you can -scroll over to them: - -<p><img src=Fl_Scroll.gif> - -<p>If all of the child widgets are packed together into a solid -rectangle then you want to set <tt>box()</tt> to <tt>FL_NO_BOX</tt> or -one of the <tt>_FRAME</tt> types. This will result in the best output. -However, if the child widgets are a sparse arrangment you must set -<tt>box()</tt> to a real <tt>_BOX</tt> type. This can result in some -blinking during redrawing, but that can be solved by using a -<tt>Fl_Double_Window</tt>. - -<p>This widget can also be used to pan around a single child widget -"canvas". This child widget should be of your own class, with a -<tt>draw()</tt> method that draws the contents. The scrolling is done -by changing the <tt>x()</tt> and <tt>y()</tt> of the widget, so this -child must use the <tt>x()</tt> and <tt>y()</tt> to position it's -drawing. To speed up drawing it should test <a -href=fl_clip><tt>fl_clip()</tt></a>. - -<p>Another very useful child is a single <a -href="#Fl_Pack"><tt>Fl_Pack</tt></a>, which is itself a group that -packs it's children together and changes size to surround them. -Filling the <tt>Fl_Pack</tt> with <a href="#Fl_Tab"><tt>Fl_Tab</tt></a> -groups (and then putting normal widgets inside those) gives you a very -powerful scrolling list of individually-openable panels. - -<p>Fluid lets you create these, but you can only lay out objects that -fit inside the <tt>Fl_Scroll</tt> without scrolling. Be sure to leave -space for the scrollbars, as Fluid won't show these either. - -<p><i>You cannot use <tt>Fl_Window</tt> as a child of this since the -clipping is not conveyed to it when drawn, and it will draw over the -scrollbars and neighboring objects.</i> - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Scroll.Fl_Scroll">Fl_Scroll</a> - <li><a href="#Fl_Scroll.~Fl_Scroll">~Fl_Scroll</a> - <li><a href="#Fl_Scroll.align">align</a> - <li><a href="#Fl_Scroll.position">position</a> - <li><a href="#Fl_Scroll.type">type</a> - <li><a href="#Fl_Scroll.xposition">xposition</a> - <li><a href="#Fl_Scroll.yposition">yposition</a> -</ul> - -<h4><a name="Fl_Scroll.Fl_Scroll">Fl_Scroll::Fl_Scroll(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Scroll</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Scroll.~Fl_Scroll">virtual Fl_Scroll::~Fl_Scroll()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Scroll</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Scroll</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Scroll.type">void Fl_Widget::type(int)</a></h4> - -By default you can scroll in both directions, and the scrollbars -disappear if the data will fit in the area of the scroll. <tt>type()</tt> -can change this: - -<ul> - <li><tt>0</tt> - No scrollbars - - <li><tt>Fl_Scroll::HORIZONTAL</tt> - Only a horizontal scrollbar. - - <li><tt>Fl_Scroll::VERTICAL</tt> - Only a vertical scrollbar. - - <li><tt>Fl_Scroll::BOTH</tt> - The default is both scrollbars. - - <li><tt>Fl_Scroll::HORIZONTAL_ALWAYS</tt> - Horizontal scrollbar - always on, vertical always off. - - <li><tt>Fl_Scroll::VERTICAL_ALWAYS</tt> - Vertical scrollbar always on, - horizontal always off. - - <li><tt>Fl_Scroll::BOTH_ALWAYS</tt> - Both always on. -</ul> - -<h4><a name="Fl_Scroll.align">void Fl_Scroll::scrollbar.align(int)<br> -void Fl_Scroll::hscrollbar.align(int)</a></h4> - -This is used to change what side the scrollbars are drawn on. If the -<tt>FL_ALIGN_LEFT</tt> bit is on, the vertical scrollbar is on the -left. If the <tt>FL_ALIGN_TOP</tt> bit is on, the horizontal scrollbar -is on the top. - -<h4><a name="Fl_Scroll.xposition">int Fl_Scroll::xposition() const</a></h4> - -Gets the current horizontal scrolling position. - -<h4><a name="Fl_Scroll.yposition">int Fl_Scroll::yposition() const</a></h4> - -Gets the current vertical scrolling position. - -<h4><a name="Fl_Scroll.position">void Fl_Scroll::position(int w, int h)</a></h4> - -Sets the upper-lefthand corner of the scrolling region. - -</body> -</html> + +----<B>Fl_Scroll</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Scroll.H> +</PRE> +</UL> +<H3>Description</H3> + This container widget lets you maneuver around a set of widgets much +larger than your window. If the child widgets are larger than the size +of this object then scrollbars will appear so that you can scroll over +to them: +<P><IMG src=./Fl_Scroll.gif></P> +<P>If all of the child widgets are packed together into a solid +rectangle then you want to set <TT>box()</TT> to <TT>FL_NO_BOX</TT> or +one of the <TT>_FRAME</TT> types. This will result in the best output. + However, if the child widgets are a sparse arrangment you must set <TT> +box()</TT> to a real <TT>_BOX</TT> type. This can result in some +blinking during redrawing, but that can be solved by using a <TT> +Fl_Double_Window</TT>. </P> +<P>This widget can also be used to pan around a single child widget +"canvas". This child widget should be of your own class, with a <TT> +draw()</TT> method that draws the contents. The scrolling is done by +changing the <TT>x()</TT> and <TT>y()</TT> of the widget, so this child +must use the <TT>x()</TT> and <TT>y()</TT> to position it's drawing. + To speed up drawing it should test <A href=fl_clip><TT>fl_clip()</TT></A> +. </P> +<P>Another very useful child is a single <A href=Fl_Pack.html#Fl_Pack><TT> +Fl_Pack</TT></A>, which is itself a group that packs it's children +together and changes size to surround them. Filling the <TT>Fl_Pack</TT> + with <A href=#Fl_Tab><TT>Fl_Tab</TT></A> groups (and then putting +normal widgets inside those) gives you a very powerful scrolling list +of individually-openable panels. </P> +<P>Fluid lets you create these, but you can only lay out objects that +fit inside the <TT>Fl_Scroll</TT> without scrolling. Be sure to leave +space for the scrollbars, as Fluid won't show these either. </P> +<P><I>You cannot use <TT>Fl_Window</TT> as a child of this since the +clipping is not conveyed to it when drawn, and it will draw over the +scrollbars and neighboring objects.</I></P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Scroll.Fl_Scroll>Fl_Scroll</A></LI> +<LI><A href=#Fl_Scroll.~Fl_Scroll>~Fl_Scroll</A></LI> +<LI><A href=#Fl_Scroll.align>align</A></LI> +<LI><A href=#Fl_Scroll.position>position</A></LI> +<LI><A href=#Fl_Scroll.type>type</A></LI> +<LI><A href=#Fl_Scroll.xposition>xposition</A></LI> +<LI><A href=#Fl_Scroll.yposition>yposition</A></LI> +</UL> +<H4><A name=Fl_Scroll.Fl_Scroll>Fl_Scroll::Fl_Scroll(int x, int y, int +w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Scroll</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Scroll.~Fl_Scroll>virtual Fl_Scroll::~Fl_Scroll()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Scroll</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Scroll</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Scroll.type>void Fl_Widget::type(int)</A></H4> + By default you can scroll in both directions, and the scrollbars +disappear if the data will fit in the area of the scroll. <TT>type()</TT> + can change this: +<UL> +<LI><TT>0</TT> - No scrollbars </LI> +<LI><TT>Fl_Scroll::HORIZONTAL</TT> - Only a horizontal scrollbar. </LI> +<LI><TT>Fl_Scroll::VERTICAL</TT> - Only a vertical scrollbar. </LI> +<LI><TT>Fl_Scroll::BOTH</TT> - The default is both scrollbars. </LI> +<LI><TT>Fl_Scroll::HORIZONTAL_ALWAYS</TT> - Horizontal scrollbar + always on, vertical always off. </LI> +<LI><TT>Fl_Scroll::VERTICAL_ALWAYS</TT> - Vertical scrollbar always on, + horizontal always off. </LI> +<LI><TT>Fl_Scroll::BOTH_ALWAYS</TT> - Both always on. </LI> +</UL> +<H4><A name=Fl_Scroll.align>void Fl_Scroll::scrollbar.align(int) +<BR> void Fl_Scroll::hscrollbar.align(int)</A></H4> + This is used to change what side the scrollbars are drawn on. If the <TT> +FL_ALIGN_LEFT</TT> bit is on, the vertical scrollbar is on the left. + If the <TT>FL_ALIGN_TOP</TT> bit is on, the horizontal scrollbar is on +the top. +<H4><A name=Fl_Scroll.xposition>int Fl_Scroll::xposition() const</A></H4> + Gets the current horizontal scrolling position. +<H4><A name=Fl_Scroll.yposition>int Fl_Scroll::yposition() const</A></H4> + Gets the current vertical scrolling position. +<H4><A name=Fl_Scroll.position>void Fl_Scroll::position(int w, int h)</A> +</H4> + Sets the upper-lefthand corner of the scrolling region. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Scrollbar.html b/documentation/Fl_Scrollbar.html index 535831546..01e59a38e 100644 --- a/documentation/Fl_Scrollbar.html +++ b/documentation/Fl_Scrollbar.html @@ -1,78 +1,59 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Scrollbar">class Fl_Scrollbar</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Slider">Fl_Slider</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Scrollbar>class Fl_Scrollbar</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Slider.html#Fl_Slider>Fl_Slider</A> | - +----<b>Fl_Scrollbar</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Scrollbar.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Scrollbar</tt> widget displays a slider with arrow buttons -at the ends of the scrollbar. Clicking on the arrows move up/left and -down/right by <tt>linesize()</tt>. Scrollbars also accept -<tt>FL_SHORTCUT</tt> events: the arrows move by <tt>linesize()</tt>, -and vertical scrollbars take Page Up/Down (they move by the page size -minus <tt>linesize()</tt>) and Home/End (they jump to the top or -bottom). - -<p>Scrollbars have <tt>step(1)</tt> preset (they always return -integers). If desired you can set the <tt>step()</tt> to non-integer -values. You will then have to use casts to get at the floating-point -versions of <tt>value()</tt> from <tt>Fl_Slider</tt>. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Scrollbar.Fl_Scrollbar">Fl_Scrollbar</a> - <li><a href="#Fl_Scrollbar.~Fl_Scrollbar">~Fl_Scrollbar</a> - <li><a href="#Fl_Scrollbar.linesize">linesize</a> - <li><a href="#Fl_Scrollbar.value">value</a> -</ul> - -<h4><a name="Fl_Scrollbar.Fl_Scrollbar">Fl_Scrollbar::Fl_Scrollbar(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Scrollbar</tt> widget using the given position, -size, and label string. You need to do <tt>type(FL_HORIZONTAL)</tt> if -you want a horizontal scrollbar. - -<h4><a name="Fl_Scrollbar.~Fl_Scrollbar">virtual Fl_Scrollbar::~Fl_Scrollbar()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Scrollbar.linesize">int Fl_Scrollbar::linesize() const<br> -void Fl_Scrollbar::linesize(int i)</a></h4> - -This number controls how big the steps are that the arrow keys do. In -addition page up/down move by the size last sent to <tt>value()</tt> -minus one <tt>linesize()</tt>. The default is 16. - -<h4><a name="Fl_Scrollbar.value">int Fl_Scrollbar::value()<br> -int Fl_Scrollbar::value(int position, int size, int top, int total)</a></h4> - -The first form returns the integer value of the scrollbar. You can get -the floating point value with <tt>Fl_Slider::value()</tt>. - -The second form sets <tt>value()</tt>, <tt>range()</tt>, and -<tt>slider_size()</tt> to make a variable-sized scrollbar. You should -call this every time your window changes size, your data changes size, -or your scroll position changes (even if in response to a callback from -this scrollbar). All necessary calls to <tt>redraw()</tt> are done. - -</body> -</html> + +----<B>Fl_Scrollbar</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Scrollbar.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Scrollbar</TT> widget displays a slider with arrow buttons +at the ends of the scrollbar. Clicking on the arrows move up/left and +down/right by <TT>linesize()</TT>. Scrollbars also accept <TT> +FL_SHORTCUT</TT> events: the arrows move by <TT>linesize()</TT>, and +vertical scrollbars take Page Up/Down (they move by the page size minus <TT> +linesize()</TT>) and Home/End (they jump to the top or bottom). +<P>Scrollbars have <TT>step(1)</TT> preset (they always return +integers). If desired you can set the <TT>step()</TT> to non-integer +values. You will then have to use casts to get at the floating-point +versions of <TT>value()</TT> from <TT>Fl_Slider</TT>. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Scrollbar.Fl_Scrollbar>Fl_Scrollbar</A></LI> +<LI><A href=#Fl_Scrollbar.~Fl_Scrollbar>~Fl_Scrollbar</A></LI> +<LI><A href=#Fl_Scrollbar.linesize>linesize</A></LI> +<LI><A href=#Fl_Scrollbar.value>value</A></LI> +</UL> +<H4><A name=Fl_Scrollbar.Fl_Scrollbar>Fl_Scrollbar::Fl_Scrollbar(int x, +int y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Scrollbar</TT> widget using the given position, +size, and label string. You need to do <TT>type(FL_HORIZONTAL)</TT> if +you want a horizontal scrollbar. +<H4><A name=Fl_Scrollbar.~Fl_Scrollbar>virtual +Fl_Scrollbar::~Fl_Scrollbar()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Scrollbar.linesize>int Fl_Scrollbar::linesize() const +<BR> void Fl_Scrollbar::linesize(int i)</A></H4> + This number controls how big the steps are that the arrow keys do. In +addition page up/down move by the size last sent to <TT>value()</TT> + minus one <TT>linesize()</TT>. The default is 16. +<H4><A name=Fl_Scrollbar.value>int Fl_Scrollbar::value() +<BR> int Fl_Scrollbar::value(int position, int size, int top, int total)</A> +</H4> + The first form returns the integer value of the scrollbar. You can get +the floating point value with <TT>Fl_Slider::value()</TT>. The second +form sets <TT>value()</TT>, <TT>range()</TT>, and <TT>slider_size()</TT> + to make a variable-sized scrollbar. You should call this every time +your window changes size, your data changes size, or your scroll +position changes (even if in response to a callback from this +scrollbar). All necessary calls to <TT>redraw()</TT> are done. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Secret_Input.html b/documentation/Fl_Secret_Input.html index ee62a6ec8..c24f3b145 100644 --- a/documentation/Fl_Secret_Input.html +++ b/documentation/Fl_Secret_Input.html @@ -1,47 +1,36 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Secret_Input">class Fl_Secret_Input</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Input">Fl_Input</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Secret_Input>class Fl_Secret_Input</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=functions.html#Fl_Input>Fl_Input</A> | - +----<b>Fl_Secret_Input</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Input.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Secret_Input</tt> class is a subclass of <tt>Fl_Input</tt> that -displays its input as a string of asterisks. This subclass is usually used -to recieve passwords and other "secret" information. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Secret_Input.Fl_Secret_Input">Fl_Secret_Input</a> - <li><a href="#Fl_Secret_Input.~Fl_Secret_Input">~Fl_Secret_Input</a> -</ul> - -<h4><a name="Fl_Secret_Input.Fl_Secret_Input">Fl_Secret_Input::Fl_Secret_Input(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Secret_Input</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Secret_Input.~Fl_Secret_Input">virtual Fl_Secret_Input::~Fl_Secret_Input()</a></h4> - -Destroys the widget and any value associated with it. - -</body> -</html> + +----<B>Fl_Secret_Input</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Input.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Secret_Input</TT> class is a subclass of <TT>Fl_Input</TT> + that displays its input as a string of asterisks. This subclass is +usually used to recieve passwords and other "secret" information. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Secret_Input.Fl_Secret_Input>Fl_Secret_Input</A></LI> +<LI><A href=#Fl_Secret_Input.~Fl_Secret_Input>~Fl_Secret_Input</A></LI> +</UL> +<H4><A name=Fl_Secret_Input.Fl_Secret_Input> +Fl_Secret_Input::Fl_Secret_Input(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Secret_Input</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Secret_Input.~Fl_Secret_Input>virtual +Fl_Secret_Input::~Fl_Secret_Input()</A></H4> + Destroys the widget and any value associated with it. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Select_Browser.html b/documentation/Fl_Select_Browser.html index b29fbb944..029f74c7d 100644 --- a/documentation/Fl_Select_Browser.html +++ b/documentation/Fl_Select_Browser.html @@ -1,72 +1,53 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Select_Browser">class Fl_Select_Browser</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Browser">Fl_Browser</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Select_Browser>class Fl_Select_Browser</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Browser.html#Fl_Browser>Fl_Browser</A> | - +----<b>Fl_Select_Browser</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Select_Browser.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Select_Browser</tt> class is a subclass of <tt>Fl_Browser</tt> -which lets the user select a single item, or no items by clicking on -the empty space. As long as the mouse button is held down the item -pointed to by it is highlighted. Normally the callback is done when the -user presses the mouse, but you can change this with <tt>when()</tt>. - -<p>See <a href="#Fl_Browser"><tt>Fl_Browser</tt></a> for methods to add -and remove lines from the browser. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Select_Browser.Fl_Select_Browser">Fl_Select_Browser</a> - <li><a href="#Fl_Select_Browser.~Fl_Select_Browser">~Fl_Select_Browser</a> - <li><a href="#Fl_Select_Browser.deselect">deselect</a> - <li><a href="#Fl_Select_Browser.select">select</a> - <li><a href="#Fl_Select_Browser.value">value</a> -</ul> - -<h4><a name="Fl_Select_Browser.Fl_Select_Browser">Fl_Select_Browser::Fl_Select_Browser(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Select_Browser</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Select_Browser.~Fl_Select_Browser">virtual Fl_Select_Browser::~Fl_Select_Browser()</a></h4> - -The destructor <i>also deletes all the items in the list</i>. - -<h4><a name="Fl_Select_Browser.deselect">int Fl_Browser::deselect()</a></h4> - -Same as <tt>value(0)</tt>. - -<h4><a name="Fl_Select_Browser.select">int Fl_Browser::select(int,int=1)<br> -int Fl_Browser::selected(int) const</a></h4> - -You can use these for compatibility with -<a href="#Fl_Multi_Browser"><tt>Fl_Multi_Browser</tt></a>. If you -turn on the selection of more than one line the results are -unpredictable. - -<h4><a name="Fl_Select_Browser.value">int Fl_Browser::value() const</a></h4> - -Returns the number of the highlighted item, or zero if none. Notice -that this is going to be zero except <i>during</i> a callback! - -</body> -</html> + +----<B>Fl_Select_Browser</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Select_Browser.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Select_Browser</TT> class is a subclass of <TT>Fl_Browser</TT> + which lets the user select a single item, or no items by clicking on +the empty space. As long as the mouse button is held down the item +pointed to by it is highlighted. Normally the callback is done when the +user presses the mouse, but you can change this with <TT>when()</TT>. +<P>See <A href=Fl_Browser.html#Fl_Browser><TT>Fl_Browser</TT></A> for +methods to add and remove lines from the browser. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Select_Browser.Fl_Select_Browser>Fl_Select_Browser</A></LI> +<LI><A href=#Fl_Select_Browser.~Fl_Select_Browser>~Fl_Select_Browser</A></LI> +<LI><A href=#Fl_Select_Browser.deselect>deselect</A></LI> +<LI><A href=#Fl_Select_Browser.select>select</A></LI> +<LI><A href=#Fl_Select_Browser.value>value</A></LI> +</UL> +<H4><A name=Fl_Select_Browser.Fl_Select_Browser> +Fl_Select_Browser::Fl_Select_Browser(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Select_Browser</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Select_Browser.~Fl_Select_Browser>virtual +Fl_Select_Browser::~Fl_Select_Browser()</A></H4> + The destructor <I>also deletes all the items in the list</I>. +<H4><A name=Fl_Select_Browser.deselect>int Fl_Browser::deselect()</A></H4> + Same as <TT>value(0)</TT>. +<H4><A name=Fl_Select_Browser.select>int Fl_Browser::select(int,int=1) +<BR> int Fl_Browser::selected(int) const</A></H4> + You can use these for compatibility with <A href=Fl_Multi_Browser.html#Fl_Multi_Browser> +<TT>Fl_Multi_Browser</TT></A>. If you turn on the selection of more +than one line the results are unpredictable. +<H4><A name=Fl_Select_Browser.value>int Fl_Browser::value() const</A></H4> + Returns the number of the highlighted item, or zero if none. Notice +that this is going to be zero except <I>during</I> a callback! </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Single_Window.html b/documentation/Fl_Single_Window.html index 9f0e297ea..f0f628d0f 100644 --- a/documentation/Fl_Single_Window.html +++ b/documentation/Fl_Single_Window.html @@ -1,49 +1,37 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Single_Window">class Fl_Single_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Window">Fl_Window</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Single_Window>class Fl_Single_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Window.html#Fl_Window>Fl_Window</A> | - +----<b>Fl_Single_Window</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Single_Window.H> -</pre></ul> - -<h3>Description</h3> - -This is the same as <tt>Fl_Window<tt>. However, it is possible that -some implementations will provide double-buffered windows by default. -This subclass can be used to force single-buffering. This may be -useful for modifying existing programs that use incremental update, or -for some types of image data, such as a movie flipbook. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Single_Window.Fl_Single_Window">Fl_Single_Window</a> - <li><a href="#Fl_Single_Window.~Fl_Single_Window">~Fl_Single_Window</a> -</ul> - -<h4><a name="Fl_Single_Window.Fl_Single_Window">Fl_Single_Window::Fl_Single_Window(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Single_Window</tt> widget using the given position, size, and -label (title) string. - -<h4><a name="Fl_Single_Window.~Fl_Single_Window">virtual Fl_Single_Window::~Fl_Single_Window()</a></h4> - -Destroys the window and all child widgets. - -</body> -</html> + +----<B>Fl_Single_Window</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Single_Window.H> +</PRE> +</UL> +<H3>Description</H3> + This is the same as <TT>Fl_Window<TT>. However, it is possible that +some implementations will provide double-buffered windows by default. +This subclass can be used to force single-buffering. This may be +useful for modifying existing programs that use incremental update, or +for some types of image data, such as a movie flipbook. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Single_Window.Fl_Single_Window>Fl_Single_Window</A></LI> +<LI><A href=#Fl_Single_Window.~Fl_Single_Window>~Fl_Single_Window</A></LI> +</UL> +<H4><A name=Fl_Single_Window.Fl_Single_Window> +Fl_Single_Window::Fl_Single_Window(int x, int y, int w, int h, const +char *label = 0)</A></H4> + Creates a new <TT>Fl_Single_Window</TT> widget using the given +position, size, and label (title) string. +<H4><A name=Fl_Single_Window.~Fl_Single_Window>virtual +Fl_Single_Window::~Fl_Single_Window()</A></H4> + Destroys the window and all child widgets. </TT></TT></BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Slider.html b/documentation/Fl_Slider.html index 295c06e0f..469a4f808 100644 --- a/documentation/Fl_Slider.html +++ b/documentation/Fl_Slider.html @@ -1,101 +1,77 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Slider">class Fl_Slider</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Slider>class Fl_Slider</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Slider</b> + +----<B>Fl_Slider</B> | - +----<a href="#Fl_Scrollbar">Fl_Scrollbar</a>, <a href="#Fl_Value_Slider">Fl_Value_Slider</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Slider.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Slider</tt> widget contains a sliding knob inside a box. It -if often used as a scrollbar. Moving the box all the way to the -top/left sets it to the <tt>minimum()</tt>, and to the bottom/right to -the <tt>maximum()</tt>. The <tt>minimum()</tt> may be greater than the -<tt>maximum()</tt> to reverse the slider direction. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Slider.Fl_Slider">Fl_Slider</a> - <li><a href="#Fl_Slider.~Fl_Slider">~Fl_Slider</a> - <li><a href="#Fl_Slider.scrollvalue">scrollvalue</a> - <li><a href="#Fl_Slider.slider">slider</a> - <li><a href="#Fl_Slider.slider_size">slider_size</a> - <li><a href="#Fl_Slider.type">type</a> -</ul> - -<h4><a name="Fl_Slider.Fl_Slider">Fl_Slider::Fl_Slider(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Slider</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Slider.~Fl_Slider">virtual Fl_Slider::~Fl_Slider()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Slider.scrollvalue">int Fl_Slider::scrollvalue(int windowtop, int windowsize, int first, int totalsize)</a></h4> - -Returns <a href="#Fl_Scrollbar.value"><tt>Fl_Scrollbar::value()</tt></a>. - -<h4><a name="Fl_Slider.">Fl_Boxtype Fl_Slider::slider() const<br> -void Fl_Slider::slider(Fl_Boxtype)</a></h4> - -Set the type of box to draw for the moving part of the slider. The -color of the moving part (or of the notch in it for the nice sliders) -is controlled by <tt>selection_color()</tt>. The default value of zero -causes the slider to figure out what to draw from <tt>box()</tt>. - -<h4><a name="Fl_Slider.slider_size">float Fl_Slider::slider_size() const<br> -void Fl_Slider::slider_size(float)</a></h4> - -Get or set the dimensions of the moving piece of slider. This is the -fraction of the size of the entire widget. If you set this to 1 then -the slider cannot move. The default value is .08. - -<p>For the "fill" sliders this is the size of the area around the end -that causes a drag effect rather than causing the slider to jump to -the mouse. - -<h4><a name="Fl_Slider.type">uchar Fl_Widget::type() const<br> -void Fl_Widget::type(uchar t)</a></h4> - -Setting this changes how the slider is drawn, which can be one of the following: - -<ul> - <li><tt>FL_VERTICAL</tt> - Draws a vertical slider (this is the default). - - <li><tt>FL_HORIZONTAL</tt> - Draws a horizontal slider. - - <li><tt>FL_VERT_FILL_SLIDER</tt> - Draws a filled vertical - slider, useful as a progress or value meter. - - <li><tt>FL_HOR_FILL_SLIDER</tt> - Draws a filled horizontal - slider, useful as a progress or value meter. - - <li><tt>FL_VERT_NICE_SLIDER</tt> - Draws a vertical slider with - a nice looking control knob. - - <li><tt>FL_HOR_NICE_SLIDER</tt> - Draws a horizontal slider with - a nice looking control knob. -</ul> - -</body> -</html> + +----<A href=Fl_Scrollbar.html#Fl_Scrollbar>Fl_Scrollbar</A>, <A href=Fl_Value_Slider.html#Fl_Value_Slider>Fl_Value_Slider</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Slider.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Slider</TT> widget contains a sliding knob inside a box. It +if often used as a scrollbar. Moving the box all the way to the +top/left sets it to the <TT>minimum()</TT>, and to the bottom/right to +the <TT>maximum()</TT>. The <TT>minimum()</TT> may be greater than the <TT> +maximum()</TT> to reverse the slider direction. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Slider.Fl_Slider>Fl_Slider</A></LI> +<LI><A href=#Fl_Slider.~Fl_Slider>~Fl_Slider</A></LI> +<LI><A href=#Fl_Slider.scrollvalue>scrollvalue</A></LI> +<LI><A href=#Fl_Slider.slider>slider</A></LI> +<LI><A href=#Fl_Slider.slider_size>slider_size</A></LI> +<LI><A href=#Fl_Slider.type>type</A></LI> +</UL> +<H4><A name=Fl_Slider.Fl_Slider>Fl_Slider::Fl_Slider(int x, int y, int +w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Slider</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Slider.~Fl_Slider>virtual Fl_Slider::~Fl_Slider()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Slider.scrollvalue>int Fl_Slider::scrollvalue(int +windowtop, int windowsize, int first, int totalsize)</A></H4> + Returns <A href=Fl_Scrollbar.html#Fl_Scrollbar.value><TT> +Fl_Scrollbar::value()</TT></A>. +<H4><A name=Fl_Slider.>Fl_Boxtype Fl_Slider::slider() const +<BR> void Fl_Slider::slider(Fl_Boxtype)</A></H4> + Set the type of box to draw for the moving part of the slider. The +color of the moving part (or of the notch in it for the nice sliders) +is controlled by <TT>selection_color()</TT>. The default value of zero +causes the slider to figure out what to draw from <TT>box()</TT>. +<H4><A name=Fl_Slider.slider_size>float Fl_Slider::slider_size() const +<BR> void Fl_Slider::slider_size(float)</A></H4> + Get or set the dimensions of the moving piece of slider. This is the +fraction of the size of the entire widget. If you set this to 1 then +the slider cannot move. The default value is .08. +<P>For the "fill" sliders this is the size of the area around the end +that causes a drag effect rather than causing the slider to jump to the +mouse. </P> +<H4><A name=Fl_Slider.type>uchar Fl_Widget::type() const +<BR> void Fl_Widget::type(uchar t)</A></H4> + Setting this changes how the slider is drawn, which can be one of the +following: +<UL> +<LI><TT>FL_VERTICAL</TT> - Draws a vertical slider (this is the +default). </LI> +<LI><TT>FL_HORIZONTAL</TT> - Draws a horizontal slider. </LI> +<LI><TT>FL_VERT_FILL_SLIDER</TT> - Draws a filled vertical slider, +useful as a progress or value meter. </LI> +<LI><TT>FL_HOR_FILL_SLIDER</TT> - Draws a filled horizontal slider, +useful as a progress or value meter. </LI> +<LI><TT>FL_VERT_NICE_SLIDER</TT> - Draws a vertical slider with a nice +looking control knob. </LI> +<LI><TT>FL_HOR_NICE_SLIDER</TT> - Draws a horizontal slider with a +nice looking control knob. </LI> +</UL> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Tabs.html b/documentation/Fl_Tabs.html index 3018aeecd..e0f7196f1 100644 --- a/documentation/Fl_Tabs.html +++ b/documentation/Fl_Tabs.html @@ -1,85 +1,64 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Tabs">class Fl_Tabs</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Group">Fl_Group</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Tabs>class Fl_Tabs</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Group.html#Fl_Group>Fl_Group</A> | - +----<b>Fl_Tabs</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Tab.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Tabs</tt> widget is the "file card tabs" interface that -allows you to put lots and lots of buttons and switches in a panel, as -popularized by many toolkits. - -<p><img src=tabs.gif> - -<p>Clicking the tab makes a child <tt>visible()</tt> (by calling -<tt>show()</tt> on it) and all other children are invisible (by calling -<tt>hide()</tt> on them). Usually the children are <a -href="#Fl_Group"><tt>Fl_Group<tt></a> widgets containing several -widgets themselves. - -<p>Each child makes a card, and it's <tt>label()</tt> is printed on the -card tab (including the label font and style). The color of that child -is used to color the card as well. Currently this only draws nicely if -you set <a href="#Fl_Widget.box"><tt>box()</tt></a> to the default -<tt>FL_THIN_UP_BOX</tt> or to <tt>FL_FLAT_BOX</tt>, which gets rid of -the edges drawn on the sides and bottom. - -<p>The size of the tabs is controlled by the bounding box of the -children (there should be some space between the children and the edge -of the <tt>Fl_Tabs</tt>), and the tabs may be placed "inverted" on the -bottom, this is determined by which gap is larger. It is easiest to -lay this out in fluid, using the fluid browser to select each child -group and resize them until the tabs look the way you want them to. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Tab.Fl_Tab">Fl_Tab</a> - <li><a href="#Fl_Tab.~Fl_Tab">~Fl_Tab</a> - <li><a href="#Fl_Tab.value">value</a> -</ul> - -<h4><a name="Fl_Tab.Fl_Tab">Fl_Tab::Fl_Tab(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Tab</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_THIN_UP_BOX</tt>. - -<p>Use <a href="#Fl_Group.add"><tt>add(Fl_Widget *)</tt></a> to add -each child (which is probably itself a <tt>Fl_Group</tt>). The -children should be sized to stay away from the top or bottom edge of -the <tt>Fl_Tabs</tt>, which is where the tabs are drawn. - -<h4><a name="Fl_Tab.~Fl_Tab">virtual Fl_Tab::~Fl_Tab()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Tab</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Tab</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Tab.value">Fl_Widget* Fl_Tabs::value() const<br> -int Fl_Tabs::value(Fl_Widget*)</a></h4> - -Gets or sets the currently visible widget/tab. - -</body> -</html> + +----<B>Fl_Tabs</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Tab.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Tabs</TT> widget is the "file card tabs" interface that +allows you to put lots and lots of buttons and switches in a panel, as +popularized by many toolkits. +<P><IMG src=./tabs.gif></P> +<P>Clicking the tab makes a child <TT>visible()</TT> (by calling <TT> +show()</TT> on it) and all other children are invisible (by calling <TT> +hide()</TT> on them). Usually the children are <A href=Fl_Group.html#Fl_Group> +<TT>Fl_Group<TT></TT></A> widgets containing several widgets +themselves. </P> +<P>Each child makes a card, and it's <TT>label()</TT> is printed on the +card tab (including the label font and style). The color of that child +is used to color the card as well. Currently this only draws nicely if +you set <A href=Fl_Widget.html#Fl_Widget.box><TT>box()</TT></A> to the +default <TT>FL_THIN_UP_BOX</TT> or to <TT>FL_FLAT_BOX</TT>, which gets +rid of the edges drawn on the sides and bottom. </P> +<P>The size of the tabs is controlled by the bounding box of the +children (there should be some space between the children and the edge +of the <TT>Fl_Tabs</TT>), and the tabs may be placed "inverted" on the +bottom, this is determined by which gap is larger. It is easiest to +lay this out in fluid, using the fluid browser to select each child +group and resize them until the tabs look the way you want them to. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Tab.Fl_Tab>Fl_Tab</A></LI> +<LI><A href=#Fl_Tab.~Fl_Tab>~Fl_Tab</A></LI> +<LI><A href=#Fl_Tab.value>value</A></LI> +</UL> +<H4><A name=Fl_Tab.Fl_Tab>Fl_Tab::Fl_Tab(int x, int y, int w, int h, +const char *label = 0)</A></H4> + Creates a new <TT>Fl_Tab</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_THIN_UP_BOX</TT>. +<P>Use <A href=Fl_Group.html#Fl_Group.add><TT>add(Fl_Widget *)</TT></A> + to add each child (which is probably itself a <TT>Fl_Group</TT>). The +children should be sized to stay away from the top or bottom edge of +the <TT>Fl_Tabs</TT>, which is where the tabs are drawn. </P> +<H4><A name=Fl_Tab.~Fl_Tab>virtual Fl_Tab::~Fl_Tab()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Tab</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Tab</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Tab.value>Fl_Widget* Fl_Tabs::value() const +<BR> int Fl_Tabs::value(Fl_Widget*)</A></H4> + Gets or sets the currently visible widget/tab. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Tile.html b/documentation/Fl_Tile.html index ffb85a603..abbd8fc5f 100644 --- a/documentation/Fl_Tile.html +++ b/documentation/Fl_Tile.html @@ -1,85 +1,65 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Tile">class Fl_Tile</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Tile>class Fl_Tile</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Tile</b> + +----<B>Fl_Tile</B> | - +----<a href="#Fl_Pack">Fl_Pack</a>, <a href="#Fl_Scroll">Fl_Scroll</a>, <a href="#Fl_Tabs">Fl_Tabs</a>, <a href="#Fl_Tile">Fl_Tile</a>, <a href="#Fl_Window">Fl_Window</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Tile.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Tile</tt> class lets you resize the children by dragging the -border between them: - -<p><img src=Fl_Tile.gif> - -<p><tt>Fl_Tile</tt> allows objects to be resized to zero dimensions. -To prevent this you can use the <tt>resizable()</tt> to limit where -corners can be dragged to. - -<p>Even though objects can be resized to zero sizes, they must -initially have non-zero sizes so the <tt>Fl_Tile</tt> can figure out -their layout. If desired, call <tt>position()</tt> after creating the -children but before displaying the window to set the borders where you -want. - -<p>The "borders" are part of the children, an <tt>Fl_Tile<tt> does not -draw any graphics of it's own. In the above example all the final -children have <tt>FL_DOWN_BOX</tt> types, and the "ridges" you see are -two adjacent <tt>FL_DOWN_BOX</tt>'s drawn next to each other. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Tile.Fl_Tile">Fl_Tile</a> - <li><a href="#Fl_Tile.~Fl_Tile">~Fl_Tile</a> - <li><a href="#Fl_Tile.position">position</a> - <li><a href="#Fl_Tile.resizeable">resizeable</a> -</ul> - -<h4><a name="Fl_Tile.Fl_Tile">Fl_Tile::Fl_Tile(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Tile</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Tile.~Fl_Tile">virtual Fl_Tile::~Fl_Tile()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Tile</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Tile</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Tile.position">void Fl_Tile::position(from_x, from_y, to_x, to_y)</a></h4> - -Drag the intersection at <tt>from_x,from_y</tt> to <tt>to_x,to_y</tt>. -This redraws all the necessary children. - -<h4><a name="Fl_Tile.resizeable">void Fl_Tile::resizable(Fl_Widget&)</a></h4> - -The "resizable" child widget (which should be invisible) limits where -the border can be dragged to. If you don't set it, it will be possible -to drag the borders right to the edge, and thus resize objects on the -edge to zero width or height. The <tt>resizable()</tt> widget is not -resized by dragging any borders. - -</body> -</html> + +----<A href=Fl_Pack.html#Fl_Pack>Fl_Pack</A>, <A href=Fl_Scroll.html#Fl_Scroll>Fl_Scroll</A>, <A href=Fl_Tabs.html#Fl_Tabs>Fl_Tabs</A>, <A href=#Fl_Tile>Fl_Tile</A>, <A href=Fl_Window.html#Fl_Window>Fl_Window</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Tile.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Tile</TT> class lets you resize the children by dragging +the border between them: +<P><IMG src=./Fl_Tile.gif></P> +<P><TT>Fl_Tile</TT> allows objects to be resized to zero dimensions. + To prevent this you can use the <TT>resizable()</TT> to limit where +corners can be dragged to. </P> +<P>Even though objects can be resized to zero sizes, they must +initially have non-zero sizes so the <TT>Fl_Tile</TT> can figure out +their layout. If desired, call <TT>position()</TT> after creating the +children but before displaying the window to set the borders where you +want. </P> +<P>The "borders" are part of the children, an <TT>Fl_Tile<TT>does not +draw any graphics of it's own. In the above example all the final +children have <TT>FL_DOWN_BOX</TT> types, and the "ridges" you see are +two adjacent <TT>FL_DOWN_BOX</TT>'s drawn next to each other. </TT></TT></P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Tile.Fl_Tile>Fl_Tile</A></LI> +<LI><A href=#Fl_Tile.~Fl_Tile>~Fl_Tile</A></LI> +<LI><A href=#Fl_Tile.position>position</A></LI> +<LI><A href=#Fl_Tile.resizeable>resizeable</A></LI> +</UL> +<H4><A name=Fl_Tile.Fl_Tile>Fl_Tile::Fl_Tile(int x, int y, int w, int +h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Tile</TT> widget using the given position, size, +and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Tile.~Fl_Tile>virtual Fl_Tile::~Fl_Tile()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Tile</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Tile</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Tile.position>void Fl_Tile::position(from_x, from_y, +to_x, to_y)</A></H4> + Drag the intersection at <TT>from_x,from_y</TT> to <TT>to_x,to_y</TT>. + This redraws all the necessary children. +<H4><A name=Fl_Tile.resizeable>void Fl_Tile::resizable(Fl_Widget The +"resizable" child widget (which should be invisible) limits where the +border can be dragged to. If you don't set it, it will be possible to +drag the borders right to the edge, and thus resize objects on the edge +to zero width or height. The <TT>resizable()</TT> widget is not +resized by dragging any borders. </A></H4> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Timer.html b/documentation/Fl_Timer.html index 950ec82a3..fef3acc77 100644 --- a/documentation/Fl_Timer.html +++ b/documentation/Fl_Timer.html @@ -1,81 +1,58 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Timer">class Fl_Timer</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Timer>class Fl_Timer</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Timer</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Timer.H> -</pre></ul> - -<h3>Description</h3> - -This is provided only to emulate the Forms Timer widget. It works by -making a timeout callback every 1/5 second. This is wasteful and -inaccurate if you just want something to happen a fixed time in the -future. You should directly call <a -href="#add_timeout"><tt>Fl::add_timeout()</tt></a> instead. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Timer.Fl_Timer">Fl_Timer</a> - <li><a href="#Fl_Timer.~Fl_Timer">~Fl_Timer</a> - <li><a href="#Fl_Timer.direction">direction</a> - <li><a href="#Fl_Timer.suspended">suspended</a> - <li><a href="#Fl_Timer.value">value</a> -</ul> - -<h4><a name="Fl_Timer.Fl_Timer">Fl_Timer::Fl_Timer(uchar type, int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Timer</tt> widget using the given type, position, size, and -label string. The <tt>type</tt> parameter can be any of the following symbolic -constants: - -<ul> - <li><tt>FL_NORMAL_TIMER</tt> - The timer just does the callback - and displays the string "Timer" in the widget. - - <li><tt>FL_VALUE_TIMER</tt> - The timer does the callback and - displays the current timer value in the widget. - - <li><tt>FL_HIDDEN_TIMER</tt> - The timer just does the callback - and does not display anything. -</ul> - -<h4><a name="Fl_Timer.~Fl_Timer">virtual Fl_Timer::~Fl_Timer()</a></h4> - -Destroys the timer and removes the timeout. - -<h4><a name="Fl_Timer.direction">char direction() const<br> -void direction(char d)</a></h4> - -Gets or sets the direction of the timer. If the direction is zero then -the timer will count up, otherwise it will count down from the initial -<tt>value()</tt>. - -<h4><a name="Fl_Timer.suspended">char suspended() const<br> -void suspended(char d)</a></h4> - -Gets or sets whether the timer is suspended. - -<h4><a name="Fl_Timer.value">float value() const<br> -void value(float)</a></h4> - -Gets or sets the current timer value. - -</body> -</html> + +----<B>Fl_Timer</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Timer.H> +</PRE> +</UL> +<H3>Description</H3> + This is provided only to emulate the Forms Timer widget. It works by +making a timeout callback every 1/5 second. This is wasteful and +inaccurate if you just want something to happen a fixed time in the +future. You should directly call <A href=functions.html#add_timeout><TT> +Fl::add_timeout()</TT></A> instead. +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Timer.Fl_Timer>Fl_Timer</A></LI> +<LI><A href=#Fl_Timer.~Fl_Timer>~Fl_Timer</A></LI> +<LI><A href=#Fl_Timer.direction>direction</A></LI> +<LI><A href=#Fl_Timer.suspended>suspended</A></LI> +<LI><A href=#Fl_Timer.value>value</A></LI> +</UL> +<H4><A name=Fl_Timer.Fl_Timer>Fl_Timer::Fl_Timer(uchar type, int x, int +y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Timer</TT> widget using the given type, position, +size, and label string. The <TT>type</TT> parameter can be any of the +following symbolic constants: +<UL> +<LI><TT>FL_NORMAL_TIMER</TT> - The timer just does the callback and +displays the string "Timer" in the widget. </LI> +<LI><TT>FL_VALUE_TIMER</TT> - The timer does the callback and displays +the current timer value in the widget. </LI> +<LI><TT>FL_HIDDEN_TIMER</TT> - The timer just does the callback and +does not display anything. </LI> +</UL> +<H4><A name=Fl_Timer.~Fl_Timer>virtual Fl_Timer::~Fl_Timer()</A></H4> + Destroys the timer and removes the timeout. +<H4><A name=Fl_Timer.direction>char direction() const +<BR> void direction(char d)</A></H4> + Gets or sets the direction of the timer. If the direction is zero +then the timer will count up, otherwise it will count down from the +initial <TT>value()</TT>. +<H4><A name=Fl_Timer.suspended>char suspended() const +<BR> void suspended(char d)</A></H4> + Gets or sets whether the timer is suspended. +<H4><A name=Fl_Timer.value>float value() const +<BR> void value(float)</A></H4> + Gets or sets the current timer value. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Valuator.html b/documentation/Fl_Valuator.html index 584c91270..ea0c8ca36 100644 --- a/documentation/Fl_Valuator.html +++ b/documentation/Fl_Valuator.html @@ -1,182 +1,136 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Valuator">class Fl_Valuator</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Widget">Fl_Widget</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Valuator>class Fl_Valuator</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A> | - +----<b>Fl_Valuator</b> + +----<B>Fl_Valuator</B> | - +----<a href="#Fl_Adjuster">Fl_Adjuster</a>, <a href="#Fl_Counter">Fl_Counter</a>, <a href="#Fl_Dial">Fl_Dial</a>, <a href="#Fl_Roller">Fl_Roller</a>, - <a href="#Fl_Slider">Fl_Slider</a>, <a href="#Fl_Value_Input">Fl_Value_Input</a>, <a href="#Fl_Value_Output">Fl_Value_Output</a>, -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Valuator.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Valuator</tt> class controls a single floating-point value -and provides a consistent interface to set the value, range, and step, -and insures that callbacks are done the same for every object. - -<p>There are probably more of these classes in fltk than any others: - -<p><img src=valuators.gif> - -<p>In the above diagram each box surrounds an actual subclass. These -are further differentiated by setting the <a -href=#Fl_Widget.type"><tt>type()</tt></a> of the widget to the symbolic -value labeling the widget. The ones labelled "0" are the default -versions with a <tt>type(0)<tt>. For consistency the symbol -<tt>FL_VERTICAL</tt> is defined as zero. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Valuator.Fl_Valuator">Fl_Valuator</a> - <li><a href="#Fl_Valuator.~Fl_Valuator">~Fl_Valuator</a> - <li><a href="#Fl_Valuator.changed">changed</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Valuator.clamp">clamp</a> - <li><a href="#Fl_Valuator.clear_changed">clear_changed</a> - <li><a href="#Fl_Valuator.format">format</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Valuator.increment">increment</a> - <li><a href="#Fl_Valuator.maximum">maximum</a> - <li><a href="#Fl_Valuator.minimum">minimum</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Valuator.range">range</a> - <li><a href="#Fl_Valuator.round">round</a> - <li><a href="#Fl_Valuator.set_changed">set_changed</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Valuator.step">step</a> - <li><a href="#Fl_Valuator.value">value</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Valuator.Fl_Valuator">Fl_Valuator::Fl_Valuator(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Valuator</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Valuator.~Fl_Valuator">virtual Fl_Valuator::~Fl_Valuator()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Valuator.value">double Fl_Valuator::value() const<br> -int Fl_Valuator::value(double)</a></h4> - -Get or set the current value. The new value is <i>not</i> clamped or -otherwise changed before storing it. Use <tt>clamp()</tt> or -<tt>round()</tt> to modify the value before calling this if you want. -If the new value is different than the current one the object is -redrawn. The initial value is zero. - -<h4><a name="Fl_Valuator.minimum">double Fl_Valuator::minimum() const<br> -void Fl_Valuator::minimum(double)</a></h4> - -Gets or sets the minimum value for the valuator. - -<h4><a name="Fl_Valuator.maximum">double Fl_Valuator::maximum() const<br> -void Fl_Valuator::maximum(double)</a></h4> - -Gets or sets the maximum value for the valuator. - -<h4><a name="Fl_Valuator.range">void Fl_Valuator::range(double min, double max);</a></h4> - -Sets the minimum and maximum values for the valuator. When the user -manipulates the widget, the value is limited to this range. This -clamping is done <i>after</i> rounding to the step value (this makes a -difference if the range is not a multiple of the step). - -<p>The minimum may be greater than the maximum. This has the effect -of "reversing" the object so the larger values are in the opposite -direction. This also switches which end of the filled sliders is -filled. - -<p>Some widgets consider this a "soft" range. This means they will -stop at the range, but if the user releases and grabs the control -again and tries to move it further, it is allowed. - -<p>The range may affect the display. You must <tt>redraw()</tt> the -widget after changing the range. - -<h4><a name="Fl_Valuator.step">double Fl_Valuator::step() const<br> -void Fl_Valuator::step(double)<br> -void Fl_Valuator::step(int A, int B)</a></h4> - -Get or set the step value. As the user moves the mouse the value is -rounded to the nearest multiple of the step value. This is done -<i>before</i> clamping it to the range. For most -objects the default step is zero. - -<p>For precision the step is stored as the ratio of two integers, -A/B. You can set these integers directly. Currently setting a -floating point value sets the nearest A/1 or 1/B value possible. - -<h4><a name="Fl_Valuator.format">int Fl_Valuator::format(char*, double)</a></h4> - -Format the passed value to show enough digits so that for the current -step value. If the step has been set to zero then it does a -<tt>%g</tt> format. The characters are written into the passed buffer. - -<h4><a name="Fl_Valuator.round">double Fl_Valuator::round(double)</a></h4> - -Round the passed value to the nearest step increment. Does nothing if -step is zero. - -<h4><a name="Fl_Valuator.clamp">double Fl_Valuator::clamp(double)</a></h4> - -Clamp the passed value to the valuator range. - -<h4><a name="Fl_Valuator.increment">double Fl_Valuator::increment(double,int n)</a></h4> - -Adds <tt>n</tt> times the step value to the passed value. If step was set to -zero it uses <tt>fabs(maximum() - minimum()) / 100</tt>. - -<h4><a name="Fl_Valuator.changed">int Fl_Widget::changed() const</a></h4> - -This value is true if the user has moved the slider. It is turned -off by <tt>value(x)</tt> and just before doing a callback (the callback can -turn it back on if desired). - -<h4><a name="Fl_Valuator.set_changed">void Fl_Widget::set_changed()</a><h4> - -Sets the <tt>changed()</tt> flag. - -<h4><a name="Fl_Valuator.clear_changed">void Fl_Widget::clear_changed()</a></h4> - -Clears the <tt>changed()</tt> flag. - -</body> -</html> + +----<A href=Fl_Adjuster.html#Fl_Adjuster>Fl_Adjuster</A>, <A href=Fl_Counter.html#Fl_Counter>Fl_Counter</A>, <A href=Fl_Dial.html#Fl_Dial>Fl_Dial</A>, <A href=Fl_Roller.html#Fl_Roller>Fl_Roller</A>, + <A href=Fl_Slider.html#Fl_Slider>Fl_Slider</A>, <A href=Fl_Value_Input.html#Fl_Value_Input>Fl_Value_Input</A>, <A href=Fl_Value_Output.html#Fl_Value_Output>Fl_Value_Output</A>, +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Valuator.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Valuator</TT> class controls a single floating-point value +and provides a consistent interface to set the value, range, and step, +and insures that callbacks are done the same for every object. +<P>There are probably more of these classes in fltk than any others: </P> +<P><IMG src=./valuators.gif></P> +<P>In the above diagram each box surrounds an actual subclass. These +are further differentiated by setting the <A href=#Fl_Widget.type"><TT> +type()</TT></A> of the widget to the symbolic value labeling the +widget. The ones labelled "0" are the default versions with a <TT> +type(0)<TT>. For consistency the symbol <TT>FL_VERTICAL</TT> is +defined as zero. </TT></TT></P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Valuator.Fl_Valuator>Fl_Valuator</A></LI> +<LI><A href=#Fl_Valuator.~Fl_Valuator>~Fl_Valuator</A></LI> +<LI><A href=#Fl_Valuator.changed>changed</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Valuator.clamp>clamp</A></LI> +<LI><A href=#Fl_Valuator.clear_changed>clear_changed</A></LI> +<LI><A href=#Fl_Valuator.format>format</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Valuator.increment>increment</A></LI> +<LI><A href=#Fl_Valuator.maximum>maximum</A></LI> +<LI><A href=#Fl_Valuator.minimum>minimum</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Valuator.range>range</A></LI> +<LI><A href=#Fl_Valuator.round>round</A></LI> +<LI><A href=#Fl_Valuator.set_changed>set_changed</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Valuator.step>step</A></LI> +<LI><A href=#Fl_Valuator.value>value</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Valuator.Fl_Valuator>Fl_Valuator::Fl_Valuator(int x, int +y, int w, int h, const char *label = 0)</A></H4> + Creates a new <TT>Fl_Valuator</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Valuator.~Fl_Valuator>virtual Fl_Valuator::~Fl_Valuator()</A> +</H4> + Destroys the valuator. +<H4><A name=Fl_Valuator.value>double Fl_Valuator::value() const +<BR> int Fl_Valuator::value(double)</A></H4> + Get or set the current value. The new value is <I>not</I> clamped or +otherwise changed before storing it. Use <TT>clamp()</TT> or <TT>round()</TT> + to modify the value before calling this if you want. If the new value +is different than the current one the object is redrawn. The initial +value is zero. +<H4><A name=Fl_Valuator.minimum>double Fl_Valuator::minimum() const +<BR> void Fl_Valuator::minimum(double)</A></H4> + Gets or sets the minimum value for the valuator. +<H4><A name=Fl_Valuator.maximum>double Fl_Valuator::maximum() const +<BR> void Fl_Valuator::maximum(double)</A></H4> + Gets or sets the maximum value for the valuator. +<H4><A name=Fl_Valuator.range>void Fl_Valuator::range(double min, +double max);</A></H4> + Sets the minimum and maximum values for the valuator. When the user +manipulates the widget, the value is limited to this range. This +clamping is done <I>after</I> rounding to the step value (this makes a +difference if the range is not a multiple of the step). +<P>The minimum may be greater than the maximum. This has the effect of +"reversing" the object so the larger values are in the opposite +direction. This also switches which end of the filled sliders is +filled. </P> +<P>Some widgets consider this a "soft" range. This means they will +stop at the range, but if the user releases and grabs the control again +and tries to move it further, it is allowed. </P> +<P>The range may affect the display. You must <TT>redraw()</TT> the +widget after changing the range. </P> +<H4><A name=Fl_Valuator.step>double Fl_Valuator::step() const +<BR> void Fl_Valuator::step(double) +<BR> void Fl_Valuator::step(int A, int B)</A></H4> + Get or set the step value. As the user moves the mouse the value is +rounded to the nearest multiple of the step value. This is done <I> +before</I> clamping it to the range. For most objects the default step +is zero. +<P>For precision the step is stored as the ratio of two integers, A/B. + You can set these integers directly. Currently setting a floating +point value sets the nearest A/1 or 1/B value possible. </P> +<H4><A name=Fl_Valuator.format>int Fl_Valuator::format(char*, double)</A> +</H4> + Format the passed value to show enough digits so that for the current +step value. If the step has been set to zero then it does a <TT>%g</TT> + format. The characters are written into the passed buffer. +<H4><A name=Fl_Valuator.round>double Fl_Valuator::round(double)</A></H4> + Round the passed value to the nearest step increment. Does nothing if +step is zero. +<H4><A name=Fl_Valuator.clamp>double Fl_Valuator::clamp(double)</A></H4> + Clamp the passed value to the valuator range. +<H4><A name=Fl_Valuator.increment>double +Fl_Valuator::increment(double,int n)</A></H4> + Adds <TT>n</TT> times the step value to the passed value. If step was +set to zero it uses <TT>fabs(maximum() - minimum()) / 100</TT>. +<H4><A name=Fl_Valuator.changed>int Fl_Widget::changed() const</A></H4> + This value is true if the user has moved the slider. It is turned off +by <TT>value(x)</TT> and just before doing a callback (the callback can +turn it back on if desired). +<H4><A name=Fl_Valuator.set_changed>void Fl_Widget::set_changed()</A></H4> +<H4>Sets the <TT>changed()</TT> flag. </H4> +<H4><A name=Fl_Valuator.clear_changed>void Fl_Widget::clear_changed()</A> +</H4> + Clears the <TT>changed()</TT> flag. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Value_Input.html b/documentation/Fl_Value_Input.html index 597d07f27..9dfd5d9df 100644 --- a/documentation/Fl_Value_Input.html +++ b/documentation/Fl_Value_Input.html @@ -1,89 +1,71 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Value_Input">class Fl_Value_Input</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Value_Input>class Fl_Value_Input</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Value_Input</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Value_Input.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Value_Input</tt> widget displays a floating point value. -The user can click in the text field and edit it (there is in fact -a hidden <a href="#Fl_Value_Input"><tt>Fl_Value_Input</tt></a> widget with -<tt>type(FL_FLOAT_INPUT)</tt> in there), and when they hit return -or tab the value updates to what they typed and the callback is done. - -<p>If <tt>step()</tt> is not zero, the user can also drag the mouse -across the object and thus slide the value. The left button moves one -<tt>step()</tt> per pixel, the middle by <tt>10 * step()</tt>, and the -left button by <tt>100 * step()</tt>. It is then impossible to select -text by dragging across it, although clicking can still move the -insertion cursor. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Value_Input.Fl_Value_Input">Fl_Value_Input</a> - <li><a href="#Fl_Value_Input.~Fl_Value_Input">~Fl_Value_Input</a> - <li><a href="#Fl_Value_Input.cursor_color">cursor_color</a> - <li><a href="#Fl_Value_Input.soft">soft</a> - <li><a href="#Fl_Value_Input.textcolor">textcolor</a> - <li><a href="#Fl_Value_Input.textfont">textfont</a> - <li><a href="#Fl_Value_Input.textsize">textsize</a> -</ul> - -<h4><a name="Fl_Value_Input.Fl_Value_Input">Fl_Value_Input::Fl_Value_Input(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Value_Input</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Value_Input.~Fl_Value_Input">virtual Fl_Value_Input::~Fl_Value_Input()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Value_Input.cursor_color">Fl_Color Fl_Value_Input::cursor_color() const<br> -void Fl_Value_Input::cursor_color(Fl_Color)</a></h4> - -Get or set the color of the cursor. This is black by default. - -<h4><a name="Fl_Value_Input.soft">uchar Fl_Value_Input::soft() const<br> -void Fl_Value_Input::soft(uchar)</a></h4> - -If "soft" is turned on, the user is allowed to drag the value outside -the range. If they drag the value to one of the ends, let go, then -grab again and continue to drag, they can get to any value. Default -is one. - -<h4><a name="Fl_Value_Input.textcolor">Fl_Color Fl_Value_Input::textcolor() const<br> -void Fl_Value_Input::textcolor(Fl_Color)</a></h4> - -Gets or sets the color of the text in the value box. - -<h4><a name="Fl_Value_Input.textfont">Fl_Font Fl_Value_Input::textfont() const<br> -<br>void Fl_Value_Input::textfont(Fl_Font)</a></h4> - -Gets or sets the typeface of the text in the value box. - -<h4><a name="Fl_Value_Input.textsize">uchar Fl_Value_Input::textsize() const<br> -void Fl_Value_Input::textsize(uchar)</a></h4> - -Gets or sets the size of the text in the value box. - -</body> -</html> + +----<B>Fl_Value_Input</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Value_Input.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Value_Input</TT> widget displays a floating point value. +The user can click in the text field and edit it (there is in fact a +hidden <A href=#Fl_Value_Input><TT>Fl_Value_Input</TT></A> widget with <TT> +type(FL_FLOAT_INPUT)</TT> in there), and when they hit return or tab +the value updates to what they typed and the callback is done. +<P>If <TT>step()</TT> is not zero, the user can also drag the mouse +across the object and thus slide the value. The left button moves one <TT> +step()</TT> per pixel, the middle by <TT>10 * step()</TT>, and the left +button by <TT>100 * step()</TT>. It is then impossible to select text +by dragging across it, although clicking can still move the insertion +cursor. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Value_Input.Fl_Value_Input>Fl_Value_Input</A></LI> +<LI><A href=#Fl_Value_Input.~Fl_Value_Input>~Fl_Value_Input</A></LI> +<LI><A href=#Fl_Value_Input.cursor_color>cursor_color</A></LI> +<LI><A href=#Fl_Value_Input.soft>soft</A></LI> +<LI><A href=#Fl_Value_Input.textcolor>textcolor</A></LI> +<LI><A href=#Fl_Value_Input.textfont>textfont</A></LI> +<LI><A href=#Fl_Value_Input.textsize>textsize</A></LI> +</UL> +<H4><A name=Fl_Value_Input.Fl_Value_Input> +Fl_Value_Input::Fl_Value_Input(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Value_Input</TT> widget using the given position, +size, and label string. The default boxtype is <TT>FL_NO_BOX</TT>. +<H4><A name=Fl_Value_Input.~Fl_Value_Input>virtual +Fl_Value_Input::~Fl_Value_Input()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Value_Input.cursor_color>Fl_Color +Fl_Value_Input::cursor_color() const +<BR> void Fl_Value_Input::cursor_color(Fl_Color)</A></H4> + Get or set the color of the cursor. This is black by default. +<H4><A name=Fl_Value_Input.soft>uchar Fl_Value_Input::soft() const +<BR> void Fl_Value_Input::soft(uchar)</A></H4> + If "soft" is turned on, the user is allowed to drag the value outside +the range. If they drag the value to one of the ends, let go, then +grab again and continue to drag, they can get to any value. Default is +one. +<H4><A name=Fl_Value_Input.textcolor>Fl_Color +Fl_Value_Input::textcolor() const +<BR> void Fl_Value_Input::textcolor(Fl_Color)</A></H4> + Gets or sets the color of the text in the value box. +<H4><A name=Fl_Value_Input.textfont>Fl_Font Fl_Value_Input::textfont() +const +<BR> +<BR>void Fl_Value_Input::textfont(Fl_Font)</A></H4> + Gets or sets the typeface of the text in the value box. +<H4><A name=Fl_Value_Input.textsize>uchar Fl_Value_Input::textsize() +const +<BR> void Fl_Value_Input::textsize(uchar)</A></H4> + Gets or sets the size of the text in the value box. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Value_Output.html b/documentation/Fl_Value_Output.html index 254f7ded0..d021f1ea1 100644 --- a/documentation/Fl_Value_Output.html +++ b/documentation/Fl_Value_Output.html @@ -1,80 +1,64 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Value_Output">class Fl_Value_Output</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Valuator">Fl_Valuator</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Value_Output>class Fl_Value_Output</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> | - +----<b>Fl_Value_Output</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Value_Output.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Value_Output</tt> widget displays a floating point value. If -<tt>step()</tt> is not zero, the user can adjust the value by dragging -the mouse left and right. The left button moves one <tt>step()</tt> -per pixel, the middle by <tt>10 * step()</tt>, and the right button by -<tt>100 * step()</tt>. - -<p>This is much lighter-weight than <a -href=#Fl_Value_Input><tt>Fl_Value_Input</tt></a> because it contains no -text editing code or character buffer. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Value_Output.Fl_Value_Output">Fl_Value_Output</a> - <li><a href="#Fl_Value_Output.~Fl_Value_Output">~Fl_Value_Output</a> - <li><a href="#Fl_Value_Output.soft">soft</a> - <li><a href="#Fl_Value_Output.textcolor">textcolor</a> - <li><a href="#Fl_Value_Output.textfont">textfont</a> - <li><a href="#Fl_Value_Output.textsize">textsize</a> -</ul> - -<h4><a name="Fl_Value_Output.Fl_Value_Output">Fl_Value_Output::Fl_Value_Output(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Value_Output</tt> widget using the given position, size, and -label string. The default boxtype is <tt>FL_NO_BOX</tt>. - -<h4><a name="Fl_Value_Output.~Fl_Value_Output">virtual Fl_Value_Output::~Fl_Value_Output()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Value_Output.soft">uchar Fl_Value_Output::soft() const<br> -void Fl_Value_Output::soft(uchar)</a></h4> - -If "soft" is turned on, the user is allowed to drag the value outside -the range. If they drag the value to one of the ends, let go, then -grab again and continue to drag, they can get to any value. Default -is one. - -<h4><a name="Fl_Value_Output.textcolor">Fl_Color Fl_Value_Output::textcolor() const<br> -void Fl_Value_Output::textcolor(Fl_Color)</a></h4> - -Gets or sets the color of the text in the value box. - -<h4><a name="Fl_Value_Output.textfont">Fl_Font Fl_Value_Output::textfont() const<br> -<br>void Fl_Value_Output::textfont(Fl_Font)</a></h4> - -Gets or sets the typeface of the text in the value box. - -<h4><a name="Fl_Value_Output.textsize">uchar Fl_Value_Output::textsize() const<br> -void Fl_Value_Output::textsize(uchar)</a></h4> - -Gets or sets the size of the text in the value box. - -</body> -</html> + +----<B>Fl_Value_Output</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Value_Output.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Value_Output</TT> widget displays a floating point value. +If <TT>step()</TT> is not zero, the user can adjust the value by +dragging the mouse left and right. The left button moves one <TT>step()</TT> + per pixel, the middle by <TT>10 * step()</TT>, and the right button by <TT> +100 * step()</TT>. +<P>This is much lighter-weight than <A href=Fl_Value_Input.html#Fl_Value_Input> +<TT>Fl_Value_Input</TT></A> because it contains no text editing code or +character buffer. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Value_Output.Fl_Value_Output>Fl_Value_Output</A></LI> +<LI><A href=#Fl_Value_Output.~Fl_Value_Output>~Fl_Value_Output</A></LI> +<LI><A href=#Fl_Value_Output.soft>soft</A></LI> +<LI><A href=#Fl_Value_Output.textcolor>textcolor</A></LI> +<LI><A href=#Fl_Value_Output.textfont>textfont</A></LI> +<LI><A href=#Fl_Value_Output.textsize>textsize</A></LI> +</UL> +<H4><A name=Fl_Value_Output.Fl_Value_Output> +Fl_Value_Output::Fl_Value_Output(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Value_Output</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_NO_BOX</TT> +. +<H4><A name=Fl_Value_Output.~Fl_Value_Output>virtual +Fl_Value_Output::~Fl_Value_Output()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Value_Output.soft>uchar Fl_Value_Output::soft() const +<BR> void Fl_Value_Output::soft(uchar)</A></H4> + If "soft" is turned on, the user is allowed to drag the value outside +the range. If they drag the value to one of the ends, let go, then +grab again and continue to drag, they can get to any value. Default is +one. +<H4><A name=Fl_Value_Output.textcolor>Fl_Color +Fl_Value_Output::textcolor() const +<BR> void Fl_Value_Output::textcolor(Fl_Color)</A></H4> + Gets or sets the color of the text in the value box. +<H4><A name=Fl_Value_Output.textfont>Fl_Font +Fl_Value_Output::textfont() const +<BR> +<BR>void Fl_Value_Output::textfont(Fl_Font)</A></H4> + Gets or sets the typeface of the text in the value box. +<H4><A name=Fl_Value_Output.textsize>uchar Fl_Value_Output::textsize() +const +<BR> void Fl_Value_Output::textsize(uchar)</A></H4> + Gets or sets the size of the text in the value box. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Value_Slider.html b/documentation/Fl_Value_Slider.html index b8be9ef6d..847330b3e 100644 --- a/documentation/Fl_Value_Slider.html +++ b/documentation/Fl_Value_Slider.html @@ -1,67 +1,52 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Value_Slider">class Fl_Value_Slider</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Slider">Fl_Slider</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Value_Slider>class Fl_Value_Slider</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Slider.html#Fl_Slider>Fl_Slider</A> | - +----<b>Fl_Value_Slider</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Value_Slider.H> -</pre></ul> - -<h3>Description</h3> - -The <tt>Fl_Value_Slider</tt> widget is a <tt>Fl_Slider</tt> widget with -a box displaying the current value. - -<p><img src=value_slider.gif> - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Value_Slider.Fl_Value_Slider">Fl_Value_Slider</a> - <li><a href="#Fl_Value_Slider.~Fl_Value_Slider">~Fl_Value_Slider</a> - <li><a href="#Fl_Value_Slider.textcolor">textcolor</a> - <li><a href="#Fl_Value_Slider.textfont">textfont</a> - <li><a href="#Fl_Value_Slider.textsize">textsize</a> -</ul> - -<h4><a name="Fl_Value_Slider.Fl_Value_Slider">Fl_Value_Slider::Fl_Value_Slider(int x, int y, int w, int h, const char *label = 0)</a></h4> - -Creates a new <tt>Fl_Value_Slider</tt> widget using the given position, -size, and label string. The default boxtype is <tt>FL_DOWN_BOX</tt>. - -<h4><a name="Fl_Value_Slider.~Fl_Value_Slider">virtual Fl_Value_Slider::~Fl_Value_Slider()</a></h4> - -Destroys the valuator. - -<h4><a name="Fl_Value_Slider.textcolor">Fl_Color Fl_Value_Slider::textcolor() const<br> -void Fl_Value_Slider::textcolor(Fl_Color)</a></h4> - -Gets or sets the color of the text in the value box. - -<h4><a name="Fl_Value_Slider.textfont">Fl_Font Fl_Value_Slider::textfont() const<br> -<br>void Fl_Value_Slider::textfont(Fl_Font)</a></h4> - -Gets or sets the typeface of the text in the value box. - -<h4><a name="Fl_Value_Slider.textsize">uchar Fl_Value_Slider::textsize() const<br> -void Fl_Value_Slider::textsize(uchar)</a></h4> - -Gets or sets the size of the text in the value box. - -</body> -</html> - + +----<B>Fl_Value_Slider</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Value_Slider.H> +</PRE> +</UL> +<H3>Description</H3> + The <TT>Fl_Value_Slider</TT> widget is a <TT>Fl_Slider</TT> widget +with a box displaying the current value. +<P><IMG src=./value_slider.gif></P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Value_Slider.Fl_Value_Slider>Fl_Value_Slider</A></LI> +<LI><A href=#Fl_Value_Slider.~Fl_Value_Slider>~Fl_Value_Slider</A></LI> +<LI><A href=#Fl_Value_Slider.textcolor>textcolor</A></LI> +<LI><A href=#Fl_Value_Slider.textfont>textfont</A></LI> +<LI><A href=#Fl_Value_Slider.textsize>textsize</A></LI> +</UL> +<H4><A name=Fl_Value_Slider.Fl_Value_Slider> +Fl_Value_Slider::Fl_Value_Slider(int x, int y, int w, int h, const char +*label = 0)</A></H4> + Creates a new <TT>Fl_Value_Slider</TT> widget using the given +position, size, and label string. The default boxtype is <TT>FL_DOWN_BOX</TT> +. +<H4><A name=Fl_Value_Slider.~Fl_Value_Slider>virtual +Fl_Value_Slider::~Fl_Value_Slider()</A></H4> + Destroys the valuator. +<H4><A name=Fl_Value_Slider.textcolor>Fl_Color +Fl_Value_Slider::textcolor() const +<BR> void Fl_Value_Slider::textcolor(Fl_Color)</A></H4> + Gets or sets the color of the text in the value box. +<H4><A name=Fl_Value_Slider.textfont>Fl_Font +Fl_Value_Slider::textfont() const +<BR> +<BR>void Fl_Value_Slider::textfont(Fl_Font)</A></H4> + Gets or sets the typeface of the text in the value box. +<H4><A name=Fl_Value_Slider.textsize>uchar Fl_Value_Slider::textsize() +const +<BR> void Fl_Value_Slider::textsize(uchar)</A></H4> + Gets or sets the size of the text in the value box. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Widget.html b/documentation/Fl_Widget.html index 933e1ef7e..1009a0726 100644 --- a/documentation/Fl_Widget.html +++ b/documentation/Fl_Widget.html @@ -1,368 +1,293 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Widget">class Fl_Widget</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<b>Fl_Widget</b> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Widget>class Fl_Widget</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<B>Fl_Widget</B> | - +----<a href="#Fl_Box">Fl_Box</a>, <a href="#Fl_Browser">Fl_Browser</a>, <a href="#Fl_Button">Fl_Button</a>, <a href="#Fl_Chart">Fl_Chart</a>, <a href="#Fl_Clock">Fl_Clock</a>, - <a href="#Fl_Free">Fl_Free</a>, <a href="#Fl_Group">Fl_Group</a>, <a href="#Fl_Input">Fl_Input</a>, <a href="#Fl_Menu_">Fl_Menu_</a>, <a href="#Fl_Positioner">Fl_Positioner</a>, - <a href="#Fl_Timer">Fl_Timer</a>, <a href="#Fl_Valuator">Fl_Valuator</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Widget.H> -</pre></ul> - -<h3>Description</h3> - -<tt>Fl_Widget</tt> is the base class for all widgets in FLTK. You can't create -one of these because the constructor is not public. However you can -<a href=#subclassing">subclass</a> it. - -<p>All "property" accessing methods, such as <tt>color()</tt>, -<tt>parent()</tt>, or <tt>argument()</tt> are implemented as trivial inline -functions and thus are as fast and small as accessing fields in a structure. -Unless otherwise noted, the property setting methods such as <tt>color(n)</tt> -or <tt>label(s)</tt> are also trivial inline functions, even if they change -the widget's appearance. It is up to the user code to call <tt>redraw()</tt> -after these. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Widget.Fl_Widget">Fl_Widget</a> - <li><a href="#Fl_Widget.~Fl_Widget">~Fl_Widget</a> - <li><a href="#Fl_Widget.activate">activate</a> - <li><a href="#Fl_Widget.active">active</a> - <li><a href="#Fl_Widget.activevisible">activevisible</a> - <li><a href="#Fl_Widget.align">align</a> - <li><a href="#Fl_Widget.argument">argument</a> - <li><a href="#Fl_Widget.box">box</a> - <li><a href="#Fl_Widget.callback">callback</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Widget.changed">changed</a> - <li><a href="#Fl_Widget.clear_changed">clear_changed</a> - <li><a href="#Fl_Widget.color">color</a> - <li><a href="#Fl_Widget.contains">contains</a> - <li><a href="#Fl_Widget.damage">damage</a> - <li><a href="#Fl_Widget.deactivate">deactivate</a> - <li><a href="#Fl_Widget.default_callback">default_callback</a> - <li><a href="#Fl_Widget.do_callback">do_callback</a> - <li><a href="#Fl_Widget.h">h</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Widget.hide">hide</a> - <li><a href="#Fl_Widget.inside">inside</a> - <li><a href="#Fl_Widget.label">label</a> - <li><a href="#Fl_Widget.labelcolor">labelcolor</a> - <li><a href="#Fl_Widget.labelfont">labelfont</a> - <li><a href="#Fl_Widget.labelsize">labelsize</a> - <li><a href="#Fl_Widget.labeltype">labeltype</a> - <li><a href="#Fl_Widget.parent">parent</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Widget.position">position</a> - <li><a href="#Fl_Widget.redraw">redraw</a> - <li><a href="#Fl_Widget.resize">resize</a> - <li><a href="#Fl_Widget.selection_color">selection_color</a> - <li><a href="#Fl_Widget.set_changed">set_changed</a> - <li><a href="#Fl_Widget.show">show</a> - <li><a href="#Fl_Widget.size">size</a> - <li><a href="#Fl_Widget.take_focus">take_focus</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Widget.type">type</a> - <li><a href="#Fl_Widget.user_data">user_data</a> - <li><a href="#Fl_Widget.visible">visible</a> - <li><a href="#Fl_Widget.w">w</a> - <li><a href="#Fl_Widget.when">when</a> - <li><a href="#Fl_Widget.window">window</a> - <li><a href="#Fl_Widget.x">x</a> - <li><a href="#Fl_Widget.y">y</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4>Fl_Widget::Fl_Widget(int x, int y, int w, int h, const char* label=0);</h4> - -This is the protected constructor for an Fl_Widget, but all derived -widgets have a matching public constructor. It takes a value for -x(), y(), w(), h(), and an optional value for label(). - -<h4>virtual Fl_Widget::~Fl_Widget();</h4> - -Destroying single widgets is not very common. It is your -responsibility to either remove() them from any enclosing group, or to -destroy that group <i>immediately</i> after destroying the children. - -<h4>uchar Fl_Widget::type() const;</h4> - -This value is used for Forms compatability and to simulate RTTI. - -<h4><a name="Fl_Widget.x">short Fl_Widget::x() const</a><br> -<a name="Fl_Widget.y">short Fl_Widget::y() const</a><br> -<a name="Fl_Widget.w">short Fl_Widget::w() const</a><br> -<a name="Fl_Widget.h">short Fl_Widget::h() const</a></h4> - -The position of the upper-left corner of the widget in its enclosing -Fl_Window (<i>not</i> its parent if that is not an Fl_Window), and its -width and height. - -<h4><a name="Fl_Widget.resize">virtual void Fl_Widget::resize(int,int,int,int)</a><br> -<a name="Fl_Widget.position">void Fl_Widget::position(short x,short y)</a><br> -<a name="Fl_Widget.size">void Fl_Widget::size(short w,short h)</a></h4> - -Change the size or position of the widget. This is a virtual function -so the widget may implement it's own handling of resizing. The -default version does <i>not</i> do redraw(), that is the parent -widget's responsibility (this is because the parent may know a faster -way to update the display, such as scrolling from the old position). - -<p><tt>position(x,y)</tt> is a shortcut for <tt>resize(x,y,w(),h())</tt>, -and <tt>size(w,h)</tt> is a shortcut for <tt>resize(x(),y(),w,h)</tt>. - -<h4><a name="Fl_Widget.window">Fl_Window* Fl_Widget::window() const;</a></h4> - -Return a pointer to the <a href="#Fl_Window"><tt>Fl_Window</tt></a> -that this widget is in (it will skip any and all parent widgets between -this and the window). Returns <tt>NULL</tt> if none. Note: for an -<tt>Fl_Window</tt>, this returns it's <i>parent</i> window (if any), -not <i>this</i> window. - -<h4><a name="Fl_Widget.box">Fl_Boxtype Fl_Widget::box() const<br> -void Fl_Widget::box(Fl_Boxtype)</a></h4> - -The <tt>box()</tt> identifies a routine that draws the background of the -widget. See <a href="#BoxTypes">Box Types</a> for the available -types. The default depends on the widget, but is usually <tt>FL_NO_BOX</tt> -or <tt>FL_UP_BOX</tt>. - -<h4><a name="Fl_Widget.color">Fl_Color Fl_Widget::color() const<br> -void Fl_Widget::color(Fl_Color)</a></h4> - -This color is passed to the box routine. Color is an index into an -internal table of rgb colors. For most widgets this defaults to -<tt>FL_GRAY</tt>. See the <a href="#Enumerations">enumeration list</a> -for predefined colors. Use -<a href="#set_color"><tt>Fl::set_color()</tt></a> to redefine colors. - -<h4><a name="Fl_Widget.selection_color">Fl_Color Fl_Widget::selection_color() const<BR> -void Fl_Widget::selection_color(Fl_Color)</a><br> -void Fl_Widget::color(Fl_Color, Fl_Color)</h4> - -For Forms compatibility a second color is defined. This is usually -used to color the widget when it is selected, although some widgets -use this color for other purposes. You can set both colors at once -with <tt>color(a,b)</tt>. - -<h4><a name="Fl_Widget.label">const char* Fl_Widget::label() const<br> -void Fl_Widget::label(const char*)</a></h4> - -The label is printed somewhere on the widget or next to it. The -string is <i>not</i> copied, the passed pointer is stored unchanged in -the widget. - -<h4><a name="Fl_Widget.labeltype">void Fl_Widget::label(Fl_Labeltype, const char*)<br> -uchar Fl_Widget::labeltype() const<br> -void Fl_Widget::labeltype(Fl_Labeltype)</a></h4> - -A <a href=#LabelTypes><tt>labeltype</tt></a> identifies a routine that -draws the label of the widget. This can be used for special effects -such as emboss, or to use the <tt>label()</tt> pointer as another form -of data such as a bitmap. The value <tt>FL_NORMAL_LABEL</tt> prints -the label as text. - -<h4><a name="Fl_Widget.align">Fl_Align Fl_Widget::align() const<br> -void Fl_Widget::align(Fl_Align)</a></h4> - -How the label is printed next to or inside the widget. The default -value is <tt>FL_ALIGN_CENTER</tt>, which centers the label. The value -can be any of these constants or'd together: - -<tt><ul> -<li>FL_ALIGN_CENTER -<li>FL_ALIGN_TOP -<li>FL_ALIGN_BOTTOM -<li>FL_ALIGN_LEFT -<li>FL_ALIGN_RIGHT -<li>FL_ALIGN_INSIDE -<li>FL_ALIGN_CLIP -<li>FL_ALIGN_WRAP -</ul></tt> - -<h4><a name="Fl_Widget.labelcolor">Fl_Color Fl_Widget::labelcolor() const<br> -void Fl_Widget::labelcolor(Fl_Color)</a></h4> - -This color is passed to the labeltype routine, and is typically the -color of the label text. This defaults to <tt>FL_BLACK</tt>. - -<h4><a name="Fl_Widget.labelfont">Fl_Font Fl_Widget::labelfont() const<br> -void Fl_Widget::labelfont(Fl_Font)</a></h4> - -Fonts are identified by small 8-bit indexes into a table. See the -<a href="#Enumerations">enumeration list</a> for predefined typefaces. The -default value uses a Helvetica typeface (Arial for Microsoft® -Windows®). The function <a href="#set_font"><tt>Fl::set_font() -</tt></a> can define new typefaces. - -<h4><a name="Fl_Widget.labelsize">uchar Fl_Widget::labelsize() const<br> -void Fl_Widget::labelsize(uchar)</a></h4> - -Fonts are further identified by a point size. The default is 14. - -<h4><a name="Fl_Widget.callback">typedef void (Fl_Callback)(Fl_Widget*, void*)<br> -Fl_Callback* Fl_Widget::callback() const<br> -void Fl_Widget::callback(Fl_Callback*, void* = 0)</a></h4> - -Each widget has a single callback. You can set it or examine it with -these methods. - -<h4><a name="Fl_Widget.user_data">void* Fl_Widget::user_data() const<br> -void Fl_Widget::user_data(void*)</a></h4> - -You can also just change the <tt>void *</tt> second argument to the callback -with the <tt>user_data</tt> methods. - -<h4><a name="Fl_Widget.argument">void Fl_Widget::callback(void (*)(Fl_Widget*, long), long = 0)<br> -long Fl_Widget::argument() const<br> -void Fl_Widget::argument(long)</a></h4> - -For convenience you can also define the callback as taking a long -argument. This is implemented by casting this to a -<tt>Fl_Callback</tt> and casting the <tt>long</tt> to a <tt>void *</tt> -and may not be portable to some machines. - -<h4>void Fl_Widget::callback(void (*)(Fl_Widget*))</h4> - -For convenience you can also define the callback as taking only one -argument. This is implemented by casting this to a -<tt>Fl_Callback</tt> and may not be portable to some machines. - -<h4><a name="Fl_Widget.do_callback">void Fl_Widget::do_callback()<br> -void Fl_Widget::do_callback(Fl_Widget*, void* = 0)<br> -void Fl_Widget::do_callback(Fl_Widget*, long)</a></h4> - -You can cause a widget to do its callback at any time, and even pass -arbitrary arguments. - -<h4><a name="Fl_Widget.changed">int Fl_Widget::changed() const</a><br> -<a name="Fl_Widget.set_changed">void Fl_Widget::set_changed()</a><br> -<a name="Fl_Widget.clear_changed">void Fl_Widget::clear_changed()</a></h4> - -<tt>Fl_Widget::changed()</tt> is a flag that is turned on when the user -changes the value stored in the widget. This is only used by -subclasses of <tt>Fl_Widget</tt> that store values, but is in the base -class so it is easier to scan all the widgets in a panel and -<tt>do_callback()</tt> on the changed ones in response to an "OK" -button. - -<p>Most widgets turn this flag off when they do the callback, and when -the program sets the stored value. - -<h4><a name="Fl_Widget.when">Fl_When Fl_Widget::when() const<br> -void Fl_Widget::when(Fl_When)</a></h4> - -<tt>Fl_Widget::when()</tt> is a set of bitflags used by subclasses of -<tt>Fl_Widget</tt> to decide when to do the callback. If the value is -zero then the callback is never done. Other values are described in -the individual widgets. This field is in the base class so that you -can scan a panel and <tt>do_callback()</tt> on all the ones that don't -do their own callbacks in response to an "OK" button. - -<h4><a name="Fl_Widget.default_callback">static void Fl_Widget::default_callback(Fl_Widget*, void*)</a></h4> - -The default callback, which puts a pointer to the widget on the queue -returned by <a href="#readqueue"><tt>Fl::readqueue()</tt></a>. You -may want to call this from your own callback. - -<h4><a name="Fl_Widget.visible">int Fl_Widget::visible() const</a><br> -<a name="Fl_Widget.show">void Fl_Widget::show()</a><br> -<a name="Fl_Widget.hide">void Fl_Widget::hide()</a></h4> - -An invisible widget never gets redrawn and does not get events. An -widget is really visible if <tt>visible()</tt> is true on it <i>and all -it's parents</i>. Changing it will send <tt>FL_SHOW</tt> or -<tt>FL_HIDE</tt> events to the widget. <i>Do not change it if the -parent is not visible, as this will send false <tt>FL_SHOW</tt> or -<tt>FL_HIDE</tt> events to the widget</i>. <tt>redraw()</tt> is called -if necessary on this or the parent. - -<h4><a name="Fl_Widget.active">int Fl_Widget::active() const</a><br> -<a name="Fl_Widget.activate">void Fl_Widget::activate()</a><br> -<a name="Fl_Widget.deactivate">void Fl_Widget::deactivate()</a><br></h4> - -<tt>Fl_Widget::active()</tt> returns whether the widget is active. An -inactive widget does not get any events, but it does get redrawn. A -widget is active if <tt>active()</tt> is true on it <i>and all it's -parents</i>. Changing this value will send <tt>FL_ACTIVATE</tt> or -<tt>FL_DEACTIVATE</tt> to the widget. <i>Do not change it if the -parent is not active, as this will send false <tt>FL_ACTIVATE</tt> or -<tt>FL_DEACTIVATE</tt> events to the widget</i>. - -<p>Currently you cannot deactivate <tt>Fl_Window</tt> widgets. - -<h4><a name="Fl_Widget.activevisible">int Fl_Widget::activevisible() const</a></h4> - -This is the same as <tt>active() && visible()</tt> but is faster. - -<h4><a name="Fl_Widget.redraw">void Fl_Widget::redraw()</a></h4> - -Mark the widget as needing its <tt>draw()</tt> routine called. - -<h4><a name="Fl_Widget.damage">uchar Fl_Widget::damage() const</a></h4> - -Non-zero if <tt>draw()</tt> needs to be called. Actually this is a bit -field that the widget subclass can use to figure out what parts to -draw. - -<h4><a name="Fl_Widget.parent">Fl_Widget *Fl_Widget::parent() const</a></h4> - -Returns a pointer to the parent widget. Usually this is a -<a href="#Fl_Group"><tt>Fl_Group</tt></a> or -<a href="Fl_Window><tt>Fl_Window</tt></a>. Returns <tt>NULL</tt> if none. - -<h4><a name="Fl_Widget.contains">int Fl_Widget::contains(Fl_Widget* b) const</a></h4> - -Returns true if <tt>b</tt> is a child of this widget, or is equal to -this widget. Returns false if <tt>b</tt> is <tt>NULL</tt>. - -<h4><a name="Fl_Widget.inside">int Fl_Widget::inside(const Fl_Widget* a) const</a></h4> - -Returns true if this is a child of <tt>a</tt>, or is equal to <tt>a</tt>. -Returns false if <tt>a</tt> is <tt>NULL</tt>. - -<h4><a name="Fl_Widget.take_focus">int Fl_Widget::take_focus()</a></h4> - -Tries to make this widget be the <tt>Fl::focus()</tt> widget, by first -sending it an <tt>FL_FOCUS</tt> event, and if it returns non-zero, -setting <tt>Fl::focus()</tt> to this widget. You should use this -method to assign the focus to an widget. Returns true if the widget -accepted the focus. - -</body> -</html> + +----<A href=Fl_Box.html#Fl_Box>Fl_Box</A>, <A href=Fl_Browser.html#Fl_Browser>Fl_Browser</A>, <A href=Fl_Button.html#Fl_Button>Fl_Button</A>, <A href=Fl_Chart.html#Fl_Chart>Fl_Chart</A>, <A href=Fl_Clock.html#Fl_Clock>Fl_Clock</A>, + <A href=Fl_Free.html#Fl_Free>Fl_Free</A>, <A href=Fl_Group.html#Fl_Group>Fl_Group</A>, <A href=functions.html#Fl_Input>Fl_Input</A>, <A href=Fl_Menu_.html#Fl_Menu_>Fl_Menu_</A>, <A href=Fl_Positioner.html#Fl_Positioner>Fl_Positioner</A>, + <A href=Fl_Timer.html#Fl_Timer>Fl_Timer</A>, <A href=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Widget.H> +</PRE> +</UL> +<H3>Description</H3> +<TT>Fl_Widget</TT> is the base class for all widgets in FLTK. You can't +create one of these because the constructor is not public. However you +can <A href=#subclassing">subclass</A> it. +<P>All "property" accessing methods, such as <TT>color()</TT>, <TT> +parent()</TT>, or <TT>argument()</TT> are implemented as trivial inline +functions and thus are as fast and small as accessing fields in a +structure. Unless otherwise noted, the property setting methods such as <TT> +color(n)</TT> or <TT>label(s)</TT> are also trivial inline functions, +even if they change the widget's appearance. It is up to the user code +to call <TT>redraw()</TT> after these. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Widget.Fl_Widget>Fl_Widget</A></LI> +<LI><A href=#Fl_Widget.~Fl_Widget>~Fl_Widget</A></LI> +<LI><A href=#Fl_Widget.activate>activate</A></LI> +<LI><A href=#Fl_Widget.active>active</A></LI> +<LI><A href=#Fl_Widget.activevisible>activevisible</A></LI> +<LI><A href=#Fl_Widget.align>align</A></LI> +<LI><A href=#Fl_Widget.argument>argument</A></LI> +<LI><A href=#Fl_Widget.box>box</A></LI> +<LI><A href=#Fl_Widget.callback>callback</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Widget.changed>changed</A></LI> +<LI><A href=#Fl_Widget.clear_changed>clear_changed</A></LI> +<LI><A href=#Fl_Widget.color>color</A></LI> +<LI><A href=#Fl_Widget.contains>contains</A></LI> +<LI><A href=#Fl_Widget.damage>damage</A></LI> +<LI><A href=#Fl_Widget.deactivate>deactivate</A></LI> +<LI><A href=#Fl_Widget.default_callback>default_callback</A></LI> +<LI><A href=#Fl_Widget.do_callback>do_callback</A></LI> +<LI><A href=#Fl_Widget.h>h</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Widget.hide>hide</A></LI> +<LI><A href=#Fl_Widget.inside>inside</A></LI> +<LI><A href=#Fl_Widget.label>label</A></LI> +<LI><A href=#Fl_Widget.labelcolor>labelcolor</A></LI> +<LI><A href=#Fl_Widget.labelfont>labelfont</A></LI> +<LI><A href=#Fl_Widget.labelsize>labelsize</A></LI> +<LI><A href=#Fl_Widget.labeltype>labeltype</A></LI> +<LI><A href=#Fl_Widget.parent>parent</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Widget.position>position</A></LI> +<LI><A href=#Fl_Widget.redraw>redraw</A></LI> +<LI><A href=#Fl_Widget.resize>resize</A></LI> +<LI><A href=#Fl_Widget.selection_color>selection_color</A></LI> +<LI><A href=#Fl_Widget.set_changed>set_changed</A></LI> +<LI><A href=#Fl_Widget.show>show</A></LI> +<LI><A href=#Fl_Widget.size>size</A></LI> +<LI><A href=#Fl_Widget.take_focus>take_focus</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Widget.type>type</A></LI> +<LI><A href=#Fl_Widget.user_data>user_data</A></LI> +<LI><A href=#Fl_Widget.visible>visible</A></LI> +<LI><A href=#Fl_Widget.w>w</A></LI> +<LI><A href=#Fl_Widget.when>when</A></LI> +<LI><A href=#Fl_Widget.window>window</A></LI> +<LI><A href=#Fl_Widget.x>x</A></LI> +<LI><A href=#Fl_Widget.y>y</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4>Fl_Widget::Fl_Widget(int x, int y, int w, int h, const char* +label=0);</H4> + This is the protected constructor for an Fl_Widget, but all derived +widgets have a matching public constructor. It takes a value for x(), +y(), w(), h(), and an optional value for label(). +<H4>virtual Fl_Widget::~Fl_Widget();</H4> + Destroying single widgets is not very common. It is your +responsibility to either remove() them from any enclosing group, or to +destroy that group <I>immediately</I> after destroying the children. +<H4>uchar Fl_Widget::type() const;</H4> + This value is used for Forms compatability and to simulate RTTI. +<H4><A name=Fl_Widget.x>short Fl_Widget::x() const</A> +<BR><A name=Fl_Widget.y>short Fl_Widget::y() const</A> +<BR><A name=Fl_Widget.w>short Fl_Widget::w() const</A> +<BR><A name=Fl_Widget.h>short Fl_Widget::h() const</A></H4> + The position of the upper-left corner of the widget in its enclosing +Fl_Window (<I>not</I> its parent if that is not an Fl_Window), and its +width and height. +<H4><A name=Fl_Widget.resize>virtual void +Fl_Widget::resize(int,int,int,int)</A> +<BR><A name=Fl_Widget.position>void Fl_Widget::position(short x,short y)</A> +<BR><A name=Fl_Widget.size>void Fl_Widget::size(short w,short h)</A></H4> + Change the size or position of the widget. This is a virtual function +so the widget may implement it's own handling of resizing. The default +version does <I>not</I> do redraw(), that is the parent widget's +responsibility (this is because the parent may know a faster way to +update the display, such as scrolling from the old position). +<P><TT>position(x,y)</TT> is a shortcut for <TT>resize(x,y,w(),h())</TT> +, and <TT>size(w,h)</TT> is a shortcut for <TT>resize(x(),y(),w,h)</TT> +. </P> +<H4><A name=Fl_Widget.window>Fl_Window* Fl_Widget::window() const;</A></H4> + Return a pointer to the <A href=Fl_Window.html#Fl_Window><TT>Fl_Window</TT> +</A> that this widget is in (it will skip any and all parent widgets +between this and the window). Returns <TT>NULL</TT> if none. Note: +for an <TT>Fl_Window</TT>, this returns it's <I>parent</I> window (if +any), not <I>this</I> window. +<H4><A name=Fl_Widget.box>Fl_Boxtype Fl_Widget::box() const +<BR> void Fl_Widget::box(Fl_Boxtype)</A></H4> + The <TT>box()</TT> identifies a routine that draws the background of +the widget. See <A href=common.html#BoxTypes>Box Types</A> for the +available types. The default depends on the widget, but is usually <TT> +FL_NO_BOX</TT> or <TT>FL_UP_BOX</TT>. +<H4><A name=Fl_Widget.color>Fl_Color Fl_Widget::color() const +<BR> void Fl_Widget::color(Fl_Color)</A></H4> + This color is passed to the box routine. Color is an index into an +internal table of rgb colors. For most widgets this defaults to <TT> +FL_GRAY</TT>. See the <A href=enumerations.html#Enumerations> +enumeration list</A> for predefined colors. Use <A href=functions.html#set_color> +<TT>Fl::set_color()</TT></A> to redefine colors. +<H4><A name=Fl_Widget.selection_color>Fl_Color +Fl_Widget::selection_color() const +<BR> void Fl_Widget::selection_color(Fl_Color)</A> +<BR> void Fl_Widget::color(Fl_Color, Fl_Color)</H4> + For Forms compatibility a second color is defined. This is usually +used to color the widget when it is selected, although some widgets use +this color for other purposes. You can set both colors at once with <TT> +color(a,b)</TT>. +<H4><A name=Fl_Widget.label>const char* Fl_Widget::label() const +<BR> void Fl_Widget::label(const char*)</A></H4> + The label is printed somewhere on the widget or next to it. The +string is <I>not</I> copied, the passed pointer is stored unchanged in +the widget. +<H4><A name=Fl_Widget.labeltype>void Fl_Widget::label(Fl_Labeltype, +const char*) +<BR> uchar Fl_Widget::labeltype() const +<BR> void Fl_Widget::labeltype(Fl_Labeltype)</A></H4> + A <A href=#LabelTypes><TT>labeltype</TT></A> identifies a routine that +draws the label of the widget. This can be used for special effects +such as emboss, or to use the <TT>label()</TT> pointer as another form +of data such as a bitmap. The value <TT>FL_NORMAL_LABEL</TT> prints +the label as text. +<H4><A name=Fl_Widget.align>Fl_Align Fl_Widget::align() const +<BR> void Fl_Widget::align(Fl_Align)</A></H4> + How the label is printed next to or inside the widget. The default +value is <TT>FL_ALIGN_CENTER</TT>, which centers the label. The value +can be any of these constants or'd together: <TT> +<UL> +<LI>FL_ALIGN_CENTER </LI> +<LI>FL_ALIGN_TOP </LI> +<LI>FL_ALIGN_BOTTOM </LI> +<LI>FL_ALIGN_LEFT </LI> +<LI>FL_ALIGN_RIGHT </LI> +<LI>FL_ALIGN_INSIDE </LI> +<LI>FL_ALIGN_CLIP </LI> +<LI>FL_ALIGN_WRAP </LI> +</UL> +</TT> +<H4><A name=Fl_Widget.labelcolor>Fl_Color Fl_Widget::labelcolor() const +<BR> void Fl_Widget::labelcolor(Fl_Color)</A></H4> + This color is passed to the labeltype routine, and is typically the +color of the label text. This defaults to <TT>FL_BLACK</TT>. +<H4><A name=Fl_Widget.labelfont>Fl_Font Fl_Widget::labelfont() const +<BR> void Fl_Widget::labelfont(Fl_Font)</A></H4> + Fonts are identified by small 8-bit indexes into a table. See the <A href=enumerations.html#Enumerations> +enumeration list</A> for predefined typefaces. The default value uses a +Helvetica typeface (Arial for Microsoft® Windows®). The function <A href=functions.html#set_font> +<TT>Fl::set_font() </TT></A> can define new typefaces. +<H4><A name=Fl_Widget.labelsize>uchar Fl_Widget::labelsize() const +<BR> void Fl_Widget::labelsize(uchar)</A></H4> + Fonts are further identified by a point size. The default is 14. +<H4><A name=Fl_Widget.callback>typedef void (Fl_Callback)(Fl_Widget*, +void*) +<BR> Fl_Callback* Fl_Widget::callback() const +<BR> void Fl_Widget::callback(Fl_Callback*, void* = 0)</A></H4> + Each widget has a single callback. You can set it or examine it with +these methods. +<H4><A name=Fl_Widget.user_data>void* Fl_Widget::user_data() const +<BR> void Fl_Widget::user_data(void*)</A></H4> + You can also just change the <TT>void *</TT> second argument to the +callback with the <TT>user_data</TT> methods. +<H4><A name=Fl_Widget.argument>void Fl_Widget::callback(void +(*)(Fl_Widget*, long), long = 0) +<BR> long Fl_Widget::argument() const +<BR> void Fl_Widget::argument(long)</A></H4> + For convenience you can also define the callback as taking a long +argument. This is implemented by casting this to a <TT>Fl_Callback</TT> + and casting the <TT>long</TT> to a <TT>void *</TT> and may not be +portable to some machines. +<H4>void Fl_Widget::callback(void (*)(Fl_Widget*))</H4> + For convenience you can also define the callback as taking only one +argument. This is implemented by casting this to a <TT>Fl_Callback</TT> + and may not be portable to some machines. +<H4><A name=Fl_Widget.do_callback>void Fl_Widget::do_callback() +<BR> void Fl_Widget::do_callback(Fl_Widget*, void* = 0) +<BR> void Fl_Widget::do_callback(Fl_Widget*, long)</A></H4> + You can cause a widget to do its callback at any time, and even pass +arbitrary arguments. +<H4><A name=Fl_Widget.changed>int Fl_Widget::changed() const</A> +<BR><A name=Fl_Widget.set_changed>void Fl_Widget::set_changed()</A> +<BR><A name=Fl_Widget.clear_changed>void Fl_Widget::clear_changed()</A></H4> +<TT>Fl_Widget::changed()</TT> is a flag that is turned on when the user +changes the value stored in the widget. This is only used by +subclasses of <TT>Fl_Widget</TT> that store values, but is in the base +class so it is easier to scan all the widgets in a panel and <TT> +do_callback()</TT> on the changed ones in response to an "OK" button. +<P>Most widgets turn this flag off when they do the callback, and when +the program sets the stored value. </P> +<H4><A name=Fl_Widget.when>Fl_When Fl_Widget::when() const +<BR> void Fl_Widget::when(Fl_When)</A></H4> +<TT>Fl_Widget::when()</TT> is a set of bitflags used by subclasses of <TT> +Fl_Widget</TT> to decide when to do the callback. If the value is zero +then the callback is never done. Other values are described in the +individual widgets. This field is in the base class so that you can +scan a panel and <TT>do_callback()</TT> on all the ones that don't do +their own callbacks in response to an "OK" button. +<H4><A name=Fl_Widget.default_callback>static void +Fl_Widget::default_callback(Fl_Widget*, void*)</A></H4> + The default callback, which puts a pointer to the widget on the queue +returned by <A href=functions.html#readqueue><TT>Fl::readqueue()</TT></A> +. You may want to call this from your own callback. +<H4><A name=Fl_Widget.visible>int Fl_Widget::visible() const</A> +<BR><A name=Fl_Widget.show>void Fl_Widget::show()</A> +<BR><A name=Fl_Widget.hide>void Fl_Widget::hide()</A></H4> + An invisible widget never gets redrawn and does not get events. An +widget is really visible if <TT>visible()</TT> is true on it <I>and all +it's parents</I>. Changing it will send <TT>FL_SHOW</TT> or <TT>FL_HIDE</TT> + events to the widget. <I>Do not change it if the parent is not +visible, as this will send false <TT>FL_SHOW</TT> or <TT>FL_HIDE</TT> + events to the widget</I>. <TT>redraw()</TT> is called if necessary on +this or the parent. +<H4><A name=Fl_Widget.active>int Fl_Widget::active() const</A> +<BR><A name=Fl_Widget.activate>void Fl_Widget::activate()</A> +<BR><A name=Fl_Widget.deactivate>void Fl_Widget::deactivate()</A> +<BR></H4> +<TT>Fl_Widget::active()</TT> returns whether the widget is active. An +inactive widget does not get any events, but it does get redrawn. A +widget is active if <TT>active()</TT> is true on it <I>and all it's +parents</I>. Changing this value will send <TT>FL_ACTIVATE</TT> or <TT> +FL_DEACTIVATE</TT> to the widget. <I>Do not change it if the parent is +not active, as this will send false <TT>FL_ACTIVATE</TT> or <TT> +FL_DEACTIVATE</TT> events to the widget</I>. +<P>Currently you cannot deactivate <TT>Fl_Window</TT> widgets. </P> +<H4><A name=Fl_Widget.activevisible>int Fl_Widget::activevisible() const</A> +</H4> + This is the same as <TT>active() && visible()</TT> but is faster. +<H4><A name=Fl_Widget.redraw>void Fl_Widget::redraw()</A></H4> + Mark the widget as needing its <TT>draw()</TT> routine called. +<H4><A name=Fl_Widget.damage>uchar Fl_Widget::damage() const</A></H4> + Non-zero if <TT>draw()</TT> needs to be called. Actually this is a +bit field that the widget subclass can use to figure out what parts to +draw. +<H4><A name=Fl_Widget.parent>Fl_Widget *Fl_Widget::parent() const</A></H4> + Returns a pointer to the parent widget. Usually this is a <A href=Fl_Group.html#Fl_Group> +<TT>Fl_Group</TT></A> or <A Fl_Widget.contains" href="Fl_Window><tt>Fl_Window</tt></a>. Returns <tt>NULL</tt> if none. + +<h4><a name="> +int Fl_Widget::contains(Fl_Widget* b) const</A> Returns true if <TT>b</TT> + is a child of this widget, or is equal to this widget. Returns false +if <TT>b</TT> is <TT>NULL</TT>. +<H4><A name=Fl_Widget.inside>int Fl_Widget::inside(const Fl_Widget* a) +const</A></H4> + Returns true if this is a child of <TT>a</TT>, or is equal to <TT>a</TT> +. Returns false if <TT>a</TT> is <TT>NULL</TT>. +<H4><A name=Fl_Widget.take_focus>int Fl_Widget::take_focus()</A></H4> + Tries to make this widget be the <TT>Fl::focus()</TT> widget, by first +sending it an <TT>FL_FOCUS</TT> event, and if it returns non-zero, +setting <TT>Fl::focus()</TT> to this widget. You should use this +method to assign the focus to an widget. Returns true if the widget +accepted the focus. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/Fl_Window.html b/documentation/Fl_Window.html index c087e10f0..bfd8a828a 100644 --- a/documentation/Fl_Window.html +++ b/documentation/Fl_Window.html @@ -1,341 +1,257 @@ -<html> -<body> - -<hr break> - -<h2><a name="Fl_Window">class Fl_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Group">Fl_Group</a> +<HTML><BODY> +<HR break> +<H2><A name=Fl_Window>class Fl_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Group.html#Fl_Group>Fl_Group</A> | - +----<b>Fl_Window</b> + +----<B>Fl_Window</B> | - +----<a href="#Fl_Double_Window">Fl_Double_Window</a>, <a href="#Fl_Gl_Window">Fl_Gl_Window</a>, - <a href="#Fl_Overlay_Window">Fl_Overlay_Window</a>, <a href="#Fl_Single_Window">Fl_Single_Window</a> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/Fl_Window.H> -</pre></ul> - -<h3>Description</h3> - -This widget produces an actual window. This can either be a main -window, with a border and title and all the window management -controls, or a "subwindow" inside a window. This is controlled -by whether or not the window has a <tt>parent()</tt>. - -<p>Once you create a window, you usually add children -<tt>Fl_Widget</tt>'s to it by using <tt>window->add(child)</tt> for -each new widget. See <a href="#Fl_Group"><tt>Fl_Group</tt></a> for -more information on how to add and remove children. - -<p>There are several subclasses of <tt>Fl_Window</tt> that provide -double-buffering, overlay, menu, and OpenGL support. - -<p>The window's callback is done if the user tries to close a window -using the window manager and <a href="#modal"><tt>Fl::modal()</tt></a> -is zero or equal to the window. <tt>Fl_Window</tt> has a default -callback that calls <tt>Fl_Window::hide()</tt> and calls -<tt>exit(0)</tt> if this is the last top-level window. - -<h3>Methods</h3> - -<center> -<table width=90%> -<tr> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Window.Fl_Window">Fl_Window</a> - <li><a href="#Fl_Window.~Fl_Window">~Fl_Window</a> - <li><a href="#Fl_Window.border">border</a> - <li><a href="#Fl_Window.clear_border">clear_border</a> - <li><a href="#Fl_Window.current">current</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Window.first_window">first_window</a> - <li><a href="#Fl_Window.free_position">free_position</a> - <li><a href="#Fl_Window.fullscreen">fullscreen</a> - <li><a href="#Fl_Window.fullscreen_off">fullscreen_off</a> - <li><a href="#Fl_Window.hide">hide</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Window.hotspot">hotspot</a> - <li><a href="#Fl_Window.iconize">iconize</a> - <li><a href="#Fl_Window.iconlabel">iconlabel</a> - <li><a href="#Fl_Window.label">label</a> - <li><a href="#Fl_Window.make_current">make_current</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Window.modal">modal</a> - <li><a href="#Fl_Window.next_window">next_window</a> - <li><a href="#Fl_Window.non_modal">non_modal</a> - <li><a href="#Fl_Window.resize">resize</a> - <li><a href="#Fl_Window.set_modal">set_modal</a> -</ul> -</td> -<td align=left valign=top> -<ul> - <li><a href="#Fl_Window.set_non_modal">set_non_modal</a> - <li><a href="#Fl_Window.show">show</a> - <li><a href="#Fl_Window.shown">shown</a> - <li><a href="#Fl_Window.size_range">size_range</a> - <li><a href="#Fl_Window.xclass">xclass</a> -</ul> -</td> -</tr> -</table> -</center> - -<h4><a name="Fl_Window.Fl_Window">Fl_Window::Fl_Window(int x, int y, int w, int h, const char *title = 0)<br> -Fl_Window::Fl_Window(int w, int h, const char *title = 0)</a></h4> - -The first constructor takes 4 int arguments to create the window with -a preset position and size. The second constructor with 2 arguments -will create the window with a preset size, but the window manager -will choose the position according to it's own whims. - -<p><tt>Fl_Widget::box()</tt> is set to <tt>FL_FLAT_BOX</tt>. If you -plan to completely fill the window with children widgets you should -change this to <tt>FL_NO_BOX</tt>. If you turn the window border off -you may want to change this to <tt>FL_UP_BOX</tt>. - -<h4><a name="Fl_Window.~Fl_Window">virtual Fl_Window::~Fl_Window()</a></h4> - -The destructor <i>also deletes all the children</i>. This allows a -whole tree to be deleted at once, without having to keep a pointer to all -the children in the user code. A kludge has been done so the -<tt>Fl_Window</tt> and all of it's children can be automatic (local) -variables, but you must declare the <tt>Fl_Window</tt> <i>first</i>, so -that it is destroyed last. - -<h4><a name="Fl_Window.size_range">void Fl_Window::size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)</a></h4> - -Set the allowable range the user can resize this window to. This only -works for top-level windows. - -<ul> - <li><tt>minw</tt> and <tt>minh</tt> are the smallest the window - can be. - - <li><tt>maxw</tt> and <tt>maxh</tt> are the largest the window - can be. If either is <i>equal</i> to the minimum then you - cannot resize in that direction. If either is zero - then FLTK picks a maximum size in that direction such that the - window will fill the screen. - - <li><tt>dw</tt> and <tt>dh</tt> are size increments. The - window will be constrained to widths of <tt>minw + N * dw</tt>, - where <tt>N</tt> is any non-negative integer. If these are - less or equal to 1 they are ignored. - - <li><tt>aspect</tt> is a flag that indicates that the window should - preserve it's aspect ratio. This only works if both the maximum and - minimum have the same aspect ratio. -</ul> - -If this function is not called, FLTK tries to figure out the range -from the setting of <a href="#Fl_Group.resizable"><tt>resizeable()</tt></a>: - -<ul> - <li>If <tt>resizeable()</tt> is <tt>NULL</tt> (this is the - default) then the window cannot be resized and the resize - border and max-size control will not be displayed for the - window. - - <li>If either dimension of <tt>resizeable()</tt> is less than - 100, then that is considered the minimum size. Otherwise the - <tt>resizeable()</tt> has a minimum size of 100. - - <li>If either dimension of <tt>resizeable()</tt> is zero, then - that is also the maximum size (so the window cannot resize in - that direction). -</ul> - -It is undefined what happens if the current size does not fit in -the constraints passed to <tt>size_range()</tt>. - -<h4><a name="Fl_Window.show">virtual void Fl_Window::show()<br> -int Fl_Window::show(int argc, char **argv, int i)<br> -void Fl_Window::show(int argc, char **argv)</a></h4> - -Put the window on the screen. Usually this has the side effect of -opening the display. The second two forms are used for top-level -windows and allow standard arguments to be parsed from the -command-line. - -<p>If the window is already shown then it is restored and raised to the -top. This is really convenient because your program can call -<tt>show()</tt> at any time, even if the window is already up. It also -means that <tt>show()</tt> serves the purpose of <tt>raise()</tt> in -other toolkits. - -<h4><a name="Fl_Window.hide">virtual void Fl_Window::hide()</a></h4> - -Remove the window from the screen. If the window is already hidden or -has not been shown then this does nothing (and is harmless). <i>Under the -X Window System this actually destroys the xid</i>. - -<h4><a name="Fl_Window.shown">int Fl_Window::shown() const</a></h4> - -Returns non-zero if <tt>show()</tt> has been called (but not <tt>hide()</tt>). -You can tell if a window is iconified with <tt>(w->shown() && !w->visible())</tt>. - -<h4><a name="Fl_Window.iconize">void Fl_Window::iconize()</a></h4> - -Iconifies the window. If you call this when <tt>shown()</tt> is false -it will <tt>show()</tt> it as an icon. If the window is already -iconified this does nothing. - -<p>Call <tt>show()</tt> to restore the window. - -<p>When a window is iconified/restored (either by these calls or by the -user) the <tt>handle()</tt> method is called with <tt>FL_HIDE</tt> and -<tt>FL_SHOW</tt> events and <tt>visible()</tt> is turned on and off. - -<p>There is no way to control what is drawn in the icon except with the -string passed to <tt>Fl_Window::xclass()</tt>. You should not rely on -window managers displaying the icons. - -<h4><a name="Fl_Window.first_window">Fl_Window *Fl::first_window()</a></h4> - -Returns the first <tt>shown()</tt> window in the widget hierarchy. -If no windows are displayed <tt>first_window</tt> returns <tt>NULL</tt>. - -<h4><a name="Fl_Window.next_window">Fl_Window *Fl::next_window(const Fl_Window*)</a></h4> - -Returns the next <tt>shown()</tt> window in the hierarchy. You can use this -call to iterate through all the windows that are shown(). - -<h4><a name="Fl_Window.resize">void Fl_Window::resize(int,int,int,int)</a></h4> - -Change the size and position of the window. If <tt>shown()</tt> is -true, these changes are communicated to the window server (which may -refuse that size and cause a further resize). If <tt>shown()</tt> is -false, the size and position are used when <tt>show()</tt> is called. -See <a href="#Fl_Group"><tt>Fl_Group</tt></a> for the effect of -resizing on the child widgets. - -<p>You can also call the <tt>Fl_Widget</tt> methods <tt>size(x,y)</tt> -and <tt>position(w,h)</tt>, which are inline wrappers for this virtual -function. - -<h4><a name="Fl_Window.free_position">void Fl_Window::free_position()</a></h4> - -Undoes the effect of a previous <tt>resize()</tt> or <tt>show()</tt> so -that the next time <tt>show()</tt> is called the window manager is free -to position the window. - -<h4><a name="Fl_Window.hotspot">void Fl_Window::hotspot(int x, int y, int offscreen = 0)<br> -void Fl_Window::hotspot(const Fl_Widget*, int offscreen = 0)<br> -void Fl_Window::hotspot(const Fl_Widget& p, int offscreen = 0)</a></h4> - -<tt>position()</tt> the window so that the mouse is pointing at the -given position, or at the center of the given widget, which may be the -window itself. If the optional <tt>offscreen</tt> parameter is -non-zero, then the window is allowed to extend off the screen (this -does not work with some X window managers). - -<h4><a name="Fl_Window.fullscreen">void Fl_Window::fullscreen()</a></h4> - -Makes the window completely fill the screen, without any window manager -border visible. You must use <tt>fullscreen_off()</tt> to undo this. -This may not work with all window managers. - -<h4><a name="Fl_Window.fullscreen_off">int Fl_Window::fullscreen_off(int x, int y, int w, int h)</a></h4> - -Turns off any side effects of <tt>fullscreen()</tt> and does -<tt>resize(x,y,w,h)</tt>. - -<h4><a name="Fl_Window.border">int Fl_Window::border(int)<br> -uchar Fl_Window::border() const</a></h4> - -Gets or sets whether or not the window manager border is around the -window. The default value is true. <tt>border(n)</tt> can be used to -turn the border on and off, and returns non-zero if the value has been -changed. <i>Under most X window managers this does not work after -<tt>show()</tt> has been called, although SGI's 4DWM does work.</i> - -<h4><a name="Fl_Window.clear_border">void Fl_Window::clear_border()</a></h4> - -<tt>clear_border()</tt> is a fast inline function to turn the border -off. It only works before <tt>show()</tt> is called. - -<h4><a name="Fl_Window.set_modal">void Fl_Window::set_modal()</a></h4> - -A "modal" window, when <tt>shown()</tt>, will prevent any events from -being delivered to other windows in the same program, and will also -remain on top of the other windows (if the X window manager supports -the "transient for" property). Several modal windows may be shown at -once, in which case only the last one shown gets events. You can see -which window (if any) is modal by calling <a -href="#modal"><tt>Fl::modal()</tt></a>. - -<h4><a name="Fl_Window.modal">uchar Fl_Window::modal() const</a></h4> - -Returns true if this window is modal. - -<h4><a name="Fl_Window.set_non_modal">void Fl_Window::set_non_modal()</a></h4> - -A "non-modal" window (terminology borrowed from Microsoft Windows) acts -like a <tt>modal()</tt> one in that it remains on top, but it has no -effect on event delivery. There are <i>three</i> states for a window: -modal, non-modal, and normal. - -<h4><a name="Fl_Window.non_modal">uchar Fl_Window::non_modal() const</a></h4> - -Returns true if this window is modal or non-modal. - -<h4><a name="Fl_Window.label">void Fl_Window::label(const char*)<br> -const char* Fl_Window::label() const</a></h4> - -Gets or sets the window title bar label. - -<h4><a name="Fl_Window.iconlabel">void Fl_Window::iconlabel(const char*)<br> -const char* Fl_Window::iconlabel() const</a></h4> - -Gets or sets the icon label. - -<h4><a name="Fl_Window.xclass">void Fl_Window::xclass(const char*)<br> -const char* Fl_Window::xclass() const</a></h4> - -A string used to tell the system what type of window this is. -Mostly this identifies the picture to draw in the icon. <i>Under X, -this is turned into a <tt>XA_WM_CLASS</tt> pair by truncating at the -first non-alphanumeric character and capitalizing the first character, -and the second one if the first is 'x'. Thus "foo" turns into "foo, -Foo", and "xprog.1" turns into "xprog, XProg".</i> This only works if -called <i>before</i> calling <tt>show()</tt>. - -<p>This method has no effect under Microsoft Windows. - -<h4><a name="Fl_Window.make_current">void Fl_Window::make_current()</a></h4> - -<tt>make_current()</tt> sets things up so that the drawing functions in -<a href="#Drawing"><tt><FL/fl_draw.H></tt></a> will go into this -window. This is useful for incremental update of windows, such as in an -idle callback, which will make your program behave much better if it -draws a slow graphic. <b>Danger: incremental update is very hard to -debug and maintain!</b> - -<p>This method only works for the <tt>Fl_Window</tt> and <tt>Fl_Gl_Window</tt> -classes. - -<h4><a name="Fl_Window.current">static Fl_Window* Fl_Window::current()</a></h4> - -Returns the last window that was made current. - -</body> -</html> + +----<A href=Fl_Double_Window.html#Fl_Double_Window>Fl_Double_Window</A>, <A href=Fl_Gl_Window.html#Fl_Gl_Window>Fl_Gl_Window</A>, + <A href=Fl_Overlay_Window.html#Fl_Overlay_Window>Fl_Overlay_Window</A>, <A href=Fl_Single_Window.html#Fl_Single_Window>Fl_Single_Window</A> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/Fl_Window.H> +</PRE> +</UL> +<H3>Description</H3> + This widget produces an actual window. This can either be a main +window, with a border and title and all the window management controls, +or a "subwindow" inside a window. This is controlled by whether or not +the window has a <TT>parent()</TT>. +<P>Once you create a window, you usually add children <TT>Fl_Widget</TT> +'s to it by using <TT>window->add(child)</TT> for each new widget. See <A +href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> for more information +on how to add and remove children. </P> +<P>There are several subclasses of <TT>Fl_Window</TT> that provide +double-buffering, overlay, menu, and OpenGL support. </P> +<P>The window's callback is done if the user tries to close a window +using the window manager and <A href=functions.html#modal><TT> +Fl::modal()</TT></A> is zero or equal to the window. <TT>Fl_Window</TT> + has a default callback that calls <TT>Fl_Window::hide()</TT> and calls <TT> +exit(0)</TT> if this is the last top-level window. </P> +<H3>Methods</H3> +<CENTER> +<TABLE width=90%> +<TR><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Window.Fl_Window>Fl_Window</A></LI> +<LI><A href=#Fl_Window.~Fl_Window>~Fl_Window</A></LI> +<LI><A href=#Fl_Window.border>border</A></LI> +<LI><A href=#Fl_Window.clear_border>clear_border</A></LI> +<LI><A href=#Fl_Window.current>current</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Window.first_window>first_window</A></LI> +<LI><A href=#Fl_Window.free_position>free_position</A></LI> +<LI><A href=#Fl_Window.fullscreen>fullscreen</A></LI> +<LI><A href=#Fl_Window.fullscreen_off>fullscreen_off</A></LI> +<LI><A href=#Fl_Window.hide>hide</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Window.hotspot>hotspot</A></LI> +<LI><A href=#Fl_Window.iconize>iconize</A></LI> +<LI><A href=#Fl_Window.iconlabel>iconlabel</A></LI> +<LI><A href=#Fl_Window.label>label</A></LI> +<LI><A href=#Fl_Window.make_current>make_current</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Window.modal>modal</A></LI> +<LI><A href=#Fl_Window.next_window>next_window</A></LI> +<LI><A href=#Fl_Window.non_modal>non_modal</A></LI> +<LI><A href=#Fl_Window.resize>resize</A></LI> +<LI><A href=#Fl_Window.set_modal>set_modal</A></LI> +</UL> +</TD><TD align=left valign=top> +<UL> +<LI><A href=#Fl_Window.set_non_modal>set_non_modal</A></LI> +<LI><A href=#Fl_Window.show>show</A></LI> +<LI><A href=#Fl_Window.shown>shown</A></LI> +<LI><A href=#Fl_Window.size_range>size_range</A></LI> +<LI><A href=#Fl_Window.xclass>xclass</A></LI> +</UL> +</TD></TR> +</TABLE> +</CENTER> +<H4><A name=Fl_Window.Fl_Window>Fl_Window::Fl_Window(int x, int y, int +w, int h, const char *title = 0) +<BR> Fl_Window::Fl_Window(int w, int h, const char *title = 0)</A></H4> + The first constructor takes 4 int arguments to create the window with +a preset position and size. The second constructor with 2 arguments +will create the window with a preset size, but the window manager will +choose the position according to it's own whims. +<P><TT>Fl_Widget::box()</TT> is set to <TT>FL_FLAT_BOX</TT>. If you +plan to completely fill the window with children widgets you should +change this to <TT>FL_NO_BOX</TT>. If you turn the window border off +you may want to change this to <TT>FL_UP_BOX</TT>. </P> +<H4><A name=Fl_Window.~Fl_Window>virtual Fl_Window::~Fl_Window()</A></H4> + The destructor <I>also deletes all the children</I>. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code. A kludge has been done so the <TT> +Fl_Window</TT> and all of it's children can be automatic (local) +variables, but you must declare the <TT>Fl_Window</TT><I>first</I>, so +that it is destroyed last. +<H4><A name=Fl_Window.size_range>void Fl_Window::size_range(int minw, +int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)</A></H4> + Set the allowable range the user can resize this window to. This only +works for top-level windows. +<UL> +<LI><TT>minw</TT> and <TT>minh</TT> are the smallest the window can +be. </LI> +<LI><TT>maxw</TT> and <TT>maxh</TT> are the largest the window can be. + If either is <I>equal</I> to the minimum then you cannot resize in +that direction. If either is zero then FLTK picks a maximum size in +that direction such that the window will fill the screen. </LI> +<LI><TT>dw</TT> and <TT>dh</TT> are size increments. The window will +be constrained to widths of <TT>minw + N * dw</TT>, where <TT>N</TT> + is any non-negative integer. If these are less or equal to 1 they +are ignored. </LI> +<LI><TT>aspect</TT> is a flag that indicates that the window should + preserve it's aspect ratio. This only works if both the maximum and + minimum have the same aspect ratio. </LI> +</UL> + If this function is not called, FLTK tries to figure out the range +from the setting of <A href=#Fl_Group.resizable><TT>resizeable()</TT></A> +: +<UL> +<LI>If <TT>resizeable()</TT> is <TT>NULL</TT> (this is the default) +then the window cannot be resized and the resize border and max-size +control will not be displayed for the window. </LI> +<LI>If either dimension of <TT>resizeable()</TT> is less than 100, +then that is considered the minimum size. Otherwise the <TT> +resizeable()</TT> has a minimum size of 100. </LI> +<LI>If either dimension of <TT>resizeable()</TT> is zero, then that is +also the maximum size (so the window cannot resize in that direction). </LI> +</UL> + It is undefined what happens if the current size does not fit in the +constraints passed to <TT>size_range()</TT>. +<H4><A name=Fl_Window.show>virtual void Fl_Window::show() +<BR> int Fl_Window::show(int argc, char **argv, int i) +<BR> void Fl_Window::show(int argc, char **argv)</A></H4> + Put the window on the screen. Usually this has the side effect of +opening the display. The second two forms are used for top-level +windows and allow standard arguments to be parsed from the +command-line. +<P>If the window is already shown then it is restored and raised to the +top. This is really convenient because your program can call <TT>show()</TT> + at any time, even if the window is already up. It also means that <TT> +show()</TT> serves the purpose of <TT>raise()</TT> in other toolkits. </P> +<H4><A name=Fl_Window.hide>virtual void Fl_Window::hide()</A></H4> + Remove the window from the screen. If the window is already hidden or +has not been shown then this does nothing (and is harmless). <I>Under +the X Window System this actually destroys the xid</I>. +<H4><A name=Fl_Window.shown>int Fl_Window::shown() const</A></H4> + Returns non-zero if <TT>show()</TT> has been called (but not <TT>hide()</TT> +). You can tell if a window is iconified with <TT>(w->shown() +&!w->visible())</TT>. +<H4><A name=Fl_Window.iconize>void Fl_Window::iconize()</A></H4> + Iconifies the window. If you call this when <TT>shown()</TT> is false +it will <TT>show()</TT> it as an icon. If the window is already +iconified this does nothing. +<P>Call <TT>show()</TT> to restore the window. </P> +<P>When a window is iconified/restored (either by these calls or by the +user) the <TT>handle()</TT> method is called with <TT>FL_HIDE</TT> and <TT> +FL_SHOW</TT> events and <TT>visible()</TT> is turned on and off. </P> +<P>There is no way to control what is drawn in the icon except with the +string passed to <TT>Fl_Window::xclass()</TT>. You should not rely on +window managers displaying the icons. </P> +<H4><A name=Fl_Window.first_window>Fl_Window *Fl::first_window()</A></H4> + Returns the first <TT>shown()</TT> window in the widget hierarchy. If +no windows are displayed <TT>first_window</TT> returns <TT>NULL</TT>. +<H4><A name=Fl_Window.next_window>Fl_Window *Fl::next_window(const +Fl_Window*)</A></H4> + Returns the next <TT>shown()</TT> window in the hierarchy. You can +use this call to iterate through all the windows that are shown(). +<H4><A name=Fl_Window.resize>void Fl_Window::resize(int,int,int,int)</A></H4> + Change the size and position of the window. If <TT>shown()</TT> is +true, these changes are communicated to the window server (which may +refuse that size and cause a further resize). If <TT>shown()</TT> is +false, the size and position are used when <TT>show()</TT> is called. +See <A href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> for the effect +of resizing on the child widgets. +<P>You can also call the <TT>Fl_Widget</TT> methods <TT>size(x,y)</TT> + and <TT>position(w,h)</TT>, which are inline wrappers for this virtual +function. </P> +<H4><A name=Fl_Window.free_position>void Fl_Window::free_position()</A></H4> + Undoes the effect of a previous <TT>resize()</TT> or <TT>show()</TT> + so that the next time <TT>show()</TT> is called the window manager is +free to position the window. +<H4><A name=Fl_Window.hotspot>void Fl_Window::hotspot(int x, int y, int +offscreen = 0) +<BR> void Fl_Window::hotspot(const Fl_Widget*, int offscreen = 0) +<BR> void Fl_Window::hotspot(const Fl_Widgetp, int offscreen = 0)</A></H4> +<TT>position()</TT> the window so that the mouse is pointing at the +given position, or at the center of the given widget, which may be the +window itself. If the optional <TT>offscreen</TT> parameter is +non-zero, then the window is allowed to extend off the screen (this +does not work with some X window managers). +<H4><A name=Fl_Window.fullscreen>void Fl_Window::fullscreen()</A></H4> + Makes the window completely fill the screen, without any window +manager border visible. You must use <TT>fullscreen_off()</TT> to undo +this. This may not work with all window managers. +<H4><A name=Fl_Window.fullscreen_off>int Fl_Window::fullscreen_off(int +x, int y, int w, int h)</A></H4> + Turns off any side effects of <TT>fullscreen()</TT> and does <TT> +resize(x,y,w,h)</TT>. +<H4><A name=Fl_Window.border>int Fl_Window::border(int) +<BR> uchar Fl_Window::border() const</A></H4> + Gets or sets whether or not the window manager border is around the +window. The default value is true. <TT>border(n)</TT> can be used to +turn the border on and off, and returns non-zero if the value has been +changed. <I>Under most X window managers this does not work after <TT> +show()</TT> has been called, although SGI's 4DWM does work.</I> +<H4><A name=Fl_Window.clear_border>void Fl_Window::clear_border()</A></H4> +<TT>clear_border()</TT> is a fast inline function to turn the border +off. It only works before <TT>show()</TT> is called. +<H4><A name=Fl_Window.set_modal>void Fl_Window::set_modal()</A></H4> + A "modal" window, when <TT>shown()</TT>, will prevent any events from +being delivered to other windows in the same program, and will also +remain on top of the other windows (if the X window manager supports +the "transient for" property). Several modal windows may be shown at +once, in which case only the last one shown gets events. You can see +which window (if any) is modal by calling <A href=functions.html#modal><TT> +Fl::modal()</TT></A>. +<H4><A name=Fl_Window.modal>uchar Fl_Window::modal() const</A></H4> + Returns true if this window is modal. +<H4><A name=Fl_Window.set_non_modal>void Fl_Window::set_non_modal()</A></H4> + A "non-modal" window (terminology borrowed from Microsoft Windows) +acts like a <TT>modal()</TT> one in that it remains on top, but it has +no effect on event delivery. There are <I>three</I> states for a +window: modal, non-modal, and normal. +<H4><A name=Fl_Window.non_modal>uchar Fl_Window::non_modal() const</A></H4> + Returns true if this window is modal or non-modal. +<H4><A name=Fl_Window.label>void Fl_Window::label(const char*) +<BR> const char* Fl_Window::label() const</A></H4> + Gets or sets the window title bar label. +<H4><A name=Fl_Window.iconlabel>void Fl_Window::iconlabel(const char*) +<BR> const char* Fl_Window::iconlabel() const</A></H4> + Gets or sets the icon label. +<H4><A name=Fl_Window.xclass>void Fl_Window::xclass(const char*) +<BR> const char* Fl_Window::xclass() const</A></H4> + A string used to tell the system what type of window this is. Mostly +this identifies the picture to draw in the icon. <I>Under X, this is +turned into a <TT>XA_WM_CLASS</TT> pair by truncating at the first +non-alphanumeric character and capitalizing the first character, and +the second one if the first is 'x'. Thus "foo" turns into "foo, Foo", +and "xprog.1" turns into "xprog, XProg".</I> This only works if called <I> +before</I> calling <TT>show()</TT>. +<P>This method has no effect under Microsoft Windows. </P> +<H4><A name=Fl_Window.make_current>void Fl_Window::make_current()</A></H4> +<TT>make_current()</TT> sets things up so that the drawing functions in <A +href=drawing.html#Drawing><TT><FL/fl_draw.H></TT></A> will go into this +window. This is useful for incremental update of windows, such as in an +idle callback, which will make your program behave much better if it +draws a slow graphic. <B>Danger: incremental update is very hard to +debug and maintain!</B> +<P>This method only works for the <TT>Fl_Window</TT> and <TT> +Fl_Gl_Window</TT> classes. </P> +<H4><A name=Fl_Window.current>static Fl_Window* Fl_Window::current()</A></H4> + Returns the last window that was made current. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/basics.html b/documentation/basics.html index 57bec8472..563179b59 100644 --- a/documentation/basics.html +++ b/documentation/basics.html @@ -1,210 +1,170 @@ -<HTML> -<BODY> - +<HTML><BODY> <H1 ALIGN=RIGHT><A NAME=basics>2 - FLTK Basics</A></H1> - -This chapter will teach you the basics of compiling programs that use -FLTK. - + This chapter will teach you the basics of compiling programs that use +FLTK. <H2>Naming</H2> - -All public symbols in FLTK start with the characters 'F' and 'L': - -<ul> - - <li>Functions are either <tt>Fl::foo()</tt> or <tt>fl_foo()</tt>. - - <li>Class and type names are capitalized: <tt>Fl_Foo</tt>. - - <li><a href=#Enumerations>Constants and enumerations</a> are - uppercase: <tt>FL_FOO</tt>. - - <li>All header files start with <tt><FL/...></tt>. - -</ul> - + All public symbols in FLTK start with the characters 'F' and 'L': +<UL> +<LI>Functions are either <TT>Fl::foo()</TT> or <TT>fl_foo()</TT>. </LI> +<LI>Class and type names are capitalized: <TT>Fl_Foo</TT>. </LI> +<LI><A href=enumerations.html#Enumerations>Constants and enumerations</A> + are uppercase: <TT>FL_FOO</TT>. </LI> +<LI>All header files start with <TT><FL/...></TT>. </LI> +</UL> <H2>Header Files</H2> - -The proper way to include FLTK header files is: - -<ul><pre> -#include <FL/Fl_xyz.H> -</pre></ul> - -<b>Microsoft Windows developers please note:</b> case *is* significant -under other operating systems, and the C standard uses the forward -slash (/) to separate directories. The following <tt>#include</tt> -directives are *not* recommended for portability reasons: - -<ul><pre> -#include <fl\fl_xyz.h> -#include <fl/fl_xyz.h> -#include <FL\Fl_xyz.H> -</pre></ul> - + The proper way to include FLTK header files is: +<UL> +<PRE> +#include <FL/Fl_xyz.H> +</PRE> +</UL> +<B>Microsoft Windows developers please note:</B> case *is* significant +under other operating systems, and the C standard uses the forward +slash (/) to separate directories. The following <TT>#include</TT> + directives are *not* recommended for portability reasons: +<UL> +<PRE> +#include <fl\fl_xyz.h> +#include <fl/fl_xyz.h> +#include <FL\Fl_xyz.H> +</PRE> +</UL> <H2>Compiling Programs with Standard Compilers</H2> - -Under UNIX (and under Microsoft Windows when using the GNU development tools) -you will probably need to tell the compiler where to find the header files. -This is usually done using the <tt>-I</tt> option: - -<ul><pre> + Under UNIX (and under Microsoft Windows when using the GNU development +tools) you will probably need to tell the compiler where to find the +header files. This is usually done using the <TT>-I</TT> option: +<UL> +<PRE> CC -I/usr/local/include ... gcc -I/usr/local/include ... -</pre></ul> - -Similarly, when linking your application you will need to tell the compiler -to use the FLTK library: - -<ul><pre> +</PRE> +</UL> + Similarly, when linking your application you will need to tell the +compiler to use the FLTK library: +<UL> +<PRE> CC ... -L/usr/local/lib -lfltk -lXext -lX11 -lm gcc ... -L/usr/local/lib -lfltk -lXext -lX11 -lm -</pre></ul> - +</PRE> +</UL> <H2>Compiling Programs with Microsoft Visual C++</H2> - -In Visual C++ you will need to tell the compiler where to find the FLTK -header files. This can be done by selecting "Settings" from the -"Project" menu and then changing the "Preprocessor" settings under the -"C/C++" tab. Similarly, you will need to add the FLTK library to the -"Link" settings. - -<p>You can build your Microsoft Windows applications as Console or -WIN32 applications. If you want to use the standard C <tt>main()</tt> -function as the entry point, FLTK includes a <tt>WinMain()</tt> function -that will call your <tt>main()</tt> function for you. - -<p><i>Note: The Visual C++ optimizer is known to cause problems with -many programs. We only recommend using the "Favor Small Code" -optimization setting.</i> - + In Visual C++ you will need to tell the compiler where to find the +FLTK header files. This can be done by selecting "Settings" from the +"Project" menu and then changing the "Preprocessor" settings under the +"C/C++" tab. Similarly, you will need to add the FLTK library to the +"Link" settings. +<P>You can build your Microsoft Windows applications as Console or +WIN32 applications. If you want to use the standard C <TT>main()</TT> + function as the entry point, FLTK includes a <TT>WinMain()</TT> + function that will call your <TT>main()</TT> function for you. </P> +<P><I>Note: The Visual C++ optimizer is known to cause problems with +many programs. We only recommend using the "Favor Small Code" +optimization setting.</I></P> <H2>Writing Your First FLTK Program</H2> - -All programs must include the file <tt><FL/Fl.H></tt>. In -addition the program must include a header file for each FLTK class it -uses. Listing 1 shows a simple "Hello, World!" program that uses -FLTK to display the window. - -<ul> -<i>Listing 1 - "hello.cxx"</i> -<br> -<pre> -#include <FL/Fl.H> -#include <FL/Fl_Window.H> -#include <FL/Fl_Box.H> + All programs must include the file <TT><FL/Fl.H In addition the +program must include a header file for each FLTK class it uses. + Listing 1 shows a simple "Hello, World!" program that uses FLTK to +display the window. +<UL><I>Listing 1 - "hello.cxx"</I> +<BR> +<PRE> +#include <FL/Fl.H> +#include <FL/Fl_Window.H> +#include <FL/Fl_Box.H> int main(int argc, char **argv) { Fl_Window *window = new Fl_Window(300,180); - Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!"); - box->labelsize(36); - box->labelfont(FL_BOLD+FL_ITALIC); - box->labeltype(FL_SHADOW_LABEL); - window->end(); - window->show(argc, argv); + Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!"); + box->labelsize(36); + box->labelfont(FL_BOLD+FL_ITALIC); + box->labeltype(FL_SHADOW_LABEL); + window->end(); + window->show(argc, argv); return Fl::run(); } -</pre></ul> - -After including the required header files, the program then creates a -window: - -<ul><pre> -Fl_Window *window = new <a href="#Fl_Window">Fl_Window</a>(300,180); -</pre></ul> - -and a box with the "Hello, World!" string in it: - -<ul><pre> -Fl_Box *box = new <a href="#Fl_Box">Fl_Box</a>(FL_UP_BOX,20,40,260,100,"Hello, World!"); -</pre></ul> - -Next, we set the size, font, and style of the label: - -<ul><pre> -box-><a href="#Fl_Widget.labelsize">labelsize</a>(36); -box-><a href="#Fl_Widget.labelfont">labelfont</a>(FL_BOLD+FL_ITALIC); -box-><a href="#Fl_Widget.labeltype">labeltype</a>(FL_SHADOW_LABEL); -</pre></ul> - -Finally, we show the window and enter the FLTK event loop: - -<ul><pre> -window-><a href="#Fl_Group.end">end</a>(); -window-><a href="#Fl_Window.show">show</a>(argc, argv); -return <a href="#run">Fl::run</a>(); -</pre></ul> - -The resulting program will display the window below. You can quit -the program by closing the window or pressing the ESCape key. - -<center><img src=hello.C.gif></center> - +</PRE> +</UL> + After including the required header files, the program then creates a +window: +<UL> +<PRE> +Fl_Window *window = new <A href=Fl_Window.html#Fl_Window>Fl_Window</A>(300,180); +</PRE> +</UL> + and a box with the "Hello, World!" string in it: +<UL> +<PRE> +Fl_Box *box = new <A href=Fl_Box.html#Fl_Box>Fl_Box</A>(FL_UP_BOX,20,40,260,100,"Hello, World!"); +</PRE> +</UL> + Next, we set the size, font, and style of the label: +<UL> +<PRE> +box-><A href=Fl_Widget.html#Fl_Widget.labelsize>labelsize</A>(36); +box-><A href=Fl_Widget.html#Fl_Widget.labelfont>labelfont</A>(FL_BOLD+FL_ITALIC); +box-><A href=Fl_Widget.html#Fl_Widget.labeltype>labeltype</A>(FL_SHADOW_LABEL); +</PRE> +</UL> + Finally, we show the window and enter the FLTK event loop: +<UL> +<PRE> +window-><A href=Fl_Group.html#Fl_Group.end>end</A>(); +window-><A href=Fl_Window.html#Fl_Window.show>show</A>(argc, argv); +return <A href=functions.html#run>Fl::run</A>(); +</PRE> +</UL> + The resulting program will display the window below. You can quit the +program by closing the window or pressing the ESCape key. +<CENTER><IMG src=./hello.C.gif></CENTER> <H3>Creating the Widgets</H3> - -The widgets are created using the C++ <tt>new</tt> operator; the arguments -to the constructors are usually one of the following: - -<ul><pre> + The widgets are created using the C++ <TT>new</TT> operator; the +arguments to the constructors are usually one of the following: +<UL> +<PRE> Fl_Widget(boxtype, x, y, width, height) Fl_Widget(x, y, width, height) Fl_Widget(width, height) -</pre></ul> - -The <tt>boxtype</tt> value is the style of the box that is drawn around -the widget. Usually this is <tt>FL_NO_BOX</tt>, which means that no -box is drawn. In our "Hello, World!" example we use <tt>FL_UP_BOX</tt>, -which means that a raised button border will be drawn around the -widget. You can learn more about boxtypes in <a href="#boytypes">Chapter -3</a>. - -<p>The <tt>x</tt> and <tt>y</tt> parameters determine where the widget -or window is placed on the screen. In FLTK the top left corner of the -window or screen is the origin (i.e. x = 0, y = 0) and the units are in -pixels. - -<p>The <tt>width</tt> and <tt>height</tt> parameters determine the size -of the widget or window in pixels. The maximum widget size is typically -governed by the underlying window system or hardware. - +</PRE> +</UL> + The <TT>boxtype</TT> value is the style of the box that is drawn +around the widget. Usually this is <TT>FL_NO_BOX</TT>, which means +that no box is drawn. In our "Hello, World!" example we use <TT> +FL_UP_BOX</TT>, which means that a raised button border will be drawn +around the widget. You can learn more about boxtypes in <A href=#boytypes> +Chapter 3</A>. +<P>The <TT>x</TT> and <TT>y</TT> parameters determine where the widget +or window is placed on the screen. In FLTK the top left corner of the +window or screen is the origin (i.e. x = 0, y = 0) and the units are in +pixels. </P> +<P>The <TT>width</TT> and <TT>height</TT> parameters determine the size +of the widget or window in pixels. The maximum widget size is +typically governed by the underlying window system or hardware. </P> <H3>Labels</H3> - -All widgets support labels. In the case of window widgets, the label -is used for the label in the title bar. Our example program calls the -<a href="#Fl_Widget.labelfont"><tt>labelfont</tt></a>, -<a href="#Fl_Widget.labelsize"><tt>labelsize</tt></a>, and -<a href="#Fl_Widget.labeltype"><tt>labeltype</tt></a> methods. - -<p>The <tt>labelfont</tt> method sets the typeface and style that is -used for the label, which for this example we are using -<tt>FL_BOLD</tt> and <tt>FL_ITALIC</tt>. You can also specify typefaces -directly. - -<p>The <tt>labelsize</tt> method sets the height of the font in pixels. - -<p>The <tt>labeltype</tt> method sets the type of label. FLTK supports -normal, embossed, shadowed, symbol, and image labels. - -<p>A complete list of all label options can be found in <a href="#labels"> -Chapter 3</a>. - + All widgets support labels. In the case of window widgets, the label +is used for the label in the title bar. Our example program calls the <A href=Fl_Widget.html#Fl_Widget.labelfont> +<TT>labelfont</TT></A>, <A href=Fl_Widget.html#Fl_Widget.labelsize><TT> +labelsize</TT></A>, and <A href=Fl_Widget.html#Fl_Widget.labeltype><TT> +labeltype</TT></A> methods. +<P>The <TT>labelfont</TT> method sets the typeface and style that is +used for the label, which for this example we are using <TT>FL_BOLD</TT> + and <TT>FL_ITALIC</TT>. You can also specify typefaces directly. </P> +<P>The <TT>labelsize</TT> method sets the height of the font in pixels. </P> +<P>The <TT>labeltype</TT> method sets the type of label. FLTK supports +normal, embossed, shadowed, symbol, and image labels. </P> +<P>A complete list of all label options can be found in <A href=common.html#labels> +Chapter 3</A>. </P> <H3>Showing the Window</H3> - -The <tt>show()</tt> method shows the widget or window. For windows you can -also provide the command-line arguments to allow users to customize the -appearance, size, and position of your windows. - + The <TT>show()</TT> method shows the widget or window. For windows +you can also provide the command-line arguments to allow users to +customize the appearance, size, and position of your windows. <H3>The Main Event Loop</H3> - -FLTK provides the <a href="#run"><tt>Fl:run()</tt></a> method to enter -a standard event processing loop. This is equivalent to the following -code: - -<ul><pre> + FLTK provides the <A href=functions.html#run><TT>Fl:run()</TT></A> + method to enter a standard event processing loop. This is equivalent +to the following code: +<UL> +<PRE> while (Fl::wait()); -</pre></ul> - -<tt>Fl::run()</tt> does not return until all of the windows under FLTK control -are closed (either by the user or your program). - -</BODY> -</HTML> +</PRE> +</UL> +<TT>Fl::run()</TT> does not return until all of the windows under FLTK +control are closed (either by the user or your program). </TT></BODY></HTML>
\ No newline at end of file diff --git a/documentation/common.html b/documentation/common.html index 18911c86b..4a85c4fe2 100644 --- a/documentation/common.html +++ b/documentation/common.html @@ -1,389 +1,338 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="common">3 - Common Widgets and Attributes</A></H1> - -This chapter describes many of the widgets that are provided with FLTK and covers how -to query and set the standard attributes. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=common>3 - Common Widgets and Attributes</A></H1> + This chapter describes many of the widgets that are provided with FLTK +and covers how to query and set the standard attributes. <H2>Buttons</H2> - -FLTK provides many types of buttons: - -<ul> - <li><tt>Fl_Button</tt> - A standard push button. - <li><tt>Fl_Check_Button</tt> - A button with a check box. - <li><tt>Fl_Light_Button</tt> - A push button with a light. - <li><tt>Fl_Repeat_Button</tt> - A push button that repeats when held. - <li><tt>Fl_Return_Button</tt> - A push button that is activated by the Enter key. - <li><tt>Fl_Round_Button</tt> - A button with a check circle. -</ul> - -For all of these buttons you just need to include the corresponding -<tt><FL/Fl_xyz_Button.H></tt> header file. The constructor takes the -bounding box of the button and optionally a label string: - -<ul><pre> -Fl_Button *button = new Fl_Button(x, y, width, height, "label"); + FLTK provides many types of buttons: +<UL> +<LI><TT>Fl_Button</TT> - A standard push button. </LI> +<LI><TT>Fl_Check_Button</TT> - A button with a check box. </LI> +<LI><TT>Fl_Light_Button</TT> - A push button with a light. </LI> +<LI><TT>Fl_Repeat_Button</TT> - A push button that repeats when held. </LI> +<LI><TT>Fl_Return_Button</TT> - A push button that is activated by the +Enter key. </LI> +<LI><TT>Fl_Round_Button</TT> - A button with a check circle. </LI> +</UL> + For all of these buttons you just need to include the corresponding <TT> +<FL/Fl_xyz_Button.H></TT> header file. The constructor takes the +bounding box of the button and optionally a label string: +<UL> +<PRE> +Fl_Button *button = new Fl_Button(x, y, width, height, "label"); Fl_Light_Button *lbutton = new Fl_Light_Button(x, y, width, height); -Fl_Round_Button *rbutton = new Fl_Round_Button(x, y, width, height, "label"); -</pre></ul> - -Each button has an associated <a href="#Fl_Button.type"><tt>type()</tt></a> -which allows it to behave as a push button, toggle button, or radio button: - -<ul><pre> -button->type(0); -lbutton->type(FL_TOGGLE_BUTTON); -rbutton->type(FL_RADIO_BUTTON); -</pre></ul> - -For toggle and radio buttons, the <a href="#Fl_Button.value"><tt>value()</tt></a> -method returns the current button state (0 = off, 1 = on). The -<a href="#Fl_Widget.set"><tt>set()</tt></a> and -<a href="#Fl_Widget.clear"><tt>clear()</tt></a> methods can be used on toggle -buttons to turn a toggle button on or off, respectively. Radio buttons can -be turned on with the <a href="#Fl_Widget.setonly"><tt>setonly()</tt></a> -method; this will also turn off other radio buttons in the current group. - +Fl_Round_Button *rbutton = new Fl_Round_Button(x, y, width, height, "label"); +</PRE> +</UL> + Each button has an associated <A href=Fl_Button.html#Fl_Button.type><TT> +type()</TT></A> which allows it to behave as a push button, toggle +button, or radio button: +<UL> +<PRE> +button->type(0); +lbutton->type(FL_TOGGLE_BUTTON); +rbutton->type(FL_RADIO_BUTTON); +</PRE> +</UL> + For toggle and radio buttons, the <A href=Fl_Button.html#Fl_Button.value> +<TT>value()</TT></A> method returns the current button state (0 = off, +1 = on). The <A href=#Fl_Widget.set><TT>set()</TT></A> and <A href=#Fl_Widget.clear> +<TT>clear()</TT></A> methods can be used on toggle buttons to turn a +toggle button on or off, respectively. Radio buttons can be turned on +with the <A href=#Fl_Widget.setonly><TT>setonly()</TT></A> method; this +will also turn off other radio buttons in the current group. <H2>Text</H2> - -FLTK provides several text widgets for displaying and receiving text: - -<ul> - <li><tt>Fl_Input</tt> - A standard one-line text input field. - <li><tt>Fl_Output</tt> - A standard one-line text output field. - <li><tt>Fl_Multiline_Input</tt> - A standard multi-line text input field. - <li><tt>Fl_Multiline_Output</tt> - A standard multi-line text output field. -</ul> - -The <tt>Fl_Output</tt> and <tt>Fl_Multiline_Output</tt> widgets allow the -user to copy text from the output field but not change it. - -<p>The <a href="#Fl_Input.value"><tt>value()</tt></a> method is used to get or -set the string that is displayed: - -<ul><pre> -Fl_Input *input = new Fl_Input(x, y, width, height, "label"); -input->value("Now is the time for all good men..."); -</pre></ul> - + FLTK provides several text widgets for displaying and receiving text: +<UL> +<LI><TT>Fl_Input</TT> - A standard one-line text input field. </LI> +<LI><TT>Fl_Output</TT> - A standard one-line text output field. </LI> +<LI><TT>Fl_Multiline_Input</TT> - A standard multi-line text input +field. </LI> +<LI><TT>Fl_Multiline_Output</TT> - A standard multi-line text output +field. </LI> +</UL> + The <TT>Fl_Output</TT> and <TT>Fl_Multiline_Output</TT> widgets allow +the user to copy text from the output field but not change it. +<P>The <A href=Fl_Input.html#Fl_Input.value><TT>value()</TT></A> method +is used to get or set the string that is displayed: </P> +<UL> +<PRE> +Fl_Input *input = new Fl_Input(x, y, width, height, "label"); +input->value("Now is the time for all good men..."); +</PRE> +</UL> <H2>Valuators</H2> - -Unlike text widgets, valuators keep track of numbers instead of strings. -FLTK provides the following valuators: - -<ul> - <li><tt>Fl_Counter</tt> - A widget with arrow buttons that shows the - current value. - <li><tt>Fl_Dial</tt> - A round knob. - <li><tt>Fl_Roller</tt> - An SGI-like dolly widget. - <li><tt>Fl_Scrollbar</tt> - A standard scrollbar widget. - <li><tt>Fl_Slider</tt> - A scrollbar with a knob. - <li><tt>Fl_Value_Slider</tt> - A slider that shows the current value. -</ul> - -The <a href="#Fl_Valuator.value"><tt>value()</tt></a> method gets and sets the -current value of the widget. The <a href="#Fl_Valuator.minimum"> -<tt>minimum()</tt></a> and <a href="#Fl_Valuator.maximum"><tt>maximum</tt></a> -methods set the range of values that are reported by the widget. - + Unlike text widgets, valuators keep track of numbers instead of +strings. FLTK provides the following valuators: +<UL> +<LI><TT>Fl_Counter</TT> - A widget with arrow buttons that shows the + current value. </LI> +<LI><TT>Fl_Dial</TT> - A round knob. </LI> +<LI><TT>Fl_Roller</TT> - An SGI-like dolly widget. </LI> +<LI><TT>Fl_Scrollbar</TT> - A standard scrollbar widget. </LI> +<LI><TT>Fl_Slider</TT> - A scrollbar with a knob. </LI> +<LI><TT>Fl_Value_Slider</TT> - A slider that shows the current value. </LI> +</UL> + The <A href=Fl_Valuator.html#Fl_Valuator.value><TT>value()</TT></A> + method gets and sets the current value of the widget. The <A href=Fl_Valuator.html#Fl_Valuator.minimum> +<TT>minimum()</TT></A> and <A href=Fl_Valuator.html#Fl_Valuator.maximum><TT> +maximum</TT></A> methods set the range of values that are reported by +the widget. <H2>Groups</H2> - -The <tt>Fl_Group</tt> widget class is used as a general purpose "container" -widget. Besides grouping radio buttons, the groups are used to encapsulate -windows, tabs, and scrolled windows. The following group classes are available -with FLTK: - -<ul> - <li><tt>Fl_Double_Window</tt> - A double-buffered window on the screen. - <li><tt>Fl_Gl_Window</tt> - An OpenGL window on the screen. - <li><tt>Fl_Group</tt> - The base container class; can be used to group any widgets together. - <li><tt>Fl_Scroll</tt> - A scrolled window area. - <li><tt>Fl_Tabs</tt> - Displays child widgets as tabs. - <li><tt>Fl_Window</tt> - A window on the screen. -</ul> - + The <TT>Fl_Group</TT> widget class is used as a general purpose +"container" widget. Besides grouping radio buttons, the groups are +used to encapsulate windows, tabs, and scrolled windows. The following +group classes are available with FLTK: +<UL> +<LI><TT>Fl_Double_Window</TT> - A double-buffered window on the screen. </LI> +<LI><TT>Fl_Gl_Window</TT> - An OpenGL window on the screen. </LI> +<LI><TT>Fl_Group</TT> - The base container class; can be used to group +any widgets together. </LI> +<LI><TT>Fl_Scroll</TT> - A scrolled window area. </LI> +<LI><TT>Fl_Tabs</TT> - Displays child widgets as tabs. </LI> +<LI><TT>Fl_Window</TT> - A window on the screen. </LI> +</UL> <H2>Setting the Size and Position of Widgets</H2> - -The size and position of widgets is usually set when you create them. You -can change this at any time using the <tt>position</tt>, <tt>resize()</tt>, -and <tt>size</tt> methods: - -<ul><pre> -button->position(x, y); -group->resize(x, y, width, height); -window->size(width, height); -</pre></ul> - -Changing the size or position of a widget will cause a redraw of that widget -and its children. - -<H2><A NAME="colors">Colors</A></H2> - -FLTK manages a virtual color palette of "standard" colors. The -standard colors are: - -<ul> - <li><tt>FL_BLACK</tt> - <li><tt>FL_RED</tt> - <li><tt>FL_GREEN</tt> - <li><tt>FL_YELLOW</tt> - <li><tt>FL_BLUE</tt> - <li><tt>FL_MAGENTA</tt> - <li><tt>FL_CYAN</tt> - <li><tt>FL_WHITE</tt> - <li><tt>FL_GRAY</tt> -</ul> - -The widget color can be set using the <tt>color()</tt> method: - -<ul><pre> -button->color(FL_RED); -</pre></ul> - -Similarly, the label color can be set using the <tt>labelcolor()</tt> method: - -<ul><pre> -button->labelcolor(FL_WHITE); -</pre></ul> - -<H2><A NAME="boxtypes">Box Types</A></H2> - -<p>The type <tt>Fl_Boxtype</tt> stored and returned in <a href="#Fl_Widget.box"> -<tt>Fl_Widget::box()</tt></a> is an enumeration defined in -<a href="#enumerations"><tt><FL/Enumerations.H></tt></a>: - -<center><img src=boxtypes.gif width=80%></center> - -<tt>FL_NO_BOX</tt> means nothing is drawn at all, so whatever is -already on the screen remains. The <tt>FL_..._FRAME</tt> types only -draw their edges, leaving the center unchanged. In the above diagram -the blue color is the area that is not drawn by the box. - + The size and position of widgets is usually set when you create them. + You can change this at any time using the <TT>position</TT>, <TT> +resize()</TT>, and <TT>size</TT> methods: +<UL> +<PRE> +button->position(x, y); +group->resize(x, y, width, height); +window->size(width, height); +</PRE> +</UL> + Changing the size or position of a widget will cause a redraw of that +widget and its children. +<H2><A NAME=colors>Colors</A></H2> + FLTK manages a virtual color palette of "standard" colors. The +standard colors are: +<UL> +<LI><TT>FL_BLACK</TT></LI> +<LI><TT>FL_RED</TT></LI> +<LI><TT>FL_GREEN</TT></LI> +<LI><TT>FL_YELLOW</TT></LI> +<LI><TT>FL_BLUE</TT></LI> +<LI><TT>FL_MAGENTA</TT></LI> +<LI><TT>FL_CYAN</TT></LI> +<LI><TT>FL_WHITE</TT></LI> +<LI><TT>FL_GRAY</TT></LI> +</UL> + The widget color can be set using the <TT>color()</TT> method: +<UL> +<PRE> +button->color(FL_RED); +</PRE> +</UL> + Similarly, the label color can be set using the <TT>labelcolor()</TT> + method: +<UL> +<PRE> +button->labelcolor(FL_WHITE); +</PRE> +</UL> +<H2><A NAME=boxtypes>Box Types</A></H2> +<P>The type <TT>Fl_Boxtype</TT> stored and returned in <A href=Fl_Widget.html#Fl_Widget.box> +<TT>Fl_Widget::box()</TT></A> is an enumeration defined in <A href=enumerations.html#enumerations> +<TT>s.H></TT></A>: +<CENTER><IMG src=./boxtypes.gif width=80%></CENTER> +<TT>FL_NO_BOX</TT> means nothing is drawn at all, so whatever is +already on the screen remains. The <TT>FL_..._FRAME</TT> types only +draw their edges, leaving the center unchanged. In the above diagram +the blue color is the area that is not drawn by the box. </P> <H3>Making your own Boxtypes</H3> - -You can define your own boxtypes by making a small function that -draws the box and adding a pointer to it to a table of boxtypes. - + You can define your own boxtypes by making a small function that draws +the box and adding a pointer to it to a table of boxtypes. <H4>The Drawing Function</H4> - -The drawing function is passed the bounding box and background -color for the widget: - -<ul><pre> + The drawing function is passed the bounding box and background color +for the widget: +<UL> +<PRE> void xyz_draw(int x, int y, int w, int h, Fl_Color c) { ... } -</pre></ul> - -A simple drawing function might fill a rectangle with the given -color and then draw a black outline: - -<ul><pre> +</PRE> +</UL> + A simple drawing function might fill a rectangle with the given color +and then draw a black outline: +<UL> +<PRE> void xyz_draw(int x, int y, int w, int h, Fl_Color c) { fl_color(c); fl_rectf(x, y, w, h); fl_color(FL_BLACK); fl_rect(x, y, w, h); } -</pre></ul> - +</PRE> +</UL> <H4>Adding Your Box Type</H4> - -The <tt>Fl::set_boxtype()</tt> method adds or replaces the -specified box type: - -<ul><pre> + The <TT>Fl::set_boxtype()</TT> method adds or replaces the specified +box type: +<UL> +<PRE> #define XYZ_BOX FL_FREE_BOXTYPE Fl::set_boxtype(XYZ_BOX, xyz_draw, 1, 1, 2, 2); -</pre></ul> - -The last 4 arguments to <tt>Fl::set_boxtype()</tt> are the offsets -for the bounding box that should be subtracted when drawing the label -inside the box. - -<H2><A NAME="labels">Labels and Label Types</A></H2> - -The <tt>label()</tt>, <tt>align</tt>, <tt>labelfont()</tt>, <tt>labelsize()</tt>, -and <tt>labeltype()</tt> methods control the labeling of widgets. - +</PRE> +</UL> + The last 4 arguments to <TT>Fl::set_boxtype()</TT> are the offsets for +the bounding box that should be subtracted when drawing the label +inside the box. +<H2><A NAME=labels>Labels and Label Types</A></H2> + The <TT>label()</TT>, <TT>align</TT>, <TT>labelfont()</TT>, <TT> +labelsize()</TT>, and <TT>labeltype()</TT> methods control the labeling +of widgets. <H3>label()</H3> - -The <tt>label()</tt> method sets the string that is displayed for the label. -For the <tt>FL_SYMBOL_LABEL</tt> and image label types the string contains -the actual symbol or image data. - + The <TT>label()</TT> method sets the string that is displayed for the +label. For the <TT>FL_SYMBOL_LABEL</TT> and image label types the +string contains the actual symbol or image data. <H3>align()</H3> - -The <tt>align()</tt> method positions the label. The following constants are -defined: - -<ul> - <li><tt>FL_ALIGN_CENTER</tt> - center the label in the widget. - <li><tt>FL_ALIGN_TOP</tt> - align the label at the top of the widget. - <li><tt>FL_ALIGN_BOTTOM</tt> - align the label at the bottom of the widget. - <li><tt>FL_ALIGN_LEFT</tt> - align the label to the left of the widget. - <li><tt>FL_ALIGN_RIGHT</tt> - align the label to the right of the widget. - <li><tt>FL_ALIGN_INSIDE</tt> - align the label inside the widget. - <li><tt>FL_ALIGN_CLIP</tt> - clip the label to the widget's bounding box. - <li><tt>FL_ALIGN_WRAP</tt> - wrap the label text as needed. -</ul> - + The <TT>align()</TT> method positions the label. The following +constants are defined: +<UL> +<LI><TT>FL_ALIGN_CENTER</TT> - center the label in the widget. </LI> +<LI><TT>FL_ALIGN_TOP</TT> - align the label at the top of the widget. </LI> +<LI><TT>FL_ALIGN_BOTTOM</TT> - align the label at the bottom of the +widget. </LI> +<LI><TT>FL_ALIGN_LEFT</TT> - align the label to the left of the widget. </LI> +<LI><TT>FL_ALIGN_RIGHT</TT> - align the label to the right of the +widget. </LI> +<LI><TT>FL_ALIGN_INSIDE</TT> - align the label inside the widget. </LI> +<LI><TT>FL_ALIGN_CLIP</TT> - clip the label to the widget's bounding +box. </LI> +<LI><TT>FL_ALIGN_WRAP</TT> - wrap the label text as needed. </LI> +</UL> <H3>labeltype()</H3> - -The <tt>labeltype()</tt> method sets the type of the label. The following -standard label types are included: - -<ul> - <li><tt>FL_NORMAL_LABEL</tt> - draws the text. - <li><tt>FL_NO_LABEL</tt> - does nothing - <li><tt>FL_SYMBOL_LABEL</tt> - draws "@xyz" labels, see "<a href=#symbols>Symbol Labels</a>" - <li><tt>FL_SHADOW_LABEL</tt> - draws a drop shadow under the text - <li><tt>FL_ENGRAVED_LABEL</tt> - draws edges as though the text is engraved - <li><tt>FL_EMBOSSED_LABEL</tt> - draws edges as thought the text is raised -</ul> - -To make bitmaps or pixmaps you use a method on the -<a href="#Fl_Bitmap"><tt>Fl_Bitmap</tt></a> or -<a href="#Fl_Pixmap"><tt>Fl_Pixmap</tt></a> objects. - + The <TT>labeltype()</TT> method sets the type of the label. The +following standard label types are included: +<UL> +<LI><TT>FL_NORMAL_LABEL</TT> - draws the text. </LI> +<LI><TT>FL_NO_LABEL</TT> - does nothing </LI> +<LI><TT>FL_SYMBOL_LABEL</TT> - draws "@xyz" labels, see "<A href=#symbols> +Symbol Labels</A>" </LI> +<LI><TT>FL_SHADOW_LABEL</TT> - draws a drop shadow under the text </LI> +<LI><TT>FL_ENGRAVED_LABEL</TT> - draws edges as though the text is +engraved </LI> +<LI><TT>FL_EMBOSSED_LABEL</TT> - draws edges as thought the text is +raised </LI> +</UL> + To make bitmaps or pixmaps you use a method on the <A href=drawing.html#Fl_Bitmap> +<TT>Fl_Bitmap</TT></A> or <A href=drawing.html#Fl_Pixmap><TT>Fl_Pixmap</TT> +</A> objects. <H4>Making Your Own Label Types</H4> - -Label types are actually indexes into a table of functions to draw -them. The primary purpose of this is to let you reuse the -<tt>label()</tt> pointer as a pointer to arbitrary data such as a -bitmap or pixmap. You can also use this to draw the labels in ways -inaccessible through the <tt>fl_font</tt> mechanisim (e.g. -<tt>FL_ENGRAVED_LABEL</tt>) or with program-generated letters or -symbology. - + Label types are actually indexes into a table of functions to draw +them. The primary purpose of this is to let you reuse the <TT>label()</TT> + pointer as a pointer to arbitrary data such as a bitmap or pixmap. You +can also use this to draw the labels in ways inaccessible through the <TT> +fl_font</TT> mechanisim (e.g. <TT>FL_ENGRAVED_LABEL</TT>) or with +program-generated letters or symbology. <H5>Label Type Functions</H5> - -To setup your own label type you will need to write two functions -to draw and measure the label. The draw function is called with a -pointer to a <a href="#Fl_Label"><tt>Fl_Label</tt></a> structure -containing the label information, the bounding box for the label, -and the label alignment: - -<ul><pre> + To setup your own label type you will need to write two functions to +draw and measure the label. The draw function is called with a pointer +to a <A href=#Fl_Label><TT>Fl_Label</TT></A> structure containing the +label information, the bounding box for the label, and the label +alignment: +<UL> +<PRE> void xyz_draw(Fl_Label *label, int x, int y, int w, int h, Fl_Align align) { ... } -</pre></ul> - -The label should be drawn <i>inside</i> this bounding box, even if -<tt>FL_ALIGN_INSIDE</tt> is not enabled. The function is not called if -the label value is <tt>NULL</tt>. - -<p>The measure function is called with a pointer to a <a href="#Fl_Label"><tt>Fl_Label</tt></a> structure -and references to the width and height: - -<ul><pre> -void xyz_measure(Fl_Label *label, int &w, int &h) { +</PRE> +</UL> + The label should be drawn <I>inside</I> this bounding box, even if <TT> +FL_ALIGN_INSIDE</TT> is not enabled. The function is not called if the +label value is <TT>NULL</TT>. +<P>The measure function is called with a pointer to a <A href=#Fl_Label><TT> +Fl_Label</TT></A> structure and references to the width and height: </P> +<UL> +<PRE> +void xyz_measure(Fl_Label *label, int w int h { ... } -</pre></ul> - -It should measure the size of the label and set <tt>w</tt> and <tt>h</tt> to -the size it will occupy. - +</PRE> +</UL> + It should measure the size of the label and set <TT>w</TT> and <TT>h</TT> + to the size it will occupy. <H5>Adding Your Label Type</H5> - -The <tt>Fl::set_labeltype</tt> method creates a label type using your -draw and measure functions: - -<ul><pre> + The <TT>Fl::set_labeltype</TT> method creates a label type using your +draw and measure functions: +<UL> +<PRE> #define XYZ_LABEL FL_FREE_LABELTYPE Fl::set_labeltype(XYZ_LABEL, xyz_draw, xyz_measure); -</pre></ul> - -The label type number <tt>n</tt> can be any integer value starting at -the constant <tt>FL_FREE_LABELTYPE</tt>. Once you have added the label -type you can use the <tt>labeltype()</tt> method to select your label -type. - -<p>The <tt>Fl::set_labeltype</tt> method can also be used to overload an -existing label type such as <tt>FL_NORMAL_LABEL</tt>. - -<H4><a name="symbols">Symbol Labels</H4> - -<p>The <tt>FL_SYMBOL_LABEL</tt> label type uses the <tt>label()</tt> -string to look up a small drawing procedure in a hash table. For -historical reasons the string always starts with '@', if it starts with -something else (or the symbol is not found) the label is drawn -normally: - -<center><img src=symbols.gif></center> - -The @ sign may be followed by the following optional "formatting" -characters, in this order: - -<ul> - <li>'#' forces square scaling, rather than distortion to the - widget's shape. - - <li>+[1-9] or -[1-9] tweaks the scaling a little bigger or - smaller. - - <li>[1-9] - rotates by a multiple of 45 degrees. '6' does - nothing, the others point in the direction of that key on a - numeric keypad. -</ul> - +</PRE> +</UL> + The label type number <TT>n</TT> can be any integer value starting at +the constant <TT>FL_FREE_LABELTYPE</TT>. Once you have added the label +type you can use the <TT>labeltype()</TT> method to select your label +type. +<P>The <TT>Fl::set_labeltype</TT> method can also be used to overload +an existing label type such as <TT>FL_NORMAL_LABEL</TT>. </P> +<H4><A name=symbols>Symbol Labels</A></H4> +<P>The <TT>FL_SYMBOL_LABEL</TT> label type uses the <TT>label()</TT> + string to look up a small drawing procedure in a hash table. For +historical reasons the string always starts with '@', if it starts with +something else (or the symbol is not found) the label is drawn +normally: +<CENTER><IMG src=./symbols.gif></CENTER> + The @ sign may be followed by the following optional "formatting" +characters, in this order: </P> +<UL> +<LI>'#' forces square scaling, rather than distortion to the widget's +shape. </LI> +<LI>+[1-9] or -[1-9] tweaks the scaling a little bigger or smaller. </LI> +<LI>[1-9] - rotates by a multiple of 45 degrees. '6' does nothing, +the others point in the direction of that key on a numeric keypad. </LI> +</UL> <H2>Callbacks</H2> - -Callbacks are functions that are called when the value of a widget changes. -A callback function is sent a <tt>Fl_Widget</tt> pointer of the widget that -changed and optionally a pointer to data of some sort: - -<ul><pre> + Callbacks are functions that are called when the value of a widget +changes. A callback function is sent a <TT>Fl_Widget</TT> pointer of +the widget that changed and optionally a pointer to data of some sort: +<UL> +<PRE> void xyz_callback(Fl_Widget *w, void *data) { ... } -</pre></ul> - -The <tt>callback()</tt> method sets the callback function for a widget. You -can optionally pass a pointer to some data needed for the callback: - -<ul><pre> +</PRE> +</UL> + The <TT>callback()</TT> method sets the callback function for a +widget. You can optionally pass a pointer to some data needed for the +callback: +<UL> +<PRE> int xyz_data; -button->callback(xyz_callback, &xyz_data); -</pre></ul> - -Normally callbacks are performed only when the value of the widget -changes. You can change this using the -<a href="#Fl_Widget.when"><tt>when()</tt></a> method: - -<ul><pre> -button->when(FL_WHEN_NEVER); -button->when(FL_WHEN_CHANGED); -button->when(FL_WHEN_RELEASE); -button->when(FL_WHEN_RELEASE_ALWAYS); -button->when(FL_WHEN_ENTER_KEY); -button->when(FL_WHEN_ENTER_KEY_ALWAYS); -button->when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED); -</pre></ul> - +button->callback(xyz_callback, data); +</PRE> +</UL> + Normally callbacks are performed only when the value of the widget +changes. You can change this using the <A href=Fl_Widget.html#Fl_Widget.when> +<TT>when()</TT></A> method: +<UL> +<PRE> +button->when(FL_WHEN_NEVER); +button->when(FL_WHEN_CHANGED); +button->when(FL_WHEN_RELEASE); +button->when(FL_WHEN_RELEASE_ALWAYS); +button->when(FL_WHEN_ENTER_KEY); +button->when(FL_WHEN_ENTER_KEY_ALWAYS); +button->when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED); +</PRE> +</UL> <H2>Shortcuts</H2> - -Shortcuts are key sequences that activate widgets (usually buttons or menu -items). The <tt>shortcut()</tt> method registers a shortcut for a widget: - -<ul><pre> -button->shortcut(FL_Enter); -button->shortcut(FL_SHIFT + 'b'); -button->shortcut(FL_CTRL + 'b'); -button->shortcut(FL_ALT + 'b'); -button->shortcut(FL_CTRL + FL_ALT + 'b'); -</pre></ul> - -The shortcut value is the key event value (the ASCII value or one of -the special keys like <tt>FL_Enter</tt>) combined with any modifiers -(like shift, alt, and control). - -</BODY> -</HTML> + Shortcuts are key sequences that activate widgets (usually buttons or +menu items). The <TT>shortcut()</TT> method registers a shortcut for a +widget: +<UL> +<PRE> +button->shortcut(FL_Enter); +button->shortcut(FL_SHIFT + 'b'); +button->shortcut(FL_CTRL + 'b'); +button->shortcut(FL_ALT + 'b'); +button->shortcut(FL_CTRL + FL_ALT + 'b'); +</PRE> +</UL> + The shortcut value is the key event value (the ASCII value or one of +the special keys like <TT>FL_Enter</TT>) combined with any modifiers +(like shift, alt, and control). </BODY></HTML>
\ No newline at end of file diff --git a/documentation/drawing.html b/documentation/drawing.html index 9219273eb..df1e395fb 100644 --- a/documentation/drawing.html +++ b/documentation/drawing.html @@ -1,681 +1,507 @@ -<HTML> -<BODY> - +<HTML><BODY> <H1><A NAME=drawing>5 - Drawing Things in FLTK</A></H1> - -This chapter covers the drawing functions that are provided with FLTK. - -<h2>When Can You Draw Things in FLTK?</h2> - -There are only certain places you can execute drawing code in FLTK. -Calling these functions at other places will result in undefined -behavior! - -<ul> - - <li>The most common is inside the virtual method <a - href="#draw"><tt>Fl_Widget::draw()</tt></a>. To write code - here, you must subclass one of the existing <tt>Fl_Widget</tt> - classes and implement your own version of <tt>draw()</tt>. - - <li>You can also write <a href="#boxtypes">boxtypes</a> and <a - href="#labeltypes">labeltypes</a>. These are small procedures - that can be called by existing <tt>Fl_Widget</tt> - <tt>draw()</tt> methods. These "types" are identified by an - 8-bit index that is stored in the widget's <tt>box()</tt>, - <tt>labeltype()</tt>, and possibly other properties. - - <li>You can call <a - href="#Fl_Window.make_current"><tt>Fl_Window::make_current()</tt></a> - to do incremental update of a widget. Use <a - href="#Fl_Widget.window"><tt>Fl_Widget::window()</tt></a> to - find the window. <i>Under X this only works for the base - <tt>Fl_Window</tt> class, not for double buffered, overlay, or - OpenGL windows!</i> - -</ul> - -<h2>FLTK Drawing Functions</h2> - -To use the drawing functions you must first include the -<tt><FL/fl_draw.H></tt> header file. FLTK provides the following types -of drawing functions: - -<ul> - <li><a href="#clipping">Clipping</a> - <li><a href="#color">Colors</a> - <li><a href="#fast">Fast Shapes</a> - <li><a href="#vertex">Complex Shapes</a> - <li><a href="#text">Text</a> - <li><a href="#images">Images</a> - <li><a href="#cursor">Cursor</a> - <li><a href="#overlay">Overlay</a> -</ul> - -<h3><a name="clipping">Clipping</a></h3> - -You can limit all your drawing to a rectangular region by calling -<tt>fl_clip</tt>, and put the drawings back by using -<tt>fl_pop_clip</tt>. This rectangle is measured in pixels (it is -unaffected by the current transformation matrix). - -<p>In addition, the system may provide clipping when updating windows, -this clip region may be more complex than a simple rectangle. - -<h4>void fl_clip(int x, int y, int w, int h)</h4> - -Intersect the current clip region with a rectangle and push this new -region onto the stack. - -<h4>void fl_pop_clip()</h4> - -Restore the previous clip region. <i>You must call -<tt>fl_pop_clip()</tt> once for every time you call -<tt>fl_clip()</tt>. If you return to FLTK with the clip stack not -empty unpredictable results occur.</i> - -<h4>int fl_not_clipped(int x, int y, int w, int h)</h4> - -Returns true if any of the rectangle intersects the current clip -region. If this returns false you don't have to draw the object. -<i>Under X this returns 2 if the rectangle is partially clipped, and 1 -if it is entirely inside the clip region</i>. - -<h4>int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)</h4> - -Intersect the rectangle <tt>x,y,w,h</tt> with the current clip region -and returns the bounding box of the result in <tt>X,Y,W,H</tt>. -Returns non-zero if the resulting rectangle is different than the -original. This can be used to limit the necessary drawing to a -rectangle. <tt>W</tt> and <tt>H</tt> are set to zero if the rectangle -is completely outside the region. - -<h3><a name="colors">Colors</a></h3> - -<h4>void fl_color(Fl_Color)</h4> - -Set the color for all subsequent drawing operations. <tt>Fl_Color</tt> -is an enumeration type, and all values are in the range 0-255. This is -<i>not</i> the X or WIN32 pixel, it is an index into an internal -table! The table provides several general colors, a 24-entry gray -ramp, and a 5x8x5 color cube. All of these are named with -poorly-documented symbols in <a -href=#enumerations><tt><FL/Enumerations.H></tt></a>. - -<p>For colormapped displays, a color cell will be allocated out of -<tt>fl_colormap</tt> the first time you use a color. If the colormap -fills up then a least-squares algorithm is used to find the closest -color. - -<h4>Fl_Color fl_color()</h4> - -Returns the last <tt>fl_color()</tt> that was set. This can be used for state -save/restore. - -<h4>void fl_color(uchar r, uchar g, uchar b)</h4> - -Set the color for all subsequent drawing operations. The closest -possible match to the RGB color is used. The RGB color is used -directly on TrueColor displays. For colormap visuals the nearest index -in the gray ramp or color cube is used. - -<h3><a name="fast_shapes">Fast Shapes</a></h3> - -These are used to draw almost all the FLTK widgets. They draw on exact -pixel boundaries and are as fast as possible, and their behavior will -be duplicated exactly on any platform FLTK is ported to. It is -undefined whether these are affected by the <a -href="#complex_shapes">transformation matrix</a>, so you should only call these -while it is the identity. - -<h4>void fl_rectf(int x, int y, int w, int h)</h4> - -Color a rectangle that exactly fills the given bounding box. - -<h4>void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b)</h4> - -Color a rectangle with "exactly" the passed <tt>r,g,b</tt> color. On -screens with less than 24 bits of color this is done by drawing a -solid-colored block using <a -href="#fl_draw_image"><tt>fl_draw_image()</tt></a> so that dithering is -produced. - -<h4>void fl_rect(int x, int y, int w, int h)</h4> - -Draw a 1-pixel border <i>inside</i> this bounding box. - -<h4>void fl_line(int x, int y, int x1, int y1)<br> -void fl_line(int x, int y, int x1, int y1, int x2, int y2)</h4> - -Draw one or two 1-pixel thick lines between the given points. - -<h4>void fl_loop(int x, int y, int x1, int y1, int x2, int y2)<br> -void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)</h4> - -Outline a 3 or 4-sided polygon with 1-pixel thick lines. - -<h4>void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)<br> -void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)</h4> - -Fill a 3 or 4-sided polygon. The polygon must be convex. - -<h4>void fl_xyline(int x, int y, int x1, int y1)<br> -void fl_xyline(int x, int y, int x1, int y1, int x2)<br> -void fl_xyline(int x, int y, int x1, int y1, int x2, int y3)</h4> - -Draw 1-pixel wide horizontal and vertical lines. A horizontal line is -drawn first, then a vertical, then a horizontal. - -<h4>void fl_yxline(int x, int y, int y1)<br> -void fl_yxline(int x, int y, int y1, int x2)<br> -void fl_yxline(int x, int y, int y1, int x2, int y3)</h4> - -Draw 1-pixel wide vertical and horizontal lines. A vertical line is -drawn first, then a horizontal, then a vertical. - -<h4>void fl_arc(int x, int y, int w, int h, double a1, double a2)<br> -void fl_pie(int x, int y, int w, int h, double a1, double a2)<br> -void fl_chord(int x, int y, int w, int h, double a1, double a2)</h4> - -High-speed ellipse sections. These functions match the rather limited -circle drawing code provided by X and MSWindows. The advantage over -using <a href="#fl_arc"><tt>fl_arc</tt></a> is that they are faster -because they often use the hardware, and they draw much nicer small -circles, since the small sizes are often hard-coded bitmaps. - -<p>If a complete circle is drawn it will fit inside the passed -bounding box. The two angles are measured in degrees counterclockwise -from 3'oclock and are the starting and ending angle of the arc, <tt>a2</tt> -must be greater or equal to <tt>a1</tt>. - -<p><tt>fl_arc()</tt> draws a 1-pixel thick line (notice this has a different -number of arguments than the <a href="#fl_arc"><tt>fl_arc()</tt></a> described -below. - -<p><tt>fl_pie()</tt> draws a filled-in pie slice. This slice may extend outside -the line drawn by <tt>fl_arc</tt>, to avoid this use <tt>w - 1</tt> and -<tt>h - 1</tt>. - -<p><tt>fl_chord()</tt> is not yet implemented. - -<h3><a name="complex_shapes">Complex Shapes</a></h3> - -These functions let you draw arbitrary shapes with 2-D linear -transformations. The functionality matches that found in Adobe® -PostScript<sup>TM</sup>. The exact pixels filled in is less defined -than for the above calls, so that FLTK can take advantage of drawing -hardware. The transformed vertices are rounded to integers before -drawing the line segments. This severely limits the accuracy of these -functions for complex graphics. Use OpenGL when greater accuracy -and/or performance is required. - -<h4>void fl_push_matrix()<br> -void fl_pop_matrix()</h4> - -Save and restore the current transformation. The maximum depth of the -stack is 4. - -<h4>void fl_scale(float x, float y)<br> -void fl_scale(float x)<br> -void fl_translate(float x, float y)<br> -void fl_rotate(float d)<br> -void fl_mult_matrix(float a, float b, float c, float d, float x, float y)</h4> - -Concatenate another transformation onto the current one. The rotation angle -is in degrees (not radians) and is counter-clockwise. - -<h4>void fl_begin_line()<br> -void fl_end_line()</h4> - -Start and end drawing 1-pixel thick lines. - -<h4>void fl_begin_loop()<br> -void fl_end_loop()</h4> - -Start and end drawing a closed sequence of 1-pixel thick lines. - -<h4>void fl_begin_polygon()<br> -void fl_end_polygon()</h4> - -Start and end drawing a convex filled polygon. - -<h4>void fl_begin_complex_polygon()<br> -void fl_gap()<br> -void fl_end_complex_polygon()</h4> - -Start and end drawing a complex filled polygon. This polygon may be -concave, may have holes in it, or may be several disconnected pieces. -Call <tt>fl_gap()</tt> to seperate loops of the path (it is unnecessary -but harmless to call <tt>fl_gap()</tt> before the first vertex, after -the last one, or several times in a row). For portability, you should -only draw polygons that appear the same whether "even/odd" or -"non-zero" winding rules are used to fill them. This mostly means that -holes should be drawn in the opposite direction of the outside. - -<p><tt>fl_gap()</tt> should only be called between -<tt>fl_begin_complex_polygon()</tt> and -<tt>fl_end_complex_polygon()</tt>. To outline the polygon, use -<tt>fl_begin_loop()</tt> and replace each <tt>fl_gap()</tt> with -<tt>fl_end_loop();fl_begin_loop()<tt>. - -<h4>void fl_vertex(float x, float y)</h4> - -Add a single vertex to the current path. - -<h4>void fl_curve(float x, float y, float x1, float y1, float x2, float y2, float x3, float y3)</h4> - -Add a series of points on a Bezier curve to the path. The curve ends -(and two of the points) are at <tt>x,y</tt> and <tt>x3,y3</tt>. - -<h4>void fl_arc(float x, float y, float r, float start, float end)</h4> - -Add a series of points to the current path on the arc of a circle (you -can get elliptical paths by using scale and rotate before calling -this). <tt>x,y</tt> are the center of the circle, and <tt>r</tt> is -its radius. <tt>fl_arc()</tt> takes <tt>start</tt> and <tt>end</tt> -angles that are measured in degrees counter-clockwise from 3 o'clock. -If <tt>end</tt> is less than <tt>start</tt> then it draws the arc in a -clockwise direction. - -<h4>void fl_circle(float x, float y, float r)</h4> - -<tt>fl_circle()</tt> is equivalent to <tt>fl_arc(...,0,360)</tt> but -may be faster. It must be the <i>only</i> thing in the path: if you -want a circle as part of a complex polygon you must use -<tt>fl_arc()</tt>. <i>This draws incorrectly if the transformation is -both rotated and non-square scaled.</i> - -<h3><a name="text">Text</a></h3> - -All text is drawn in the <a href="#fl_font">current font</a>. It is -undefined whether this location or the characters are modified by the -current transformation. - -<h4>void fl_draw(const char *, float x, float y)<br> -void fl_draw(const char *, int n, float x, float y)</h4> - -Draw a nul-terminated string or an array of <tt>n</tt> characters -starting at the given location. - -<h4>void fl_draw(const char *, int x, int y, int w, int h, Fl_Align)</h4> - -Fancy string drawing function which is used to draw all the labels. -The string is formatted and aligned inside the passed box. Handles -'\t' and '\n', expands all other control characters to ^X, and aligns -inside or against the edges of the box. See <a -href="#Fl_Widget.align"><tt>Fl_Widget::align()</tt></a> for values for -<tt>align</tt>. The value <tt>FL_ALIGN_INSIDE</tt> is ignored, as this -function always prints inside the box. - -<h4>void fl_measure(const char *, int &w, int &h)</h4> - -Measure how wide and tall the string will be when printed by the -<tt>fl_draw(...align)</tt> function. If the incoming <tt>w</tt> is -non-zero it will wrap to that width. - -<h4>int fl_height()</h4> - -Recommended minimum line spacing for the current font. You can also -just use the value of <tt>size</tt> passed to <a href="#fl_font"> -<tt>fl_font()</tt></a>. - -<h4>int fl_descent()</h4> - -Recommended distance above the bottom of a <tt>fl_height()</tt> tall -box to draw the text at so it looks centered vertically in that box. - -<h4>float fl_width(const char*)<br> -float fl_width(const char*, int n)<br> -float fl_width(uchar)</h4> - -Return the width of a nul-terminated string, a sequence of <tt>n</tt> -characters, or a single character. - -<h4>const char *fl_shortcut_label(ulong)</h4> - -Unparse a shortcut value as used by <a -href="#Fl_Button.shortcut"><tt>Fl_Button</tt></a> or <a -href="#Fl_Menu_Item"><tt>Fl_Menu_Item</tt></a> into a human-readable -string like "Alt+N". This only works if the shortcut is a character -key or a numbered function key. If the shortcut is zero an empty -string is returned. The return value points at a static buffer that is -overwritten with each call. - -<h3><a name="fonts">Fonts</a></h3> - -<h4><a name="fl_font">void fl_font(int face, int size)</a></h4> - -Set the current font, which is then used by the routines described -above. You may call this outside a draw context if necessary to call -<tt>fl_width()</tt>, but on X this will open the display. - -<p>The font is identified by a <tt>face</tt> and a <tt>size</tt>. The -size of the font is measured in <tt>pixels</tt> (i.e. it is not -"resolution [in]dependent"). Lines should be spaced <tt>size</tt> -pixels apart (or more). - -<p>The <tt>face</tt> is an index into an internal table. Initially -only the first 16 faces are filled in. There are symbolic names for -them: <tt>FL_HELVETICA</tt>, <tt>FL_TIMES</tt>, <tt>FL_COURIER</tt>, -and modifier values <tt>FL_BOLD</tt> and <tt>FL_ITALIC</tt> which can -be added to these, and <tt>FL_SYMBOL</tt> and -<tt>FL_ZAPF_DINGBATS</tt>. Faces greater than 255 cannot be used in -<tt>Fl_Widget</tt> labels, since it stores the index as a byte. - -<h4>int fl_font()<br> -int fl_size()</h4> - -Returns the face and size set by the most recent call to -<tt>fl_font(a,b)</tt>. This can be used to save/restore the font. - -<h3><a name="cursor">Cursor</a></h3> - -<h4>void fl_cursor(Fl_Cursor, Fl_Color = FL_WHITE, Fl_Color = FL_BLACK)</h4> - -Change the cursor. Depending on the system this may affect the cursor -everywhere, or only when it is pointing at the window that is current -when you call this. For portability you should change the cursor back -to the default in response to <tt>FL_LEAVE</tt> events. - -<p>The type <tt>Fl_Cursor</tt> is an enumeration defined in <a -href="#enumerations"><tt><Enumerations.H></tt></a>. The -double-headed arrows are bitmaps provided by FLTK on X, the others are -provided by system-defined cursors. Under X you can get any XC_cursor -value by passing <tt>Fl_Cursor((XC_foo/2)+1)</tt>. - -<p>The following standard cursors are available: - -<ul> - <li><tt>FL_CURSOR_DEFAULT</tt> - the default cursor, usually an arrow - <li><tt>FL_CURSOR_ARROW</tt> - an arrow pointer - <li><tt>FL_CURSOR_CROSS</tt> - crosshair - <li><tt>FL_CURSOR_WAIT</tt> - watch or hourglass - <li><tt>FL_CURSOR_INSERT</tt> - I-beam - <li><tt>FL_CURSOR_HAND</tt> - hand (uparrow on MSWindows) - <li><tt>FL_CURSOR_HELP</tt> - question mark - <li><tt>FL_CURSOR_MOVE</tt> - 4-pointed arrow - <li><tt>FL_CURSOR_NS</tt> - up/down arrow - <li><tt>FL_CURSOR_WE</tt> - left/right arrow - <li><tt>FL_CURSOR_NWSE</tt> - diagonal arrow - <li><tt>FL_CURSOR_NESW</tt> - diagonal arrow - <li><tt>FL_CURSOR_NONE</tt> - invisible -</ul> - -<h3><a name="overlay">Overlays</a></h3> - -<h4>void fl_overlay_rect(int x, int y, int w, int h)<br> -void fl_overlay_clear()</h4> - -These functions allow you to draw interactive selection rectangles -without using the overlay hardware. FLTK will XOR a single rectangle -outline over a window. Calling this will erase any previous rectangle -(by XOR'ing it), and then draw the new one. Calling -<tt>fl_overlay_clear()</tt> will erase the rectangle without drawing a -new one. - -<p>Using this is tricky. You should make a widget with both a -<tt>handle()</tt> and <tt>draw()</tt> method. <tt>draw()</tt> should -call <tt>fl_overlay_clear()</tt> before doing anything else. Your -<tt>handle()</tt> method should call <tt>window()->make_current()</tt> -and then <tt>fl_overlay_rect()</tt> after <tt>FL_DRAG</tt> events, and -should call <tt>fl_overlay_clear()</tt> after a <tt>FL_RELEASE</tt> -event. - -<h2><a name="images">Images</a></h2> - -To draw images, you can either do it directly from data in your memory, -or you can create <a href="#Fl_Bitmap"><tt>Fl_Bitmap</tt></a>, <a -href="#Fl_Image"><tt>Fl_Image</tt></a>, or <a -href="#Fl_Pixmap"><tt>Fl_Pixmap</tt></a> objects. The advantage of -drawing directly is that it is more intuitive, and it is faster if the -image data changes more often than it is redrawn. The advantage of -using the object is that FLTK will cache translated forms of the image -(on X it uses a server pixmap) and thus redrawing is <i>much</i> -faster. - -<h3>Direct Image Drawing</h3> - -It is undefined whether the location or drawing of the image is -affected by the current transformation, so you should only call these -when it is the identity. - -<h4>void fl_draw_bitmap(const uchar *, int X, int Y, int W, int H, int LD = 0)</h4> - -This function is planned but not yet implemented (it may be impossible -under X without allocating a pixmap). - -<h4>void fl_draw_image(const uchar *, int X, int Y, int W, int H, int D = 3, int LD = 0)<br> -void fl_draw_image_mono(const uchar *, int X, int Y, int W, int H, int D = 1, int LD = 0)</h4> - -Draw an 8-bit per color RGB or luminance image. The pointer points at -the "r" data of the top-left pixel. Data must be in <tt>r,g,b</tt> -order. <tt>X,Y</tt> are where to put the top-left corner. <tt>W</tt> -and <tt>H</tt> define the size of the image. <tt>D</tt> is the delta -to add to the pointer between pixels, it may be any value greater or -equal to <tt>3</tt>, or it can be negative to flip the image -horizontally. <tt>LD</tt> is the delta to add to the pointer between -lines (if 0 is passed it uses <tt>W * D</tt>), and may be larger than -<tt>W * D</tt> to crop data, or negative to flip the image vertically. - -<p>It is highly recommended that you put the following code before the -first <tt>show()</tt> of <i>any</i> window in your program to get rid -of the dithering if possible: - -<ul><pre> + This chapter covers the drawing functions that are provided with FLTK. +<H2>When Can You Draw Things in FLTK?</H2> + There are only certain places you can execute drawing code in FLTK. +Calling these functions at other places will result in undefined +behavior! +<UL> +<LI>The most common is inside the virtual method <A href=#draw><TT> +Fl_Widget::draw()</TT></A>. To write code here, you must subclass one +of the existing <TT>Fl_Widget</TT> classes and implement your own +version of <TT>draw()</TT>. </LI> +<LI>You can also write <A href=common.html#boxtypes>boxtypes</A> and <A href=#labeltypes> +labeltypes</A>. These are small procedures that can be called by +existing <TT>Fl_Widget</TT><TT>draw()</TT> methods. These "types" are +identified by an 8-bit index that is stored in the widget's <TT>box()</TT> +, <TT>labeltype()</TT>, and possibly other properties. </LI> +<LI>You can call <A href=Fl_Window.html#Fl_Window.make_current><TT> +Fl_Window::make_current()</TT></A> to do incremental update of a +widget. Use <A href=Fl_Widget.html#Fl_Widget.window><TT> +Fl_Widget::window()</TT></A> to find the window. <I>Under X this only +works for the base <TT>Fl_Window</TT> class, not for double buffered, +overlay, or OpenGL windows!</I></LI> +</UL> +<H2>FLTK Drawing Functions</H2> + To use the drawing functions you must first include the <TT> +<FL/fl_draw.H></TT> header file. FLTK provides the following types of +drawing functions: +<UL> +<LI><A href=#clipping>Clipping</A></LI> +<LI><A href=#color>Colors</A></LI> +<LI><A href=#fast>Fast Shapes</A></LI> +<LI><A href=#vertex>Complex Shapes</A></LI> +<LI><A href=#text>Text</A></LI> +<LI><A href=#images>Images</A></LI> +<LI><A href=#cursor>Cursor</A></LI> +<LI><A href=#overlay>Overlay</A></LI> +</UL> +<H3><A name=clipping>Clipping</A></H3> + You can limit all your drawing to a rectangular region by calling <TT> +fl_clip</TT>, and put the drawings back by using <TT>fl_pop_clip</TT>. + This rectangle is measured in pixels (it is unaffected by the current +transformation matrix). +<P>In addition, the system may provide clipping when updating windows, +this clip region may be more complex than a simple rectangle. </P> +<H4>void fl_clip(int x, int y, int w, int h)</H4> + Intersect the current clip region with a rectangle and push this new +region onto the stack. +<H4>void fl_pop_clip()</H4> + Restore the previous clip region. <I>You must call <TT>fl_pop_clip()</TT> + once for every time you call <TT>fl_clip()</TT>. If you return to +FLTK with the clip stack not empty unpredictable results occur.</I> +<H4>int fl_not_clipped(int x, int y, int w, int h)</H4> + Returns true if any of the rectangle intersects the current clip +region. If this returns false you don't have to draw the object. <I> +Under X this returns 2 if the rectangle is partially clipped, and 1 if +it is entirely inside the clip region</I>. +<H4>int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, +int &H)</H4> + Intersect the rectangle <TT>x,y,w,h</TT> with the current clip region +and returns the bounding box of the result in <TT>X,Y,W,H</TT>. + Returns non-zero if the resulting rectangle is different than the +original. This can be used to limit the necessary drawing to a +rectangle. <TT>W</TT> and <TT>H</TT> are set to zero if the rectangle +is completely outside the region. +<H3><A name=colors>Colors</A></H3> +<H4>void fl_color(Fl_Color)</H4> + Set the color for all subsequent drawing operations. <TT>Fl_Color</TT> + is an enumeration type, and all values are in the range 0-255. This +is <I>not</I> the X or WIN32 pixel, it is an index into an internal +table! The table provides several general colors, a 24-entry gray +ramp, and a 5x8x5 color cube. All of these are named with +poorly-documented symbols in <A href=enumerations.html#enumerations><TT> +<FL/Enumerations.H></TT></A>. +<P>For colormapped displays, a color cell will be allocated out of <TT> +fl_colormap</TT> the first time you use a color. If the colormap fills +up then a least-squares algorithm is used to find the closest color. </P> +<H4>Fl_Color fl_color()</H4> + Returns the last <TT>fl_color()</TT> that was set. This can be used +for state save/restore. +<H4>void fl_color(uchar r, uchar g, uchar b)</H4> + Set the color for all subsequent drawing operations. The closest +possible match to the RGB color is used. The RGB color is used +directly on TrueColor displays. For colormap visuals the nearest index +in the gray ramp or color cube is used. +<H3><A name=fast_shapes>Fast Shapes</A></H3> + These are used to draw almost all the FLTK widgets. They draw on +exact pixel boundaries and are as fast as possible, and their behavior +will be duplicated exactly on any platform FLTK is ported to. It is +undefined whether these are affected by the <A href=#complex_shapes> +transformation matrix</A>, so you should only call these while it is +the identity. +<H4>void fl_rectf(int x, int y, int w, int h)</H4> + Color a rectangle that exactly fills the given bounding box. +<H4>void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b)</H4> + Color a rectangle with "exactly" the passed <TT>r,g,b</TT> color. On +screens with less than 24 bits of color this is done by drawing a +solid-colored block using <A href=#fl_draw_image><TT>fl_draw_image()</TT> +</A> so that dithering is produced. +<H4>void fl_rect(int x, int y, int w, int h)</H4> + Draw a 1-pixel border <I>inside</I> this bounding box. +<H4>void fl_line(int x, int y, int x1, int y1) +<BR> void fl_line(int x, int y, int x1, int y1, int x2, int y2)</H4> + Draw one or two 1-pixel thick lines between the given points. +<H4>void fl_loop(int x, int y, int x1, int y1, int x2, int y2) +<BR> void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, +int y3)</H4> + Outline a 3 or 4-sided polygon with 1-pixel thick lines. +<H4>void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) +<BR> void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int +x3, int y3)</H4> + Fill a 3 or 4-sided polygon. The polygon must be convex. +<H4>void fl_xyline(int x, int y, int x1, int y1) +<BR> void fl_xyline(int x, int y, int x1, int y1, int x2) +<BR> void fl_xyline(int x, int y, int x1, int y1, int x2, int y3)</H4> + Draw 1-pixel wide horizontal and vertical lines. A horizontal line is +drawn first, then a vertical, then a horizontal. +<H4>void fl_yxline(int x, int y, int y1) +<BR> void fl_yxline(int x, int y, int y1, int x2) +<BR> void fl_yxline(int x, int y, int y1, int x2, int y3)</H4> + Draw 1-pixel wide vertical and horizontal lines. A vertical line is +drawn first, then a horizontal, then a vertical. +<H4>void fl_arc(int x, int y, int w, int h, double a1, double a2) +<BR> void fl_pie(int x, int y, int w, int h, double a1, double a2) +<BR> void fl_chord(int x, int y, int w, int h, double a1, double a2)</H4> + High-speed ellipse sections. These functions match the rather limited +circle drawing code provided by X and MSWindows. The advantage over +using <A href=#fl_arc><TT>fl_arc</TT></A> is that they are faster +because they often use the hardware, and they draw much nicer small +circles, since the small sizes are often hard-coded bitmaps. +<P>If a complete circle is drawn it will fit inside the passed bounding +box. The two angles are measured in degrees counterclockwise from +3'oclock and are the starting and ending angle of the arc, <TT>a2</TT> + must be greater or equal to <TT>a1</TT>. </P> +<P><TT>fl_arc()</TT> draws a 1-pixel thick line (notice this has a +different number of arguments than the <A href=#fl_arc><TT>fl_arc()</TT></A> + described below. </P> +<P><TT>fl_pie()</TT> draws a filled-in pie slice. This slice may +extend outside the line drawn by <TT>fl_arc</TT>, to avoid this use <TT> +w - 1</TT> and <TT>h - 1</TT>. </P> +<P><TT>fl_chord()</TT> is not yet implemented. </P> +<H3><A name=complex_shapes>Complex Shapes</A></H3> + These functions let you draw arbitrary shapes with 2-D linear +transformations. The functionality matches that found in Adobe® +PostScript<SUP>TM</SUP>. The exact pixels filled in is less defined +than for the above calls, so that FLTK can take advantage of drawing +hardware. The transformed vertices are rounded to integers before +drawing the line segments. This severely limits the accuracy of these +functions for complex graphics. Use OpenGL when greater accuracy +and/or performance is required. +<H4>void fl_push_matrix() +<BR> void fl_pop_matrix()</H4> + Save and restore the current transformation. The maximum depth of the +stack is 4. +<H4>void fl_scale(float x, float y) +<BR> void fl_scale(float x) +<BR> void fl_translate(float x, float y) +<BR> void fl_rotate(float d) +<BR> void fl_mult_matrix(float a, float b, float c, float d, float +x, float y)</H4> + Concatenate another transformation onto the current one. The rotation +angle is in degrees (not radians) and is counter-clockwise. +<H4>void fl_begin_line() +<BR> void fl_end_line()</H4> + Start and end drawing 1-pixel thick lines. +<H4>void fl_begin_loop() +<BR> void fl_end_loop()</H4> + Start and end drawing a closed sequence of 1-pixel thick lines. +<H4>void fl_begin_polygon() +<BR> void fl_end_polygon()</H4> + Start and end drawing a convex filled polygon. +<H4>void fl_begin_complex_polygon() +<BR> void fl_gap() +<BR> void fl_end_complex_polygon()</H4> + Start and end drawing a complex filled polygon. This polygon may be +concave, may have holes in it, or may be several disconnected pieces. +Call <TT>fl_gap()</TT> to seperate loops of the path (it is unnecessary +but harmless to call <TT>fl_gap()</TT> before the first vertex, after +the last one, or several times in a row). For portability, you should +only draw polygons that appear the same whether "even/odd" or +"non-zero" winding rules are used to fill them. This mostly means that +holes should be drawn in the opposite direction of the outside. +<P><TT>fl_gap()</TT> should only be called between <TT> +fl_begin_complex_polygon()</TT> and <TT>fl_end_complex_polygon()</TT>. + To outline the polygon, use <TT>fl_begin_loop()</TT> and replace each <TT> +fl_gap()</TT> with <TT>fl_end_loop();fl_begin_loop()<TT>. </TT></TT></P> +<H4>void fl_vertex(float x, float y)</H4> + Add a single vertex to the current path. +<H4>void fl_curve(float x, float y, float x1, float y1, float x2, float +y2, float x3, float y3)</H4> + Add a series of points on a Bezier curve to the path. The curve ends +(and two of the points) are at <TT>x,y</TT> and <TT>x3,y3</TT>. +<H4>void fl_arc(float x, float y, float r, float start, float end)</H4> + Add a series of points to the current path on the arc of a circle (you +can get elliptical paths by using scale and rotate before calling +this). <TT>x,y</TT> are the center of the circle, and <TT>r</TT> is its +radius. <TT>fl_arc()</TT> takes <TT>start</TT> and <TT>end</TT> angles +that are measured in degrees counter-clockwise from 3 o'clock. If <TT> +end</TT> is less than <TT>start</TT> then it draws the arc in a +clockwise direction. +<H4>void fl_circle(float x, float y, float r)</H4> +<TT>fl_circle()</TT> is equivalent to <TT>fl_arc(...,0,360)</TT> but +may be faster. It must be the <I>only</I> thing in the path: if you +want a circle as part of a complex polygon you must use <TT>fl_arc()</TT> +. <I>This draws incorrectly if the transformation is both rotated and +non-square scaled.</I> +<H3><A name=text>Text</A></H3> + All text is drawn in the <A href=#fl_font>current font</A>. It is +undefined whether this location or the characters are modified by the +current transformation. +<H4>void fl_draw(const char *, float x, float y) +<BR> void fl_draw(const char *, int n, float x, float y)</H4> + Draw a nul-terminated string or an array of <TT>n</TT> characters +starting at the given location. +<H4>void fl_draw(const char *, int x, int y, int w, int h, Fl_Align)</H4> + Fancy string drawing function which is used to draw all the labels. +The string is formatted and aligned inside the passed box. Handles +'\t' and '\n', expands all other control characters to ^X, and aligns +inside or against the edges of the box. See <A href=Fl_Widget.html#Fl_Widget.align> +<TT>Fl_Widget::align()</TT></A> for values for <TT>align</TT>. The +value <TT>FL_ALIGN_INSIDE</TT> is ignored, as this function always +prints inside the box. +<H4>void fl_measure(const char *, int &w, int &h)</H4> + Measure how wide and tall the string will be when printed by the <TT> +fl_draw(...align)</TT> function. If the incoming <TT>w</TT> is +non-zero it will wrap to that width. +<H4>int fl_height()</H4> + Recommended minimum line spacing for the current font. You can also +just use the value of <TT>size</TT> passed to <A href=#fl_font><TT> +fl_font()</TT></A>. +<H4>int fl_descent()</H4> + Recommended distance above the bottom of a <TT>fl_height()</TT> tall +box to draw the text at so it looks centered vertically in that box. +<H4>float fl_width(const char*) +<BR> float fl_width(const char*, int n) +<BR> float fl_width(uchar)</H4> + Return the width of a nul-terminated string, a sequence of <TT>n</TT> + characters, or a single character. +<H4>const char *fl_shortcut_label(ulong)</H4> + Unparse a shortcut value as used by <A href=Fl_Button.html#Fl_Button.shortcut> +<TT>Fl_Button</TT></A> or <A href=Fl_Menu_Item.html#Fl_Menu_Item><TT> +Fl_Menu_Item</TT></A> into a human-readable string like "Alt+N". This +only works if the shortcut is a character key or a numbered function +key. If the shortcut is zero an empty string is returned. The return +value points at a static buffer that is overwritten with each call. +<H3><A name=fonts>Fonts</A></H3> +<H4><A name=fl_font>void fl_font(int face, int size)</A></H4> + Set the current font, which is then used by the routines described +above. You may call this outside a draw context if necessary to call <TT> +fl_width()</TT>, but on X this will open the display. +<P>The font is identified by a <TT>face</TT> and a <TT>size</TT>. The +size of the font is measured in <TT>pixels</TT> (i.e. it is not +"resolution [in]dependent"). Lines should be spaced <TT>size</TT> + pixels apart (or more). </P> +<P>The <TT>face</TT> is an index into an internal table. Initially +only the first 16 faces are filled in. There are symbolic names for +them: <TT>FL_HELVETICA</TT>, <TT>FL_TIMES</TT>, <TT>FL_COURIER</TT>, +and modifier values <TT>FL_BOLD</TT> and <TT>FL_ITALIC</TT> which can +be added to these, and <TT>FL_SYMBOL</TT> and <TT>FL_ZAPF_DINGBATS</TT> +. Faces greater than 255 cannot be used in <TT>Fl_Widget</TT> labels, +since it stores the index as a byte. </P> +<H4>int fl_font() +<BR> int fl_size()</H4> + Returns the face and size set by the most recent call to <TT> +fl_font(a,b)</TT>. This can be used to save/restore the font. +<H3><A name=cursor>Cursor</A></H3> +<H4>void fl_cursor(Fl_Cursor, Fl_Color = FL_WHITE, Fl_Color = FL_BLACK)</H4> + Change the cursor. Depending on the system this may affect the cursor +everywhere, or only when it is pointing at the window that is current +when you call this. For portability you should change the cursor back +to the default in response to <TT>FL_LEAVE</TT> events. +<P>The type <TT>Fl_Cursor</TT> is an enumeration defined in <A href=enumerations.html#enumerations> +<TT><Enumerations.H></TT></A>. The double-headed arrows are bitmaps +provided by FLTK on X, the others are provided by system-defined +cursors. Under X you can get any XC_cursor value by passing <TT> +Fl_Cursor((XC_foo/2)+1)</TT>. </P> +<P>The following standard cursors are available: </P> +<UL> +<LI><TT>FL_CURSOR_DEFAULT</TT> - the default cursor, usually an arrow </LI> +<LI><TT>FL_CURSOR_ARROW</TT> - an arrow pointer </LI> +<LI><TT>FL_CURSOR_CROSS</TT> - crosshair </LI> +<LI><TT>FL_CURSOR_WAIT</TT> - watch or hourglass </LI> +<LI><TT>FL_CURSOR_INSERT</TT> - I-beam </LI> +<LI><TT>FL_CURSOR_HAND</TT> - hand (uparrow on MSWindows) </LI> +<LI><TT>FL_CURSOR_HELP</TT> - question mark </LI> +<LI><TT>FL_CURSOR_MOVE</TT> - 4-pointed arrow </LI> +<LI><TT>FL_CURSOR_NS</TT> - up/down arrow </LI> +<LI><TT>FL_CURSOR_WE</TT> - left/right arrow </LI> +<LI><TT>FL_CURSOR_NWSE</TT> - diagonal arrow </LI> +<LI><TT>FL_CURSOR_NESW</TT> - diagonal arrow </LI> +<LI><TT>FL_CURSOR_NONE</TT> - invisible </LI> +</UL> +<H3><A name=overlay>Overlays</A></H3> +<H4>void fl_overlay_rect(int x, int y, int w, int h) +<BR> void fl_overlay_clear()</H4> + These functions allow you to draw interactive selection rectangles +without using the overlay hardware. FLTK will XOR a single rectangle +outline over a window. Calling this will erase any previous rectangle +(by XOR'ing it), and then draw the new one. Calling <TT> +fl_overlay_clear()</TT> will erase the rectangle without drawing a new +one. +<P>Using this is tricky. You should make a widget with both a <TT> +handle()</TT> and <TT>draw()</TT> method. <TT>draw()</TT> should call <TT> +fl_overlay_clear()</TT> before doing anything else. Your <TT>handle()</TT> + method should call <TT>window()->make_current()</TT> and then <TT> +fl_overlay_rect()</TT> after <TT>FL_DRAG</TT> events, and should call <TT> +fl_overlay_clear()</TT> after a <TT>FL_RELEASE</TT> event. </P> +<H2><A name=images>Images</A></H2> + To draw images, you can either do it directly from data in your +memory, or you can create <A href=#Fl_Bitmap><TT>Fl_Bitmap</TT></A>, <A href=#Fl_Image> +<TT>Fl_Image</TT></A>, or <A href=#Fl_Pixmap><TT>Fl_Pixmap</TT></A> + objects. The advantage of drawing directly is that it is more +intuitive, and it is faster if the image data changes more often than +it is redrawn. The advantage of using the object is that FLTK will +cache translated forms of the image (on X it uses a server pixmap) and +thus redrawing is <I>much</I> faster. +<H3>Direct Image Drawing</H3> + It is undefined whether the location or drawing of the image is +affected by the current transformation, so you should only call these +when it is the identity. +<H4>void fl_draw_bitmap(const uchar *, int X, int Y, int W, int H, int +LD = 0)</H4> + This function is planned but not yet implemented (it may be impossible +under X without allocating a pixmap). +<H4>void fl_draw_image(const uchar *, int X, int Y, int W, int H, int D += 3, int LD = 0) +<BR> void fl_draw_image_mono(const uchar *, int X, int Y, int W, int H, +int D = 1, int LD = 0)</H4> + Draw an 8-bit per color RGB or luminance image. The pointer points at +the "r" data of the top-left pixel. Data must be in <TT>r,g,b</TT> + order. <TT>X,Y</TT> are where to put the top-left corner. <TT>W</TT> + and <TT>H</TT> define the size of the image. <TT>D</TT> is the delta +to add to the pointer between pixels, it may be any value greater or +equal to <TT>3</TT>, or it can be negative to flip the image +horizontally. <TT>LD</TT> is the delta to add to the pointer between +lines (if 0 is passed it uses <TT>W * D</TT>), and may be larger than <TT> +W * D</TT> to crop data, or negative to flip the image vertically. +<P>It is highly recommended that you put the following code before the +first <TT>show()</TT> of <I>any</I> window in your program to get rid +of the dithering if possible: </P> +<UL> +<PRE> Fl::visual(FL_RGB); -</pre></ul> - -Gray scale (1-channel) images may be drawn. This is done if -<tt>abs(D)</tt> is less than 3, or by calling -<tt>fl_draw_image_mono()</tt>. Only one 8-bit sample is used for each -pixel, and on screens with different numbers of bits for red, green, -and blue only gray colors are used. Setting <tt>D</tt> greater than 1 -will let you display one channel of a color image. - -<p><i>The X version does not support all possible visuals.</i> If FLTK -cannot draw the image in the current visual it will abort. FLTK -supports any visual of 8 bits or less, and all common TrueColor -visuals up to 32 bits. - -<h4>typedef void (*fl_draw_image_cb)(void *, int x, int y, int w, uchar *)<br> -void fl_draw_image(fl_draw_image_cb, void *, int X, int Y, int W, int H, int D = 3)<br> -void fl_draw_image_mono(fl_draw_image_cb, void *, int X, int Y, int W, int H, int D = 1)</h4> - -Call the passed function to provide each scan line of the image. This -lets you generate the image as it is being drawn, or do arbitrary -decompression of stored data (provided it can be decompressed to -individual scan lines easily). - -<p>The callback is called with the <tt>void *</tt> user data pointer -(this can be used to point at a structure of information about the -image), and the <tt>x</tt>, <tt>y</tt>, and <tt>w</tt> of the scan line -desired from the image. 0,0 is the upper-left corner (<i>not -<tt>X,Y</tt></i>). A pointer to a buffer to put the data into is -passed. You must copy <tt>w</tt> pixels from scanline <tt>y</tt>, -starting at pixel <tt>x</tt>, to this buffer. - -<p>Due to cropping, less than the whole image may be requested. So -<tt>x</tt> may be greater than zero, the first <tt>y</tt> may be -greater than zero, and <tt>w</tt> may be less than <tt>W</tt>. The -buffer is long enough to store the entire <tt>W * D</tt> pixels, this -is for convienence with some decompression schemes where you must -decompress the entire line at once: decompress it into the buffer, and -then if <tt>x</tt> is not zero, copy the data over so the <tt>x</tt>'th -pixel is at the start of the buffer. - -<p>You can assume the <tt>y</tt>'s will be consecutive, except the first one -may be greater than zero. - -<p>If <tt>D</tt> is 4 or more, you must fill in the unused bytes with zero. - -<h4>int fl_draw_pixmap(char **data, int X, int Y, Fl_Color = FL_GRAY)</h4> - -Draw XPM image data, with the top-left corner at the given position. -The images is dithered on 8-bit displays so you won't lose color space -for programs displaying both images and pixmaps. This function -returns zero if there was any error decoding the XPM data. - -<p>To use an XPM, do: - -<ul><pre> -#include "foo.xpm" +</PRE> +</UL> + Gray scale (1-channel) images may be drawn. This is done if <TT>abs(D)</TT> + is less than 3, or by calling <TT>fl_draw_image_mono()</TT>. Only one +8-bit sample is used for each pixel, and on screens with different +numbers of bits for red, green, and blue only gray colors are used. + Setting <TT>D</TT> greater than 1 will let you display one channel of +a color image. +<P><I>The X version does not support all possible visuals.</I> If FLTK +cannot draw the image in the current visual it will abort. FLTK +supports any visual of 8 bits or less, and all common TrueColor visuals +up to 32 bits. </P> +<H4>typedef void (*fl_draw_image_cb)(void *, int x, int y, int w, uchar +*) +<BR> void fl_draw_image(fl_draw_image_cb, void *, int X, int Y, int W, +int H, int D = 3) +<BR> void fl_draw_image_mono(fl_draw_image_cb, void *, int X, int Y, +int W, int H, int D = 1)</H4> + Call the passed function to provide each scan line of the image. This +lets you generate the image as it is being drawn, or do arbitrary +decompression of stored data (provided it can be decompressed to +individual scan lines easily). +<P>The callback is called with the <TT>void *</TT> user data pointer +(this can be used to point at a structure of information about the +image), and the <TT>x</TT>, <TT>y</TT>, and <TT>w</TT> of the scan line +desired from the image. 0,0 is the upper-left corner (<I>not <TT>X,Y</TT> +</I>). A pointer to a buffer to put the data into is passed. You must +copy <TT>w</TT> pixels from scanline <TT>y</TT>, starting at pixel <TT>x</TT> +, to this buffer. </P> +<P>Due to cropping, less than the whole image may be requested. So <TT> +x</TT> may be greater than zero, the first <TT>y</TT> may be greater +than zero, and <TT>w</TT> may be less than <TT>W</TT>. The buffer is +long enough to store the entire <TT>W * D</TT> pixels, this is for +convienence with some decompression schemes where you must decompress +the entire line at once: decompress it into the buffer, and then if <TT> +x</TT> is not zero, copy the data over so the <TT>x</TT>'th pixel is at +the start of the buffer. </P> +<P>You can assume the <TT>y</TT>'s will be consecutive, except the +first one may be greater than zero. </P> +<P>If <TT>D</TT> is 4 or more, you must fill in the unused bytes with +zero. </P> +<H4>int fl_draw_pixmap(char **data, int X, int Y, Fl_Color = FL_GRAY)</H4> + Draw XPM image data, with the top-left corner at the given position. +The images is dithered on 8-bit displays so you won't lose color space +for programs displaying both images and pixmaps. This function returns +zero if there was any error decoding the XPM data. +<P>To use an XPM, do: </P> +<UL> +<PRE> +#include "foo.xpm" ... fl_draw_pixmap(foo, X, Y); -</pre></ul> - -In the current version the XPM data is converted to 8-bit full color -and passed through <tt>fl_draw_image()</tt>. This is obviously not the -most efficient way to do it, and has the same visual limitations as -listed above for <tt>fl_draw_image()</tt>. Transparent colors are -replaced by the optional <tt>Fl_Color</tt> argument (this may change in -the future). - -<h4>int fl_measure_pixmap(char **data, int &w, int &h)</h4> - -An XPM image contains the dimensions in its data. This function -finds and returns the width and height. The return value is non-zero -if it parsed the dimensions ok, and zero if there is any problem. - -<h3><a name="Fl_Bitmap">class Fl_Bitmap</a></h3> - -This object encapsulates the width, height, and bits of an X bitmap -(XBM), and allows you to make an <tt>Fl_Widget</tt> use a bitmap as a -label, or to just draw the bitmap directly. Under X it will create an -offscreen pixmap the first time it is drawn, and copy this each -subsequent time it is drawn. - -<h4>Fl_Bitmap(const char *bits, int W, int H)<br> -Fl_Bitmap(const uchar *bits, int W, int H)</h4> - -Construct using an X bitmap. The bits pointer is simply copied to the -object, so it must point at persistent storage. The two constructors -are provided because various X implementations disagree about the type -of bitmap data. To use an XBM file use: - -<ul><pre> -#include "foo.xbm" +</PRE> +</UL> + In the current version the XPM data is converted to 8-bit full color +and passed through <TT>fl_draw_image()</TT>. This is obviously not the +most efficient way to do it, and has the same visual limitations as +listed above for <TT>fl_draw_image()</TT>. Transparent colors are +replaced by the optional <TT>Fl_Color</TT> argument (this may change in +the future). +<H4>int fl_measure_pixmap(char **data, int &w, int &h)</H4> + An XPM image contains the dimensions in its data. This function finds +and returns the width and height. The return value is non-zero if it +parsed the dimensions ok, and zero if there is any problem. +<H3><A name=Fl_Bitmap>class Fl_Bitmap</A></H3> + This object encapsulates the width, height, and bits of an X bitmap +(XBM), and allows you to make an <TT>Fl_Widget</TT> use a bitmap as a +label, or to just draw the bitmap directly. Under X it will create an +offscreen pixmap the first time it is drawn, and copy this each +subsequent time it is drawn. +<H4>Fl_Bitmap(const char *bits, int W, int H) +<BR> Fl_Bitmap(const uchar *bits, int W, int H)</H4> + Construct using an X bitmap. The bits pointer is simply copied to the +object, so it must point at persistent storage. The two constructors +are provided because various X implementations disagree about the type +of bitmap data. To use an XBM file use: +<UL> +<PRE> +#include "foo.xbm" ... Fl_Bitmap bitmap = new Fl_Bitmap(foo_bits, foo_width, foo_height); -</pre></ul> - -<h4>~Fl_Bitmap()</h4> - -The destructor will destroy any X pixmap created. It does not do -anything to the bits data. - -<h4>void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)</h4> - -<tt>x,y,w,h</tt> indicates a destination rectangle. <tt>ox,oy,w,h</tt> -is a source rectangle. This source rectangle from the bitmap is drawn -in the destination. 1 bits are drawn with the current color, 0 bits -are unchanged. The source rectangle may extend outside the bitmap -(i.e. <tt>ox</tt> and <tt>oy</tt> may be negative and <tt>w</tt> and -<tt>h</tt> may be bigger than the bitmap) and this area is left -unchanged. - -<h4>void draw(int x, int y)</h4> - -Draws the bitmap with the upper-left corner at <tt>x,y</tt>. This is -the same as doing <tt>draw(x,y,this->w,this->h,0,0)</tt>. - -<h4>void label(Fl_Widget *)</h4> - -Change the <tt>label()</tt> and the <tt>labeltype()</tt> of the widget -to draw the bitmap. 1 bits will be drawn with the -<tt>labelcolor()</tt>, zero bits will be unchanged. You can use the -same bitmap for many widgets. - - -<h2><a name="Fl_Pixmap">class Fl_Pixmap</h2> - -This object encapsulates the data from an XPM image, and allows you to -make an <tt>Fl_Widget</tt> use a pixmap as a label, or to just draw the -pixmap directly. <i>Under X it will create an offscreen pixmap the -first time it is drawn, and copy this each subsequent time it is -drawn</i>. - -<p>The current implementation converts the pixmap to 8 bit color data -and uses <a href="#fl_draw_image"><tt>fl_draw_image()</tt></a> to draw -it. Thus you will get dithered colors on an 8 bit screen. - -<h4>Fl_Pixmap(char *const* data)</h4> - -Construct using XPM data. The data pointer is simply copied to the -object, so it must point at persistent storage. To use an XPM file do: - -<ul><pre> -#include <FL/Fl_Pixmap.H> -#include "foo.xpm" +</PRE> +</UL> +<H4>~Fl_Bitmap()</H4> + The destructor will destroy any X pixmap created. It does not do +anything to the bits data. +<H4>void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)</H4> +<TT>x,y,w,h</TT> indicates a destination rectangle. <TT>ox,oy,w,h</TT> + is a source rectangle. This source rectangle from the bitmap is drawn +in the destination. 1 bits are drawn with the current color, 0 bits +are unchanged. The source rectangle may extend outside the bitmap +(i.e. <TT>ox</TT> and <TT>oy</TT> may be negative and <TT>w</TT> and <TT> +h</TT> may be bigger than the bitmap) and this area is left unchanged. +<H4>void draw(int x, int y)</H4> + Draws the bitmap with the upper-left corner at <TT>x,y</TT>. This is +the same as doing <TT>draw(x,y,this->w,this->h,0,0)</TT>. +<H4>void label(Fl_Widget *)</H4> + Change the <TT>label()</TT> and the <TT>labeltype()</TT> of the widget +to draw the bitmap. 1 bits will be drawn with the <TT>labelcolor()</TT> +, zero bits will be unchanged. You can use the same bitmap for many +widgets. +<H2><A name=Fl_Pixmap>class Fl_Pixmap</A></H2> + This object encapsulates the data from an XPM image, and allows you to +make an <TT>Fl_Widget</TT> use a pixmap as a label, or to just draw the +pixmap directly. <I>Under X it will create an offscreen pixmap the +first time it is drawn, and copy this each subsequent time it is drawn</I> +. +<P>The current implementation converts the pixmap to 8 bit color data +and uses <A href=#fl_draw_image><TT>fl_draw_image()</TT></A> to draw +it. Thus you will get dithered colors on an 8 bit screen. </P> +<H4>Fl_Pixmap(char *const* data)</H4> + Construct using XPM data. The data pointer is simply copied to the +object, so it must point at persistent storage. To use an XPM file do: +<UL> +<PRE> +#include <FL/Fl_Pixmap.H> +#include "foo.xpm" ... Fl_Pixmap pixmap = new Fl_Pixmap(foo); -</ul></pre> - -<h4>~Fl_Pixmap()</h4> - -The destructor will destroy any X pixmap created. It does not do -anything to the data. - -<h4>void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)</h4> - -<tt>x,y,w,h</tt> indicates a destination rectangle. <tt>ox,oy,w,h</tt> -is a source rectangle. This source rectangle is copied to the -destination. The source rectangle may extend outside the pixmap (i.e. -<tt>ox</tt> and <tt>oy</tt> may be negative and <tt>w</tt> and -<tt>h</tt> may be bigger than the pixmap) and this area is left -unchanged. - -<h4>void draw(int x, int y)</h4> - -Draws the image with the upper-left corner at <tt>x,y</tt>. This is -the same as doing <tt>draw(x,y,this->w,this->h,0,0)</tt>. - -<h4>void label(Fl_Widget *)</h4> - -Change the <tt>label()</tt> and the <tt>labeltype()</tt> of the widget -to draw the pixmap. You can use the same pixmap for many widgets. - - -<H3><a name="Fl_Image">class Fl_Image</a></H3> - -This object encapsulates a full-color RGB image, and allows you to make -an <tt>Fl_Widget</tt> use an image as a label, or to just draw the -image directly. <i>Under X it will create an offscreen pixmap the -first time it is drawn, and copy this each subsequent time it is -drawn</i>. - -<h4>Fl_Image(char uchar *data, int W, int H, int D = 3, int LD = 0)</h4> - -Construct using a pointer to RGB data. <tt>W</tt> and <tt>H</tt> are -the size of the image in pixels. <tt>D</tt> is the delta between -pixels (it may be more than 3 to skip alpha or other data, or negative -to flip the image left/right). <tt>LD</tt> is the delta between lines -(it may be more than <tt>D * W</tt> to crop images, or negative to flip -the image vertically). The data pointer is simply copied to the -object, so it must point at persistent storage. - -<h4>~Fl_Image()</h4> - -The destructor will destroy any X pixmap created. It does not do -anything to the data. - -<h4>void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)</h4> - -<tt>x,y,w,h</tt> indicates a destination rectangle. <tt>ox,oy,w,h</tt> -is a source rectangle. This source rectangle is copied to the -destination. The source rectangle may extend outside the image (i.e. -<tt>ox</tt> and <tt>oy</tt> may be negative and <tt>w</tt> and -<tt>h</tt> may be bigger than the image) and this area is left -unchanged. - -<h4>void draw(int x, int y)</h4> - -Draws the image with the upper-left corner at <tt>x,y</tt>. This is -the same as doing <tt>draw(x,y,this->w,this->h,0,0)</tt>. - -<h4>void label(Fl_Widget *)</h4> - -Change the <tt>label()</tt> and the <tt>labeltype()</tt> of the widget -to draw the image. You can use the same image for many widgets. - -</BODY> -</HTML> +</PRE> +</UL> +<H4>~Fl_Pixmap()</H4> + The destructor will destroy any X pixmap created. It does not do +anything to the data. +<H4>void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)</H4> +<TT>x,y,w,h</TT> indicates a destination rectangle. <TT>ox,oy,w,h</TT> + is a source rectangle. This source rectangle is copied to the +destination. The source rectangle may extend outside the pixmap (i.e. <TT> +ox</TT> and <TT>oy</TT> may be negative and <TT>w</TT> and <TT>h</TT> + may be bigger than the pixmap) and this area is left unchanged. +<H4>void draw(int x, int y)</H4> + Draws the image with the upper-left corner at <TT>x,y</TT>. This is +the same as doing <TT>draw(x,y,this->w,this->h,0,0)</TT>. +<H4>void label(Fl_Widget *)</H4> + Change the <TT>label()</TT> and the <TT>labeltype()</TT> of the widget +to draw the pixmap. You can use the same pixmap for many widgets. +<H3><A name=Fl_Image>class Fl_Image</A></H3> + This object encapsulates a full-color RGB image, and allows you to +make an <TT>Fl_Widget</TT> use an image as a label, or to just draw the +image directly. <I>Under X it will create an offscreen pixmap the first +time it is drawn, and copy this each subsequent time it is drawn</I>. +<H4>Fl_Image(char uchar *data, int W, int H, int D = 3, int LD = 0)</H4> + Construct using a pointer to RGB data. <TT>W</TT> and <TT>H</TT> are +the size of the image in pixels. <TT>D</TT> is the delta between pixels +(it may be more than 3 to skip alpha or other data, or negative to flip +the image left/right). <TT>LD</TT> is the delta between lines (it may +be more than <TT>D * W</TT> to crop images, or negative to flip the +image vertically). The data pointer is simply copied to the object, so +it must point at persistent storage. +<H4>~Fl_Image()</H4> + The destructor will destroy any X pixmap created. It does not do +anything to the data. +<H4>void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)</H4> +<TT>x,y,w,h</TT> indicates a destination rectangle. <TT>ox,oy,w,h</TT> + is a source rectangle. This source rectangle is copied to the +destination. The source rectangle may extend outside the image (i.e. <TT> +ox</TT> and <TT>oy</TT> may be negative and <TT>w</TT> and <TT>h</TT> + may be bigger than the image) and this area is left unchanged. +<H4>void draw(int x, int y)</H4> + Draws the image with the upper-left corner at <TT>x,y</TT>. This is +the same as doing <TT>draw(x,y,this->w,this->h,0,0)</TT>. +<H4>void label(Fl_Widget *)</H4> + Change the <TT>label()</TT> and the <TT>labeltype()</TT> of the widget +to draw the image. You can use the same image for many widgets. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/editor.html b/documentation/editor.html index 12c7edb12..d55616a83 100644 --- a/documentation/editor.html +++ b/documentation/editor.html @@ -1,41 +1,35 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="editor">4 - Designing a Simple Text Editor</A></H1> - -This chapter takes you through the design of a simple FLTK-based text editor. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=editor>4 - Designing a Simple Text Editor</A></H1> + This chapter takes you through the design of a simple FLTK-based text +editor. <H2>Determining the Goals of the Text Editor</H2> - -Since this will be the first big project you'll be doing with FLTK, lets define -what we want our text editor to do: - -<ol> - <li>Menu_Bar/menus for all functions. - <li>Edit a single text file. - <li>Load from a file. - <li>Save to a file. - <li>Cut/copy/delete/paste functions. - <li>Search and replace functions. - <li>Keep track of when the file has been changed. -</ol> - + Since this will be the first big project you'll be doing with FLTK, +lets define what we want our text editor to do: +<OL> +<LI>Menu_Bar/menus for all functions. </LI> +<LI>Edit a single text file. </LI> +<LI>Load from a file. </LI> +<LI>Save to a file. </LI> +<LI>Cut/copy/delete/paste functions. </LI> +<LI>Search and replace functions. </LI> +<LI>Keep track of when the file has been changed. </LI> +</OL> <H2>Designing the Main Window</H2> - -Now that we've outlined the goals for our editor, we can begin with the design -of our GUI. Obviously the first thing that we need is a window: - -<ul><pre> + Now that we've outlined the goals for our editor, we can begin with +the design of our GUI. Obviously the first thing that we need is a +window: +<UL> +<PRE> Fl_Window *window; -window = new Fl_Window(640, 480, "Text Editor"); -</pre></ul> - +window = new Fl_Window(640, 480, "Text Editor"); +</PRE> +</UL> <H2>Variables</H2> - -Our text editor will need some global variables to keep track of things: - -<ul><pre> + Our text editor will need some global variables to keep track of +things: +<UL> +<PRE> Fl_Window *window; Fl_Menu_Bar *menubar; Fl_Multiline_Input *input; @@ -47,187 +41,173 @@ Fl_Return_Button *replace_next; Fl_Button *replace_cancel; int changed = 0; -char filename[1024] = ""; -char search[256] = ""; -</pre></ul> - -The <tt>window</tt> variable is our top-level window described previously. -We'll cover the other variables as we build the application. - +char filename[1024] = ""; +char search[256] = ""; +</PRE> +</UL> + The <TT>window</TT> variable is our top-level window described +previously. We'll cover the other variables as we build the +application. <H2>Menu_Bars and Menus</H2> - -The first goal requires us to use a menubar and menus that define -each function the editor needs to perform. The -<a href="#Fl_Menu_Item"><tt>Fl_Menu_Item</tt></a> structure is used to -define the menus and items in a menubar: - -<ul><pre> + The first goal requires us to use a menubar and menus that define each +function the editor needs to perform. The <A href=Fl_Menu_Item.html#Fl_Menu_Item> +<TT>Fl_Menu_Item</TT></A> structure is used to define the menus and +items in a menubar: +<UL> +<PRE> Fl_Menu_Item menuitems[] = { - { "&File", 0, 0, 0, FL_SUBMENU }, - { "&New", FL_ALT + 'n', new_cb }, - { "&Open...", FL_ALT + 'o', open_cb, 0, FL_MENU_DIVIDER }, - { "&Save", FL_ALT + 's', save_cb }, - { "Save &As...", FL_ALT + FL_SHIFT + 's', saveas_cb, 0, FL_MENU_DIVIDER }, - { "&Quit", FL_ALT + 'q', quit_cb }, + { "&File", 0, 0, 0, FL_SUBMENU }, + { "&New", FL_ALT + 'n', new_cb }, + { "&Open...", FL_ALT + 'o', open_cb, 0, FL_MENU_DIVIDER }, + { "&Save", FL_ALT + 's', save_cb }, + { "Save &As...", FL_ALT + FL_SHIFT + 's', saveas_cb, 0, FL_MENU_DIVIDER }, + { "&Quit", FL_ALT + 'q', quit_cb }, { 0 }, - { "&Edit", 0, 0, 0, FL_SUBMENU }, - { "&Undo", FL_ALT + 'z', undo_cb, 0, FL_MENU_DIVIDER }, - { "Cu&t", FL_ALT + 'x', cut_cb }, - { "&Copy", FL_ALT + 'c', copy_cb }, - { "&Paste", FL_ALT + 'v', paste_cb }, - { "&Delete", 0, delete_cb }, + { "&Edit", 0, 0, 0, FL_SUBMENU }, + { "&Undo", FL_ALT + 'z', undo_cb, 0, FL_MENU_DIVIDER }, + { "Cu&t", FL_ALT + 'x', cut_cb }, + { "&Copy", FL_ALT + 'c', copy_cb }, + { "&Paste", FL_ALT + 'v', paste_cb }, + { "&Delete", 0, delete_cb }, { 0 }, - { "&Search", 0, 0, 0, FL_SUBMENU }, - { "&Find...", FL_ALT + 'f', find_cb }, - { "F&ind Again", FL_ALT + 'g', find2_cb }, - { "&Replace...", FL_ALT + 'r', replace_cb }, - { "Re&place Again", FL_ALT + 't', replace2_cb }, + { "&Search", 0, 0, 0, FL_SUBMENU }, + { "&Find...", FL_ALT + 'f', find_cb }, + { "F&ind Again", FL_ALT + 'g', find2_cb }, + { "&Replace...", FL_ALT + 'r', replace_cb }, + { "Re&place Again", FL_ALT + 't', replace2_cb }, { 0 }, { 0 } }; -</pre></ul> - -Once we have the menus defined we can create the <tt>Fl_Menu_Bar</tt> widget -and assign the menus to it with: - -<ul><pre> +</PRE> +</UL> + Once we have the menus defined we can create the <TT>Fl_Menu_Bar</TT> + widget and assign the menus to it with: +<UL> +<PRE> Fl_Menu_Bar *menubar = new Fl_Menu_Bar(0, 0, 640, 30); -menubar->menu(menuitems); -</pre></ul> - -We'll define the callback functions later. - +menubar->menu(menuitems); +</PRE> +</UL> + We'll define the callback functions later. <H2>Editing the Text</H2> - -To keep things simple our text editor will use the -<a href="#Fl_Multiline_Input"><tt>Fl_Multiline_Input</tt></a> widget to -edit the text: - -<ul><pre> + To keep things simple our text editor will use the <A href=Fl_Multiline_Input.html#Fl_Multiline_Input> +<TT>Fl_Multiline_Input</TT></A> widget to edit the text: +<UL> +<PRE> Fl_Multiline_Input *input = new Fl_Multiline_Input(0, 30, 640, 450); -</pre></ul> - -So that we can keep track of changes to the file, we also want to add a -"changed" callback: - -<ul><pre> -input->callback(changed_cb); -input->when(FL_WHEN_CHANGED); -</pre></ul> - -Finally, we want to use a mono-spaced font like <tt>FL_COURIER</tt>: - -<ul><pre> -input->textfont(FL_COURIER); -</pre></ul> - +</PRE> +</UL> + So that we can keep track of changes to the file, we also want to add +a "changed" callback: +<UL> +<PRE> +input->callback(changed_cb); +input->when(FL_WHEN_CHANGED); +</PRE> +</UL> + Finally, we want to use a mono-spaced font like <TT>FL_COURIER</TT>: +<UL> +<PRE> +input->textfont(FL_COURIER); +</PRE> +</UL> <H2>The Replace Dialog</H2> - -We can use the FLTK convenience functions for many of the editor's -dialogs, however the replace dialog needs its own custom window. To -keep things simple we will have a "find" string, a "replace" string, -and "replace all", "replace next", and "cancel" buttons. The strings -are just <tt>Fl_Input</tt> widgets, the "replace all" and "cancel" -buttons are <tt>Fl_Button</tt> widgets, and the "replace next " button -is a <tt>Fl_Return_Button</tt> widget: - -<center><img src=editor-replace.gif></center> - -<ul><pre> -Fl_Window *replace_dlg = new Fl_Window(300, 105, "Replace"); -Fl_Input *replace_find = new Fl_Input(70, 10, 200, 25, "Find:"); -Fl_Input *replace_with = new Fl_Input(70, 40, 200, 25, "Replace:"); -Fl_Button *replace_all = new Fl_Button(10, 70, 90, 25, "Replace All"); -Fl_Button *replace_next = new Fl_Button(105, 70, 120, 25, "Replace Next"); -Fl_Button *replace_cancel = new Fl_Button(230, 70, 60, 25, "Cancel"); -</pre></ul> - + We can use the FLTK convenience functions for many of the editor's +dialogs, however the replace dialog needs its own custom window. To +keep things simple we will have a "find" string, a "replace" string, +and "replace all", "replace next", and "cancel" buttons. The strings +are just <TT>Fl_Input</TT> widgets, the "replace all" and "cancel" +buttons are <TT>Fl_Button</TT> widgets, and the "replace next " button +is a <TT>Fl_Return_Button</TT> widget: +<CENTER><IMG src=./editor-replace.gif></CENTER> +<UL> +<PRE> +Fl_Window *replace_dlg = new Fl_Window(300, 105, "Replace"); +Fl_Input *replace_find = new Fl_Input(70, 10, 200, 25, "Find:"); +Fl_Input *replace_with = new Fl_Input(70, 40, 200, 25, "Replace:"); +Fl_Button *replace_all = new Fl_Button(10, 70, 90, 25, "Replace All"); +Fl_Button *replace_next = new Fl_Button(105, 70, 120, 25, "Replace Next"); +Fl_Button *replace_cancel = new Fl_Button(230, 70, 60, 25, "Cancel"); +</PRE> +</UL> <H2>Callbacks</H2> - -Now that we've defined the GUI components of our editor, we need to define -our callback functions. - + Now that we've defined the GUI components of our editor, we need to +define our callback functions. <H3>changed_cb()</H3> - -This function will be called whenever the user changes any text in the -<tt>input</tt> widget: - -<ul><pre> + This function will be called whenever the user changes any text in the <TT> +input</TT> widget: +<UL> +<PRE> void changed_cb(void) { set_changed(1); } -</pre></ul> - -The <tt>set_changed()</tt> function is one that we will write to set the -changed status on the current file. We're doing it this way because some -of the other callbacks will set the changed status to 0, and also because -we want to show the changed status in the window's title bar. - +</PRE> +</UL> + The <TT>set_changed()</TT> function is one that we will write to set +the changed status on the current file. We're doing it this way +because some of the other callbacks will set the changed status to 0, +and also because we want to show the changed status in the window's +title bar. <H3>copy_cb()</H3> - -This callback function will call <a href="#Fl_Input.copy"> -<tt>input->copy()</tt></a> to copy the currently selected text to the -clipboard: - -<ul><pre> + This callback function will call <A href=#Fl_Input.copy><TT> +input->copy()</TT></A> to copy the currently selected text to the +clipboard: +<UL> +<PRE> void copy_cb(void) { - input->copy(); + input->copy(); } -</pre></ul> - +</PRE> +</UL> <H3>cut_cb()</H3> - -This callback function will call <a href="#Fl_Input_.copy"> -<tt>input->copy()</tt></a> to copy the currently selected text to the -clipboard and then <a href="#Fl_Input_.cut"><tt>input->cut()</tt></a> -to delete it: - -<ul><pre> + This callback function will call <A href=Fl_Input_.html#Fl_Input_.copy><TT> +input->copy()</TT></A> to copy the currently selected text to the +clipboard and then <A href=Fl_Input_.html#Fl_Input_.cut><TT>input->cut()</TT> +</A> to delete it: +<UL> +<PRE> void cut_cb(void) { - input->copy(); - input->cut(); + input->copy(); + input->cut(); } -</pre></ul> - +</PRE> +</UL> <H3>delete_cb()</H3> - -This callback function will call <a href="#Fl_Input_.cut"> -<tt>input->cut()</tt></a> to delete the selected text: - -<ul><pre> + This callback function will call <A href=Fl_Input_.html#Fl_Input_.cut><TT> +input->cut()</TT></A> to delete the selected text: +<UL> +<PRE> void delete_cb(void) { - input->cut(); + input->cut(); } -</pre></ul> - +</PRE> +</UL> <H3>find_cb()</H3> - -This callback function asks for a search string using the -<a href="#fl_input"><tt>fl_input()</tt></a> convenience function and -then calls the <tt>find2_cb()</tt> function to find the string: - -<ul><pre> + This callback function asks for a search string using the <A href=functions.html#fl_input> +<TT>fl_input()</TT></A> convenience function and then calls the <TT> +find2_cb()</TT> function to find the string: +<UL> +<PRE> void find_cb(void) { const char *val; - val = fl_input("Search String:", search); + val = fl_input("Search String:", search); if (val != NULL) { // User entered a string - go find it! strcpy(search, val); find2_cb(); } } -</pre></ul> - +</PRE> +</UL> <H3>find2_cb()</H3> - -This function will find the next occurrence of the search string. If the -search string is blank then we want to pop up the search dialog: - -<ul><pre> + This function will find the next occurrence of the search string. If +the search string is blank then we want to pop up the search dialog: +<UL> +<PRE> void find2_cb(void) { const char *val, *found; int pos; @@ -238,182 +218,174 @@ void find2_cb(void) { return; } - val = input->value() + input->mark(); + val = input->value() + input->mark(); found = strstr(val, search); if (found != NULL) { // Found a match; update the position and mark... - pos = input->mark() + found - val; - input->position(pos, pos + strlen(search)); + pos = input->mark() + found - val; + input->position(pos, pos + strlen(search)); } - else fl_alert("No occurrences of \'%s\' found!", search); + else fl_alert("No occurrences of \'%s\' found!", search); } -</pre></ul> - -If the search string cannot be found we use the <a href="#fl_alert"> -<tt>fl_alert()</tt></a> convenience function to display a message to -that effect. - +</PRE> +</UL> + If the search string cannot be found we use the <A href=#fl_alert><TT> +fl_alert()</TT></A> convenience function to display a message to that +effect. <H3>new_cb()</H3> - -This callback function will clear the input widget and current filename. -It also calls the <tt>check_save()</tt> function to give the user the -opportunity to save the current file first as needed: - -<ul><pre> + This callback function will clear the input widget and current +filename. It also calls the <TT>check_save()</TT> function to give the +user the opportunity to save the current file first as needed: +<UL> +<PRE> void new_cb(void) { if (changed) if (!check_save()) return; filename[0] = '\0'; - input->value(""); + input->value(""); set_changed(0); } -</pre></ul> - +</PRE> +</UL> <H3>open_cb()</H3> - -This callback function will ask the user for a filename and then load -the specified file into the input widget and current filename. It also -calls the <tt>check_save()</tt> function to give the user the -opportunity to save the current file first as needed: - -<ul><pre> + This callback function will ask the user for a filename and then load +the specified file into the input widget and current filename. It also +calls the <TT>check_save()</TT> function to give the user the +opportunity to save the current file first as needed: +<UL> +<PRE> void open_cb(void) { char *newfile; if (changed) if (!check_save()) return; - newfile = fl_file_chooser("Open File?", "*", filename); + newfile = fl_file_chooser("Open File?", "*", filename); if (newfile != NULL) load_file(newfile); } -</pre></ul> - -We call the <tt>load_file()</tt> function to actually load the file. - +</PRE> +</UL> + We call the <TT>load_file()</TT> function to actually load the file. <H3>paste_cb()</H3> - -This callback function will send a FL_PASTE message to the <tt>input</tt> -widget using the <a href="#paste"><tt>Fl::paste()</tt></a> method: - -<ul><pre> + This callback function will send a FL_PASTE message to the <TT>input</TT> + widget using the <A href=functions.html#paste><TT>Fl::paste()</TT></A> + method: +<UL> +<PRE> void paste_cb(void) { Fl::paste(*input); } -</pre></ul> - +</PRE> +</UL> <H3>quit_cb()</H3> - -The quit callback will first see if the current file has been modified, -and if so give the user a chance to save it. It then hides the main window: - -<ul><pre> + The quit callback will first see if the current file has been +modified, and if so give the user a chance to save it. It then hides +the main window: +<UL> +<PRE> void quit_cb(void) { if (changed) if (!check_save()) return; - window->hide(); + window->hide(); } -</pre></ul> - +</PRE> +</UL> <H3>replace_cb()</H3> - -The replace callback just shows the replace dialog: - -<ul><pre> + The replace callback just shows the replace dialog: +<UL> +<PRE> void replace_cb(void) { - replace_dlg->show(); + replace_dlg->show(); } -</pre></ul> - +</PRE> +</UL> <H3>replace2_cb()</H3> - -This callback will replace the next occurence of the replacement string. If -nothing has been entered for the replacement string, then the replace dialog -is displayed instead: - -<ul><pre> + This callback will replace the next occurence of the replacement +string. If nothing has been entered for the replacement string, then +the replace dialog is displayed instead: +<UL> +<PRE> void replace2_cb() { const char *find, *val, *found; int pos; - find = replace_find->value(); + find = replace_find->value(); if (find[0] == '\0') { // Search string is blank; get a new one... - replace_dlg->show(); + replace_dlg->show(); return; } - val = input->value() + input->position(); + val = input->value() + input->position(); found = strstr(val, find); if (found != NULL) { // Found a match; update the position and replace text... - pos = input->position() + found - val; - input->replace(pos, pos + strlen(find), replace_with->value()); - input->position(pos + strlen(replace_with->value())); + pos = input->position() + found - val; + input->replace(pos, pos + strlen(find), replace_with->value()); + input->position(pos + strlen(replace_with->value())); } - else fl_alert("No occurrences of \'%s\' found!", find); + else fl_alert("No occurrences of \'%s\' found!", find); } -</pre></ul> - +</PRE> +</UL> <H3>replall_cb()</H3> - -This callback will replace all occurences of the search string in the file: - -<ul><pre> + This callback will replace all occurences of the search string in the +file: +<UL> +<PRE> void replall_cb() { const char *find, *val, *found; int pos; int times; - find = replace_find->value(); + find = replace_find->value(); if (find[0] == '\0') { // Search string is blank; get a new one... - replace_dlg->show(); + replace_dlg->show(); return; } - input->position(0); + input->position(0); times = 0; // Loop through the whole string do { - val = input->value() + input->position(); + val = input->value() + input->position(); found = strstr(val, find); if (found != NULL) { // Found a match; update the position and replace text... times ++; - pos = input->position() + found - val; - input->replace(pos, pos + strlen(find), replace_with->value()); - input->position(pos + strlen(replace_with->value())); + pos = input->position() + found - val; + input->replace(pos, pos + strlen(find), replace_with->value()); + input->position(pos + strlen(replace_with->value())); } } while (found != NULL); - if (times > 0) fl_message("Replaced %d occurrences.", times); - else fl_alert("No occurrences of \'%s\' found!", find); + if (times > 0) fl_message("Replaced %d occurrences.", times); + else fl_alert("No occurrences of \'%s\' found!", find); } -</pre></ul> - +</PRE> +</UL> <H3>replcan_cb()</H3> - -This callback just hides the replace dialog: - -<ul><pre> + This callback just hides the replace dialog: +<UL> +<PRE> void replcan_cb() { - replace_dlg->hide(); + replace_dlg->hide(); } -</pre></ul> - +</PRE> +</UL> <H3>save_cb()</H3> - -This callback saves the current file. If the current filename is blank it -calls the "save as" callback: - -<ul><pre> + This callback saves the current file. If the current filename is +blank it calls the "save as" callback: +<UL> +<PRE> void save_cb(void) { if (filename[0] == '\0') { // No filename - get one! @@ -422,54 +394,47 @@ void save_cb(void) { } else save_file(filename); } -</pre></ul> - -The <tt>save_file()</tt> function saves the current file to the specified -filename. - +</PRE> +</UL> + The <TT>save_file()</TT> function saves the current file to the +specified filename. <H3>saveas_cb()</H3> - -This callback asks the user for a filename and saves the current file: - -<ul><pre> + This callback asks the user for a filename and saves the current file: +<UL> +<PRE> void saveas_cb(void) { char *newfile; - newfile = fl_file_chooser("Save File As?", "*", filename); + newfile = fl_file_chooser("Save File As?", "*", filename); if (newfile != NULL) save_file(newfile); } -</pre></ul> - -The <tt>save_file()</tt> function saves the current file to the specified -filename. - +</PRE> +</UL> + The <TT>save_file()</TT> function saves the current file to the +specified filename. <H3>undo_cb()</H3> - -The undo callback just calls the <a href="#Fl_Input_.undo"> -<tt>undo()</tt></a> method: - -<ul><pre> + The undo callback just calls the <A href=Fl_Input_.html#Fl_Input_.undo><TT> +undo()</TT></A> method: +<UL> +<PRE> void undo_cb(void) { - input->undo(); + input->undo(); } -</pre></ul> - +</PRE> +</UL> <H2>Other Functions</H2> - -Now that we've defined the callback functions, we need our support functions -to make it all work: - + Now that we've defined the callback functions, we need our support +functions to make it all work: <H3>check_save()</H3> - -This function checks to see if the current file needs to be saved. If -so, it asks the user if they want to save it: - -<ul><pre> + This function checks to see if the current file needs to be saved. If +so, it asks the user if they want to save it: +<UL> +<PRE> int check_save(void) { if (!changed) return 1; - if (fl_ask("The current file has not been saved.\n" - "Would you like to save it now?")) { + if (fl_ask("The current file has not been saved.\n" + "Would you like to save it now?")) { // Save the file... save_cb(); @@ -477,62 +442,59 @@ int check_save(void) { } else return (1); } -</pre></ul> - +</PRE> +</UL> <H3>load_file()</H3> - -This function loads the specified file into the <tt>input</tt> widget: - -<ul><pre> + This function loads the specified file into the <TT>input</TT> widget: +<UL> +<PRE> void load_file(char *newfile) { FILE *fp; char buffer[8192]; int nbytes; int pos; - input->value(""); + input->value(""); - fp = fopen(newfile, "r"); + fp = fopen(newfile, "r"); if (fp != NULL) { // Was able to open file; let's read from it... strcpy(filename, newfile); pos = 0; - while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) { - input->replace(pos, pos, buffer, nbytes); + while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) { + input->replace(pos, pos, buffer, nbytes); pos += nbytes; } fclose(fp); - input->position(0); + input->position(0); set_changed(0); } else { // Couldn't open file - say so... - fl_alert("Unable to open \'%s\' for reading!"); + fl_alert("Unable to open \'%s\' for reading!"); } } -</pre></ul> - -When loading the file we use the <a href="#Fl_Input_.replace"> -<tt>input->replace()</tt></a> method to "replace" the text at the end of -the buffer. The <tt>pos</tt> variable keeps track of the end of the -buffer. - +</PRE> +</UL> + When loading the file we use the <A href=Fl_Input_.html#Fl_Input_.replace> +<TT>input->replace()</TT></A> method to "replace" the text at the end +of the buffer. The <TT>pos</TT> variable keeps track of the end of the +buffer. <H3>save_file()</H3> - -This function saves the current buffer to the specified file: - -<ul><pre> + This function saves the current buffer to the specified file: +<UL> +<PRE> void save_file(char *newfile) { FILE *fp; - fp = fopen(newfile, "w"); + fp = fopen(newfile, "w"); if (fp != NULL) { // Was able to create file; let's write to it... strcpy(filename, newfile); - if (fwrite(input->value(), 1, input->size(), fp) < 1) { - fl_alert("Unable to write file!"); + if (fwrite(input->value(), 1, input->size(), fp) < 1) { + fl_alert("Unable to write file!"); fclose(fp); return; } @@ -541,17 +503,16 @@ void save_file(char *newfile) { set_changed(0); } else { // Couldn't open file - say so... - fl_alert("Unable to create \'%s\' for writing!"); + fl_alert("Unable to create \'%s\' for writing!"); } } -</pre></ul> - +</PRE> +</UL> <H3>set_changed()</H3> - -This function sets the <tt>changed</tt> variable and updates the window label -accordingly: - -<ul><pre> + This function sets the <TT>changed</TT> variable and updates the +window label accordingly: +<UL> +<PRE> void set_changed(int c) { if (c != changed) { char title[1024]; @@ -559,7 +520,7 @@ void set_changed(int c) { changed = c; - if (filename[0] == '\0') strcpy(title, "Untitled"); + if (filename[0] == '\0') strcpy(title, "Untitled"); else { slash = strrchr(filename, '/'); if (slash == NULL) slash = strrchr(filename, '\\'); @@ -568,36 +529,29 @@ void set_changed(int c) { else strcpy(title, filename); } - if (changed) strcat(title, " (modified)"); + if (changed) strcat(title, " (modified)"); - window->label(title); + window->label(title); } } -</pre></ul> - +</PRE> +</UL> <H2>Compiling the Editor</H2> - -The complete source for our text editor can be found in the -<tt>test/editor.cxx</tt> source file. Both the Makefile and Visual C++ -workspace include the necessary rules to build the editor. You can -also compile it using a standard compiler with: - -<ul><pre> + The complete source for our text editor can be found in the <TT> +test/editor.cxx</TT> source file. Both the Makefile and Visual C++ +workspace include the necessary rules to build the editor. You can +also compile it using a standard compiler with: +<UL> +<PRE> CC -o editor editor.cxx -lfltk -lXext -lX11 -lm -</pre></ul> - -As noted in <a href="#basics">Chapter 1</a>, you may need to include -compiler and linker options to tell them where to find the FLTK library. -Also, the <tt>CC</tt> command may also be called <tt>gcc</tt> or -<tt>c++</tt> on your system. - -<p>Congratulations, you've just built your own text editor! - +</PRE> +</UL> + As noted in <A href=basics.html#basics>Chapter 1</A>, you may need to +include compiler and linker options to tell them where to find the FLTK +library. Also, the <TT>CC</TT> command may also be called <TT>gcc</TT> + or <TT>c++</TT> on your system. +<P>Congratulations, you've just built your own text editor! </P> <H2>The Final Product</H2> - -The final editor window should look like the image below: - -<center><img src=editor.gif></center> - -</BODY> -</HTML> + The final editor window should look like the image below: +<CENTER><IMG src=./editor.gif></CENTER> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/enumerations.html b/documentation/enumerations.html index 8d303bcc8..b709e60eb 100644 --- a/documentation/enumerations.html +++ b/documentation/enumerations.html @@ -1,373 +1,206 @@ -<HTML> -<BODY> -<H1 ALIGN=RIGHT><A NAME="enumerations">C - FLTK Enumerations.H</A></H1> - -This appendix lists the enumerations provided in the -<tt><FL/Enumerations.H></tt> header file, organized by section. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=enumerations>C - FLTK Enumerations.H</A></H1> + This appendix lists the enumerations provided in the <TT> +<FL/Enumerations.H></TT> header file, organized by section. <H2>Version Numbers</H2> - -The FLTK version number is stored in a number of compile-time constants: - -<ul> - - <li><tt>FL_MAJOR_VERSION</tt> - The major release number, currently - 1. - - <li><tt>FL_MINOR_VERSION</tt> - The minor release number, currently - 0. - - <li><tt>FL_PATCH_VERSION</tt> - The patch release number, currently - 0. - - <li><tt>FL_VERSION</tt> - A combined floating-point version - number for the major and minor release numbers, currently 1.0. - -</ul> - + The FLTK version number is stored in a number of compile-time +constants: +<UL> +<LI><TT>FL_MAJOR_VERSION</TT> - The major release number, currently 1. </LI> +<LI><TT>FL_MINOR_VERSION</TT> - The minor release number, currently 0. </LI> +<LI><TT>FL_PATCH_VERSION</TT> - The patch release number, currently 0. </LI> +<LI><TT>FL_VERSION</TT> - A combined floating-point version number for +the major and minor release numbers, currently 1.0. </LI> +</UL> <H2>Events</H2> - -Events are identified by an <tt>Fl_Event</tt> enumeration value. The -following events are currently defined: - -<ul> - - <li><tt>FL_NO_EVENT</tt> - No event occurred. - - <li><tt>FL_PUSH</tt> - A mouse button was pushed. - - <li><tt>FL_RELEASE</tt> - A mouse button was released. - - <li><tt>FL_ENTER</tt> - The mouse pointer entered a widget. - - <li><tt>FL_LEAVE</tt> - The mouse pointer left a widget. - - <li><tt>FL_DRAG</tt> - The mouse pointer was moved with a button - pressed. - - <li><tt>FL_FOCUS</tt> - A widget should receive keyboard focus. - - <li><tt>FL_UNFOCUS</tt> - A widget loses keyboard focus. - - <li><tt>FL_KEYBOARD</tt> - A key was pressed. - - <li><tt>FL_CLOSE</tt> - A window was closed. - - <li><tt>FL_MOVE</tt> - The mouse pointer was moved with no buttons - pressed. - - <li><tt>FL_SHORTCUT</tt> - The user pressed a shortcut key. - - <li><tt>FL_DEACTIVATE</tt> - The widget has been deactivated. - - <li><tt>FL_ACTIVATE</tt> - The widget has been activated. - - <li><tt>FL_HIDE</tt> - The widget has been hidden. - - <li><tt>FL_SHOW</tt> - The widget has been shown. - - <li><tt>FL_PASTE</tt> - The widget should paste the contents of the - clipboard. - - <li><tt>FL_SELECTIONCLEAR</tt> - The widget should clear any selections - made for the clipboard. - -</ul> - -<H2>Callback "When" Conditions</H2> - -The following constants determine when a callback is performed: - -<ul> - - <li><tt>FL_WHEN_NEVER</tt> - Never call the callback. - - <li><tt>FL_WHEN_CHANGED</tt> - Do the callback only when the - widget value changes. - - <li><tt>FL_WHEN_NOT_CHANGED</tt> - Do the callback whenever the - user interacts with the widget. - - <li><tt>FL_WHEN_RELEASE</tt> - Do the callback when the button or - key is released and the value changes. - - <li><tt>FL_WHEN_ENTER_KEY</tt> - Do the callback when the user presses - the ENTER key and the value changes. - - <li><tt>FL_WHEN_RELEASE_ALWAYS</tt> - Do the callback when the button - or key is released, even if the value doesn't change. - - <li><tt>FL_WHEN_ENTER_KEY_ALWAYS</tt> - Do the callback when the user - presses the ENTER key, even if the value doesn't change. - -</ul> - + Events are identified by an <TT>Fl_Event</TT> enumeration value. The +following events are currently defined: +<UL> +<LI><TT>FL_NO_EVENT</TT> - No event occurred. </LI> +<LI><TT>FL_PUSH</TT> - A mouse button was pushed. </LI> +<LI><TT>FL_RELEASE</TT> - A mouse button was released. </LI> +<LI><TT>FL_ENTER</TT> - The mouse pointer entered a widget. </LI> +<LI><TT>FL_LEAVE</TT> - The mouse pointer left a widget. </LI> +<LI><TT>FL_DRAG</TT> - The mouse pointer was moved with a button + pressed. </LI> +<LI><TT>FL_FOCUS</TT> - A widget should receive keyboard focus. </LI> +<LI><TT>FL_UNFOCUS</TT> - A widget loses keyboard focus. </LI> +<LI><TT>FL_KEYBOARD</TT> - A key was pressed. </LI> +<LI><TT>FL_CLOSE</TT> - A window was closed. </LI> +<LI><TT>FL_MOVE</TT> - The mouse pointer was moved with no buttons + pressed. </LI> +<LI><TT>FL_SHORTCUT</TT> - The user pressed a shortcut key. </LI> +<LI><TT>FL_DEACTIVATE</TT> - The widget has been deactivated. </LI> +<LI><TT>FL_ACTIVATE</TT> - The widget has been activated. </LI> +<LI><TT>FL_HIDE</TT> - The widget has been hidden. </LI> +<LI><TT>FL_SHOW</TT> - The widget has been shown. </LI> +<LI><TT>FL_PASTE</TT> - The widget should paste the contents of the + clipboard. </LI> +<LI><TT>FL_SELECTIONCLEAR</TT> - The widget should clear any selections + made for the clipboard. </LI> +</UL> +<H2>Callback "When" Conditions</H2> + The following constants determine when a callback is performed: +<UL> +<LI><TT>FL_WHEN_NEVER</TT> - Never call the callback. </LI> +<LI><TT>FL_WHEN_CHANGED</TT> - Do the callback only when the widget +value changes. </LI> +<LI><TT>FL_WHEN_NOT_CHANGED</TT> - Do the callback whenever the user +interacts with the widget. </LI> +<LI><TT>FL_WHEN_RELEASE</TT> - Do the callback when the button or key +is released and the value changes. </LI> +<LI><TT>FL_WHEN_ENTER_KEY</TT> - Do the callback when the user presses + the ENTER key and the value changes. </LI> +<LI><TT>FL_WHEN_RELEASE_ALWAYS</TT> - Do the callback when the button + or key is released, even if the value doesn't change. </LI> +<LI><TT>FL_WHEN_ENTER_KEY_ALWAYS</TT> - Do the callback when the user + presses the ENTER key, even if the value doesn't change. </LI> +</UL> <H2>Fl::event_key() Values</H2> - -The following constants define the non-ASCII keys on the keyboard for -<tt>FL_KEYBOARD</tt> and <tt>FL_SHORTCUT</tt> events: - -<ul> - - <li><tt>FL_Button</tt> - A mouse button; use <tt>Fl_Button + - n</tt> for mouse button <tt>n</tt>. - - <li><tt>FL_BackSpace</tt> - The backspace key. - - <li><tt>FL_Tab</tt> - The tab key. - - <li><tt>FL_Enter</tt> - The enter key. - - <li><tt>FL_Pause</tt> - The pause key. - - <li><tt>FL_Scroll_Lock</tt> - The scroll lock key. - - <li><tt>FL_Escape</tt> - The escape key. - - <li><tt>FL_Home</tt> - The home key. - - <li><tt>FL_Left</tt> - The left arrow key. - - <li><tt>FL_Up</tt> - The up arrow key. - - <li><tt>FL_Right</tt> - The right arrow key. - - <li><tt>FL_Down</tt> - The down arrow key. - - <li><tt>FL_Page_Up</tt> - The page-up key. - - <li><tt>FL_Page_Down</tt> - The page-down key. - - <li><tt>FL_End</tt> - The end key. - - <li><tt>FL_Print</tt> - The print (or print-screen) key. - - <li><tt>FL_Insert</tt> - The insert key. - - <li><tt>FL_Menu</tt> - The menu key. - - <li><tt>FL_Num_Lock</tt> - The num lock key. - - <li><tt>FL_KP</tt> - One of the keypad numbers; use <tt>FL_KP + - n</tt> for number <tt>n</tt>. - - <li><tt>FL_KP_Enter</tt> - The enter key on the keypad. - - <li><tt>FL_F</tt> - One of the function keys; use <tt>FL_F + - n</tt> for function key <tt>n</tt>. - - <li><tt>FL_Shift_L</tt> - The lefthand shift key. - - <li><tt>FL_Shift_R</tt> - The righthand shift key. - - <li><tt>FL_Control_L</tt> - The lefthand control key. - - <li><tt>FL_Control_R</tt> - The righthand control key. - - <li><tt>FL_Caps_Lock</tt> - The caps lock key. - - <li><tt>FL_Meta_L</tt> - The left meta/Windows key. - - <li><tt>FL_Meta_R</tt> - The right meta/Windows key. - - <li><tt>FL_Alt_L</tt> - The left alt key. - - <li><tt>FL_Alt_R</tt> - The right alt key. - - <li><tt>FL_Delete</tt> - The delete key. - -</ul> - + The following constants define the non-ASCII keys on the keyboard for <TT> +FL_KEYBOARD</TT> and <TT>FL_SHORTCUT</TT> events: +<UL> +<LI><TT>FL_Button</TT> - A mouse button; use <TT>Fl_Button + n</TT> + for mouse button <TT>n</TT>. </LI> +<LI><TT>FL_BackSpace</TT> - The backspace key. </LI> +<LI><TT>FL_Tab</TT> - The tab key. </LI> +<LI><TT>FL_Enter</TT> - The enter key. </LI> +<LI><TT>FL_Pause</TT> - The pause key. </LI> +<LI><TT>FL_Scroll_Lock</TT> - The scroll lock key. </LI> +<LI><TT>FL_Escape</TT> - The escape key. </LI> +<LI><TT>FL_Home</TT> - The home key. </LI> +<LI><TT>FL_Left</TT> - The left arrow key. </LI> +<LI><TT>FL_Up</TT> - The up arrow key. </LI> +<LI><TT>FL_Right</TT> - The right arrow key. </LI> +<LI><TT>FL_Down</TT> - The down arrow key. </LI> +<LI><TT>FL_Page_Up</TT> - The page-up key. </LI> +<LI><TT>FL_Page_Down</TT> - The page-down key. </LI> +<LI><TT>FL_End</TT> - The end key. </LI> +<LI><TT>FL_Print</TT> - The print (or print-screen) key. </LI> +<LI><TT>FL_Insert</TT> - The insert key. </LI> +<LI><TT>FL_Menu</TT> - The menu key. </LI> +<LI><TT>FL_Num_Lock</TT> - The num lock key. </LI> +<LI><TT>FL_KP</TT> - One of the keypad numbers; use <TT>FL_KP + n</TT> + for number <TT>n</TT>. </LI> +<LI><TT>FL_KP_Enter</TT> - The enter key on the keypad. </LI> +<LI><TT>FL_F</TT> - One of the function keys; use <TT>FL_F + n</TT> + for function key <TT>n</TT>. </LI> +<LI><TT>FL_Shift_L</TT> - The lefthand shift key. </LI> +<LI><TT>FL_Shift_R</TT> - The righthand shift key. </LI> +<LI><TT>FL_Control_L</TT> - The lefthand control key. </LI> +<LI><TT>FL_Control_R</TT> - The righthand control key. </LI> +<LI><TT>FL_Caps_Lock</TT> - The caps lock key. </LI> +<LI><TT>FL_Meta_L</TT> - The left meta/Windows key. </LI> +<LI><TT>FL_Meta_R</TT> - The right meta/Windows key. </LI> +<LI><TT>FL_Alt_L</TT> - The left alt key. </LI> +<LI><TT>FL_Alt_R</TT> - The right alt key. </LI> +<LI><TT>FL_Delete</TT> - The delete key. </LI> +</UL> <H2>Fl::event_state() Values</H2> - -The following constants define bits in the <tt>Fl::event_state()</tt> -value: - -<ul> - - <li><tt>FL_SHIFT</tt> - One of the shift keys is down. - - <li><tt>FL_CAPS_LOCK</tt> - The caps lock is on. - - <li><tt>FL_CTRL</tt> - One of the ctrl keys is down. - - <li><tt>FL_ALT</tt> - One of the alt keys is down. - - <li><tt>FL_NUM_LOCK</tt> - The num lock is on. - - <li><tt>FL_META</tt> - One of the meta/Windows keys is down. - - <li><tt>FL_SCROLL_LOCK</tt> - The scroll lock is on. - - <li><tt>FL_BUTTON1</tt> - Mouse button 1 is pushed. - - <li><tt>FL_BUTTON2</tt> - Mouse button 2 is pushed. - - <li><tt>FL_BUTTON3</tt> - Mouse button 3 is pushed. - -</ul> - + The following constants define bits in the <TT>Fl::event_state()</TT> + value: +<UL> +<LI><TT>FL_SHIFT</TT> - One of the shift keys is down. </LI> +<LI><TT>FL_CAPS_LOCK</TT> - The caps lock is on. </LI> +<LI><TT>FL_CTRL</TT> - One of the ctrl keys is down. </LI> +<LI><TT>FL_ALT</TT> - One of the alt keys is down. </LI> +<LI><TT>FL_NUM_LOCK</TT> - The num lock is on. </LI> +<LI><TT>FL_META</TT> - One of the meta/Windows keys is down. </LI> +<LI><TT>FL_SCROLL_LOCK</TT> - The scroll lock is on. </LI> +<LI><TT>FL_BUTTON1</TT> - Mouse button 1 is pushed. </LI> +<LI><TT>FL_BUTTON2</TT> - Mouse button 2 is pushed. </LI> +<LI><TT>FL_BUTTON3</TT> - Mouse button 3 is pushed. </LI> +</UL> <H2>Alignment Values</H2> - -The following constants define bits that can be used with <a -href="#Fl_Widget.align"><tt>Fl_Widget::align()</tt></a> to control the -positioning of the label: - -<ul> - - <li><tt>FL_ALIGN_CENTER</tt> - The label is centered. - - <li><tt>FL_ALIGN_TOP</tt> - The label is top-aligned. - - <li><tt>FL_ALIGN_BOTTOM</tt> - The label is bottom-aligned. - - <li><tt>FL_ALIGN_LEFT</tt> - The label is left-aligned. - - <li><tt>FL_ALIGN_RIGHT</tt> - The label is right-aligned. - - <li><tt>FL_ALIGN_INSIDE</tt> - The label is put inside the widget. - - <li><tt>FL_ALIGN_CLIP</tt> - The label is clipped to the widget. - - <li><tt>FL_ALIGN_WRAP</tt> - The label text is wrapped as needed. - -</ul> - + The following constants define bits that can be used with <A href=Fl_Widget.html#Fl_Widget.align> +<TT>Fl_Widget::align()</TT></A> to control the positioning of the +label: +<UL> +<LI><TT>FL_ALIGN_CENTER</TT> - The label is centered. </LI> +<LI><TT>FL_ALIGN_TOP</TT> - The label is top-aligned. </LI> +<LI><TT>FL_ALIGN_BOTTOM</TT> - The label is bottom-aligned. </LI> +<LI><TT>FL_ALIGN_LEFT</TT> - The label is left-aligned. </LI> +<LI><TT>FL_ALIGN_RIGHT</TT> - The label is right-aligned. </LI> +<LI><TT>FL_ALIGN_INSIDE</TT> - The label is put inside the widget. </LI> +<LI><TT>FL_ALIGN_CLIP</TT> - The label is clipped to the widget. </LI> +<LI><TT>FL_ALIGN_WRAP</TT> - The label text is wrapped as needed. </LI> +</UL> <H2>Fonts</H2> - -The following constants define the standard FLTK fonts: - -</ul> - - <li><tt>FL_HELVETICA</tt> - Helvetica (or Arial) normal. - - <li><tt>FL_HELVETICA_BOLD</tt> - Helvetica (or Arial) bold. - - <li><tt>FL_HELVETICA_ITALIC</tt> - Helvetica (or Arial) oblique. - - <li><tt>FL_HELVETICA_BOLD_ITALIC</tt> - Helvetica (or Arial) bold-oblique. - - <li><tt>FL_COURIER</tt> - Courier normal. - - <li><tt>FL_COURIER_BOLD</tt> - Courier bold. - - <li><tt>FL_COURIER_ITALIC</tt> - Courier italic. - - <li><tt>FL_COURIER_BOLD_ITALIC</tt> - Courier bold-italic. - - <li><tt>FL_TIMES</tt> - Times roman. - - <li><tt>FL_TIMES_BOLD</tt> - Times bold. - - <li><tt>FL_TIMES_ITALIC</tt> - Times italic. - - <li><tt>FL_TIMES_BOLD_ITALIC</tt> - Times bold-italic. - - <li><tt>FL_SYMBOL</tt> - Standard symbol font. - - <li><tt>FL_SCREEN</tt> - Default monospaced screen font. - - <li><tt>FL_SCREEN_BOLD</tt> - Default monospaced bold screen font. - - <li><tt>FL_ZAPF_DINGBATS</tt> - Zapf-dingbats font. - -</ul> - + The following constants define the standard FLTK fonts: +<LI><TT>FL_HELVETICA</TT> - Helvetica (or Arial) normal. </LI> +<LI><TT>FL_HELVETICA_BOLD</TT> - Helvetica (or Arial) bold. </LI> +<LI><TT>FL_HELVETICA_ITALIC</TT> - Helvetica (or Arial) oblique. </LI> +<LI><TT>FL_HELVETICA_BOLD_ITALIC</TT> - Helvetica (or Arial) +bold-oblique. </LI> +<LI><TT>FL_COURIER</TT> - Courier normal. </LI> +<LI><TT>FL_COURIER_BOLD</TT> - Courier bold. </LI> +<LI><TT>FL_COURIER_ITALIC</TT> - Courier italic. </LI> +<LI><TT>FL_COURIER_BOLD_ITALIC</TT> - Courier bold-italic. </LI> +<LI><TT>FL_TIMES</TT> - Times roman. </LI> +<LI><TT>FL_TIMES_BOLD</TT> - Times bold. </LI> +<LI><TT>FL_TIMES_ITALIC</TT> - Times italic. </LI> +<LI><TT>FL_TIMES_BOLD_ITALIC</TT> - Times bold-italic. </LI> +<LI><TT>FL_SYMBOL</TT> - Standard symbol font. </LI> +<LI><TT>FL_SCREEN</TT> - Default monospaced screen font. </LI> +<LI><TT>FL_SCREEN_BOLD</TT> - Default monospaced bold screen font. </LI> +<LI><TT>FL_ZAPF_DINGBATS</TT> - Zapf-dingbats font. <H2>Colors</H2> - -The following color constants can be used to access the colors in the FLTK -standard color palette: - -<ul> - - <li><tt>FL_BLACK</tt> - - <li><tt>FL_RED</tt> - - <li><tt>FL_GREEN</tt> - - <li><tt>FL_YELLOW</tt> - - <li><tt>FL_BLUE</tt> - - <li><tt>FL_MAGENTA</tt> - - <li><tt>FL_CYAN</tt> - - <li><tt>FL_WHITE</tt> - - <li><tt>FL_GRAY0</tt> - - <li><tt>FL_DARK3</tt> - - <li><tt>FL_DARK2</tt> - - <li><tt>FL_DARK1</tt> - - <li><tt>FL_GRAY</tt> - - <li><tt>FL_LIGHT1</tt> - - <li><tt>FL_LIGHT2</tt> - - <li><tt>FL_LIGHT3</tt> - -</ul> - + The following color constants can be used to access the colors in the +FLTK standard color palette: +<UL> +<LI><TT>FL_BLACK</TT></LI> +<LI><TT>FL_RED</TT></LI> +<LI><TT>FL_GREEN</TT></LI> +<LI><TT>FL_YELLOW</TT></LI> +<LI><TT>FL_BLUE</TT></LI> +<LI><TT>FL_MAGENTA</TT></LI> +<LI><TT>FL_CYAN</TT></LI> +<LI><TT>FL_WHITE</TT></LI> +<LI><TT>FL_GRAY0</TT></LI> +<LI><TT>FL_DARK3</TT></LI> +<LI><TT>FL_DARK2</TT></LI> +<LI><TT>FL_DARK1</TT></LI> +<LI><TT>FL_GRAY</TT></LI> +<LI><TT>FL_LIGHT1</TT></LI> +<LI><TT>FL_LIGHT2</TT></LI> +<LI><TT>FL_LIGHT3</TT></LI> +</UL> <H2>Cursors</H2> - -The following constants define the mouse cursors that are available in -FLTK: - -<ul> - <li><tt>FL_CURSOR_DEFAULT</tt> - the default cursor, usually an arrow - <li><tt>FL_CURSOR_ARROW</tt> - an arrow pointer - <li><tt>FL_CURSOR_CROSS</tt> - crosshair - <li><tt>FL_CURSOR_WAIT</tt> - watch or hourglass - <li><tt>FL_CURSOR_INSERT</tt> - I-beam - <li><tt>FL_CURSOR_HAND</tt> - hand (uparrow on MSWindows) - <li><tt>FL_CURSOR_HELP</tt> - question mark - <li><tt>FL_CURSOR_MOVE</tt> - 4-pointed arrow - <li><tt>FL_CURSOR_NS</tt> - up/down arrow - <li><tt>FL_CURSOR_WE</tt> - left/right arrow - <li><tt>FL_CURSOR_NWSE</tt> - diagonal arrow - <li><tt>FL_CURSOR_NESW</tt> - diagonal arrow - <li><tt>FL_CURSOR_NONE</tt> - invisible -</ul> - -<H2>FD "When" Conditions</H2> - -<ul> - - <li><tt>FL_READ</tt> - Call the callback when there is data to be - read. - - <li><tt>FL_WRITE</tt> - Call the callback when data can be written - without blocking. - - <li><tt>FL_EXCEPT</tt> - Call the callback if an exception occurs on - the file. - -</ul> - + The following constants define the mouse cursors that are available in +FLTK: +<UL> +<LI><TT>FL_CURSOR_DEFAULT</TT> - the default cursor, usually an arrow </LI> +<LI><TT>FL_CURSOR_ARROW</TT> - an arrow pointer </LI> +<LI><TT>FL_CURSOR_CROSS</TT> - crosshair </LI> +<LI><TT>FL_CURSOR_WAIT</TT> - watch or hourglass </LI> +<LI><TT>FL_CURSOR_INSERT</TT> - I-beam </LI> +<LI><TT>FL_CURSOR_HAND</TT> - hand (uparrow on MSWindows) </LI> +<LI><TT>FL_CURSOR_HELP</TT> - question mark </LI> +<LI><TT>FL_CURSOR_MOVE</TT> - 4-pointed arrow </LI> +<LI><TT>FL_CURSOR_NS</TT> - up/down arrow </LI> +<LI><TT>FL_CURSOR_WE</TT> - left/right arrow </LI> +<LI><TT>FL_CURSOR_NWSE</TT> - diagonal arrow </LI> +<LI><TT>FL_CURSOR_NESW</TT> - diagonal arrow </LI> +<LI><TT>FL_CURSOR_NONE</TT> - invisible </LI> +</UL> +<H2>FD "When" Conditions</H2> +<UL> +<LI><TT>FL_READ</TT> - Call the callback when there is data to be + read. </LI> +<LI><TT>FL_WRITE</TT> - Call the callback when data can be written + without blocking. </LI> +<LI><TT>FL_EXCEPT</TT> - Call the callback if an exception occurs on + the file. </LI> +</UL> <H2>Damage Masks</H2> - -The following damage mask bits are used by the standard FLTK widgets: - -<ul> - - <li><tt>FL_DAMAGE_CHILD</tt> - A child needs to be redrawn. - - <li><tt>FL_DAMAGE_EXPOSE</tt> - The window was exposed. - - <li><tt>FL_DAMAGE_SCROLL</tt> - The <tt>Fl_Scroll</tt> widget was - scrolled. - - <li><tt>FL_DAMAGE_OVERLAY</tt> - The overlay planes need to be redrawn. - - <li><tt>FL_DAMAGE_ALL</tt> - Everything needs to be redrawn. - -</ul> - -</BODY> -</HTML> + The following damage mask bits are used by the standard FLTK widgets: +<UL> +<LI><TT>FL_DAMAGE_CHILD</TT> - A child needs to be redrawn. </LI> +<LI><TT>FL_DAMAGE_EXPOSE</TT> - The window was exposed. </LI> +<LI><TT>FL_DAMAGE_SCROLL</TT> - The <TT>Fl_Scroll</TT> widget was + scrolled. </LI> +<LI><TT>FL_DAMAGE_OVERLAY</TT> - The overlay planes need to be redrawn. </LI> +<LI><TT>FL_DAMAGE_ALL</TT> - Everything needs to be redrawn. </LI> +</UL> +</LI> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/events.html b/documentation/events.html index c9471ae25..3b62864b5 100644 --- a/documentation/events.html +++ b/documentation/events.html @@ -1,139 +1,96 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="events">6 - Handling Events</A></H1> - -This chapter discusses the FLTK event model and how to handle events in your program or -widget. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=events>6 - Handling Events</A></H1> + This chapter discusses the FLTK event model and how to handle events +in your program or widget. <H2>The FLTK Event Model</H2> - -Events are identified by the integer argument passed to the <a -href="#handle"><tt>Fl_Widget::handle()</tt></a> virtual method. Other -information about the most recent event is stored in static locations -and acquired by calling the <a -href="#event_xxx"><tt>Fl::event_*()</tt></a> methods. This static -information remains valid until the next event is read from window -system (i.e. it is ok to look at it outside of the <tt>handle()</tt> method). - + Events are identified by the integer argument passed to the <A href=functions.html#handle> +<TT>Fl_Widget::handle()</TT></A> virtual method. Other information +about the most recent event is stored in static locations and acquired +by calling the <A href=#event_xxx><TT>Fl::event_*()</TT></A> methods. +This static information remains valid until the next event is read from +window system (i.e. it is ok to look at it outside of the <TT>handle()</TT> + method). <H2>Mouse Events</H2> - -<h3>FL_PUSH</h3> - -A mouse button has gone down with the mouse pointing at this widget. -You can find out what button by calling <a -href="#event_button"><tt>Fl::event_button()</tt></a>. You find out the -mouse position by calling <a href="#event_x"><tt>Fl::event_x()</tt></a> -and <a href="#event_y"><tt>Fl::event_y()</tt></a>. - -<p>A widget indicates that it "wants" the mouse click by returning -non-zero from its <a href="#handle"><tt>handle()</tt></a> method. It -will then become the <a href="#pushed"><tt>Fl::pushed()</tt></a> widget -and will get <tt>FL_DRAG</tt> and the matching <tt>FL_RELEASE</tt> -events. If <tt>handle()</tt> returns zero then FLTK will try sending -the <tt>FL_PUSH</tt> to another widget. - -<h3>FL_DRAG</h3> - -The mouse has moved with a button held down. - -<h3>FL_RELEASE</h3> - -A mouse button has been released. You can find out what button by -calling <a href="#event_button"><tt>Fl::event_button()</tt></a>. - -<h3>FL_MOVE</h3> - -The mouse has moved without any mouse buttons held down. This event -is sent to the <tt>belowmouse()</tt> widget. - +<H3>FL_PUSH</H3> + A mouse button has gone down with the mouse pointing at this widget. +You can find out what button by calling <A href=#event_button><TT> +Fl::event_button()</TT></A>. You find out the mouse position by +calling <A href=#event_x><TT>Fl::event_x()</TT></A> and <A href=functions.html#event_y> +<TT>Fl::event_y()</TT></A>. +<P>A widget indicates that it "wants" the mouse click by returning +non-zero from its <A href=functions.html#handle><TT>handle()</TT></A> + method. It will then become the <A href=functions.html#pushed><TT> +Fl::pushed()</TT></A> widget and will get <TT>FL_DRAG</TT> and the +matching <TT>FL_RELEASE</TT> events. If <TT>handle()</TT> returns zero +then FLTK will try sending the <TT>FL_PUSH</TT> to another widget. </P> +<H3>FL_DRAG</H3> + The mouse has moved with a button held down. +<H3>FL_RELEASE</H3> + A mouse button has been released. You can find out what button by +calling <A href=#event_button><TT>Fl::event_button()</TT></A>. +<H3>FL_MOVE</H3> + The mouse has moved without any mouse buttons held down. This event +is sent to the <TT>belowmouse()</TT> widget. <H2>Focus Events</H2> - -<h3>FL_ENTER</h3> - -The mouse has been moved to point at this widget. This can be used for -highlighting feedback. If a widget wants to highlight or otherwise -track the mouse, it indicates this by returning non-zero from its <a -href="#handle"><tt>handle()</tt></a> method. It then becomes the <a -href="#belowmouse"><tt>Fl::belowmouse()</tt></a> widget and will -receive <tt>FL_MOVE</tt> and <tt>FL_LEAVE</tt> events. - -<h3>FL_LEAVE</h3> - -The mouse has moved out of the widget. - -<h3>FL_FOCUS</h3> - -This indicates an <i>attempt</i> to give a widget the keyboard -focus. - -<p>If a widget wants the focus, it should change itself to display the -fact that it has the focus, and return non-zero from its <a -href="#handle"><tt>handle()</tt></a> method. It then becomes the <a -href="#focus"><tt>Fl::focus()</tt></a> widget and gets <tt>FL_KEYBOARD</tt> -and <tt>FL_UNFOCUS</tt> events. - -<p>The focus will change either because the window manager changed -which window gets the focus, or because the user tried to navigate -using tab, arrows, or other keys. You can check <a -href="#event_key"><tt>Fl::event_key()</tt></a> to figure out why it moved. For -navigation it will be the key pressed and for instructions from the -window manager it will be zero. - -<h3>FL_UNFOCUS</h3> - -Sent to the previous <a href="#focus"><tt>Fl::focus()</tt></a> when -another widget gets the focus. - +<H3>FL_ENTER</H3> + The mouse has been moved to point at this widget. This can be used +for highlighting feedback. If a widget wants to highlight or otherwise +track the mouse, it indicates this by returning non-zero from its <A href=functions.html#handle> +<TT>handle()</TT></A> method. It then becomes the <A href=functions.html#belowmouse> +<TT>Fl::belowmouse()</TT></A> widget and will receive <TT>FL_MOVE</TT> + and <TT>FL_LEAVE</TT> events. +<H3>FL_LEAVE</H3> + The mouse has moved out of the widget. +<H3>FL_FOCUS</H3> + This indicates an <I>attempt</I> to give a widget the keyboard focus. +<P>If a widget wants the focus, it should change itself to display the +fact that it has the focus, and return non-zero from its <A href=functions.html#handle> +<TT>handle()</TT></A> method. It then becomes the <A href=functions.html#focus> +<TT>Fl::focus()</TT></A> widget and gets <TT>FL_KEYBOARD</TT> and <TT> +FL_UNFOCUS</TT> events. </P> +<P>The focus will change either because the window manager changed +which window gets the focus, or because the user tried to navigate +using tab, arrows, or other keys. You can check <A href=functions.html#event_key> +<TT>Fl::event_key()</TT></A> to figure out why it moved. For +navigation it will be the key pressed and for instructions from the +window manager it will be zero. </P> +<H3>FL_UNFOCUS</H3> + Sent to the previous <A href=functions.html#focus><TT>Fl::focus()</TT></A> + when another widget gets the focus. <H2>Keyboard Events</H2> - -<h3>FL_KEYBOARD</h3> - -A key press. The key pressed can be found in <a -href="#event_key"><tt>Fl::event_key()</tt></a>. The text that the key -should insert can be found with <a -href="#event_text"><tt>Fl::event_text()</tt></a> and its length is in -<a href="#event_length"><tt>Fl::event_length()</tt></a>. If you use -the key <tt>handle()</tt> should return 1. If you return zero then -FLTK assummes you ignored the key. It will then attempt to send it to -a parent widget. If none of them want it, it will change the event into -a <tt>FL_SHORTCUT</tt> event. - -<h3>FL_SHORTCUT</h3> - -If the <a href="#focus"><tt>Fl::focus()</tt></a> is zero or ignores an -<tt>FL_KEYBOARD</tt> event then FLTK tries sending this event to every -widget it can, until one of them returns non-zero. -<tt>FL_SHORTCUT</tt> is first sent to the <tt>belowmouse()</tt> widget, -then its parents and siblings, and eventually to every widget in the -window, trying to find an object that returns non-zero. FLTK tries -really hard to not to ignore any keystrokes! - -<p>You can also make "global" shortcuts by using <a -href="#add_handler"><tt>Fl::add_handler()</tt></a>. A global shortcut -will work no matter what windows are displayed or which one has the -focus. - +<H3>FL_KEYBOARD</H3> + A key press. The key pressed can be found in <A href=functions.html#event_key> +<TT>Fl::event_key()</TT></A>. The text that the key should insert can +be found with <A href=functions.html#event_text><TT>Fl::event_text()</TT> +</A> and its length is in <A href=functions.html#event_length><TT> +Fl::event_length()</TT></A>. If you use the key <TT>handle()</TT> + should return 1. If you return zero then FLTK assummes you ignored +the key. It will then attempt to send it to a parent widget. If none +of them want it, it will change the event into a <TT>FL_SHORTCUT</TT> + event. +<H3>FL_SHORTCUT</H3> + If the <A href=functions.html#focus><TT>Fl::focus()</TT></A> is zero +or ignores an <TT>FL_KEYBOARD</TT> event then FLTK tries sending this +event to every widget it can, until one of them returns non-zero. <TT> +FL_SHORTCUT</TT> is first sent to the <TT>belowmouse()</TT> widget, +then its parents and siblings, and eventually to every widget in the +window, trying to find an object that returns non-zero. FLTK tries +really hard to not to ignore any keystrokes! +<P>You can also make "global" shortcuts by using <A href=osissues.html#add_handler> +<TT>Fl::add_handler()</TT></A>. A global shortcut will work no matter +what windows are displayed or which one has the focus. </P> <H2>Widget Events</H2> - -<h3>FL_DEACTIVATE</h3> - -This widget is no longer active, due to <a -href="#Fl_Widget.deactivate"><tt>deactivate()</tt></a> being called on -it or one of its parents. <tt>active()</tt> may still be true after this, the -widget is only active if <tt>active()</tt> is true on it and all its parents -(use <tt>active_r()</tt> to check this). - -<h3>FL_ACTIVATE</h3> - -This widget is now active, due to <a -href="#Fl_Widget.activate"><tt>activate()</tt></a> being called on it -or one of its parents. - -<h3>FL_HIDE</h3> - -This widget is no longer visible, due to <a -href="#Fl_Widget.hide><tt>hide()</tt></a> being called on it or one of its +<H3>FL_DEACTIVATE</H3> + This widget is no longer active, due to <A href=Fl_Widget.html#Fl_Widget.deactivate> +<TT>deactivate()</TT></A> being called on it or one of its parents. <TT> +active()</TT> may still be true after this, the widget is only active +if <TT>active()</TT> is true on it and all its parents (use <TT> +active_r()</TT> to check this). +<H3>FL_ACTIVATE</H3> + This widget is now active, due to <A href=Fl_Widget.html#Fl_Widget.activate> +<TT>activate()</TT></A> being called on it or one of its parents. +<H3>FL_HIDE</H3> + This widget is no longer visible, due to <A #Fl_Widget.show" href="#Fl_Widget.hide><tt>hide()</tt></a> being called on it or one of its parents, or due to a parent window being minimized. <tt>visible()</tt> may still be true after this, but the widget is visible only if <tt>visible()</tt> is true for it and all its parents (use @@ -142,84 +99,71 @@ may still be true after this, but the widget is visible only if <h3>FL_SHOW</h3> This widget is visible again, due to <a -href="#Fl_Widget.show"><tt>show()</tt></a> being called on it or one of -its parents, or due to a parent window being restored. <i>Child -<tt>Fl_Window</tt>s respond to this by actually creating the window if not -done already, so if you subclass a window, be sure to pass <tt>FL_SHOW</tt> to -the base class <tt>handle()</tt> method!</i> - +href="> +<TT>show()</TT></A> being called on it or one of its parents, or due to +a parent window being restored. <I>Child <TT>Fl_Window</TT>s respond to +this by actually creating the window if not done already, so if you +subclass a window, be sure to pass <TT>FL_SHOW</TT> to the base class <TT> +handle()</TT> method!</I> <H2>Clipboard Events</H2> - -<h3>FL_PASTE</h3> - -You should get this event some time after you call <a -href="#paste"><tt>Fl::paste()</tt></a>. The contents of <a -href="#event_text"><tt>Fl::event_text()</tt></a> is the text to insert -and the number of characters is in <a -href="#event_length"><tt>Fl::event_length()</tt></a>. - -<h3>FL_SELECTIONCLEAR</h3> - -The <a href="#selection_owner">Fl::selection_owner()</a> will get this -event before the selection is moved to another widget. This indicates -that some other widget or program has claimed the selection. - -<h2><a name="event_xxx">Fl::event_*() methods</a></h2> - -FLTK keeps the information about the most recent event in static -storage. This information is good until the next event is processed. -Thus it is valid inside <tt>handle()</tt> and <tt>callback()</tt> methods. - -<p>These are all trivial inline functions and thus very fast and -small: - -<ul> - <li><a name="event_button">Fl::event_button</a> - <li><a name="event_clicks">Fl::event_clicks</a> - <li><a name="event_inside">Fl::event_inside</a> - <li><a name="event_is_click">Fl::event_is_click</a> - <li><a name="event_key">Fl::event_key</a> - <li><a name="event_length">Fl::event_length</a> - <li><a name="event_state">Fl::event_state</a> - <li><a name="event_text">Fl::event_text</a> - <li><a name="event_x">Fl::event_x</a> - <li><a name="event_x_root">Fl::event_x_root</a> - <li><a name="event_y">Fl::event_y</a> - <li><a name="event_y_root">Fl::event_y_root</a> - <li><a name="get_key">Fl::get_key</a> - <li><a name="get_mouse">Fl::get_mouse</a> - <li><a name="test_shortcut">Fl::test_shortcut</a> -</ul> - -<h2><a name="propagation">Event Propagation</a></h2> - -FLTK follows very simple and unchangeable rules for sending events. The -major innovation is that widgets can indicate (by returning 0 from the -<tt>handle()</tt> method) that they are not interested in an event, and -FLTK can then send that event elsewhere. This eliminates the need for -"interests" (event masks or tables), and this is probably the main -reason FLTK is much smaller than other toolkits. - -<p>Most events are sent directly to the <tt>handle()</tt> method of the -<tt>Fl_Window</tt> that the window system says they belong to. The -window (actually the <tt>Fl_Group</tt> that <tt>Fl_Window</tt> is a -subclass of) is responsible for sending the events on to any child -widgets. To make the <tt>Fl_Group</tt> code somewhat easier, FLTK -sends some events (<tt>FL_DRAG</tt>, <tt>FL_RELEASE</tt>, -<tt>FL_KEYBOARD</tt>, <tt>FL_SHORTCUT</tt>, <tt>FL_UNFOCUS</tt>, and -<tt>FL_LEAVE</tt>) directly to leaf widgets. These procedures control -those leaf widgets: - -<ul> - <li><a href="#add_handler">Fl::add_handler</a> - <li><a href="#belowmouse">Fl::belowmouse</a> - <li><a href="#focus">Fl::focus</a> - <li><a href="#grab">Fl::grab</a> - <li><a href="#modal">Fl::modal</a> - <li><a href="#pushed">Fl::pushed</a> - <li><a href="#release">Fl::release</a> - <li><a href="#Fl_Widget.take_focus">Fl_Widget::take_focus</a> -</ul> - -</BODY> -</HTML> +<H3>FL_PASTE</H3> + You should get this event some time after you call <A href=functions.html#paste> +<TT>Fl::paste()</TT></A>. The contents of <A href=functions.html#event_text> +<TT>Fl::event_text()</TT></A> is the text to insert and the number of +characters is in <A href=functions.html#event_length><TT> +Fl::event_length()</TT></A>. +<H3>FL_SELECTIONCLEAR</H3> + The <A href=functions.html#selection_owner>Fl::selection_owner()</A> + will get this event before the selection is moved to another widget. + This indicates that some other widget or program has claimed the +selection. +<H2><A name=event_xxx>Fl::event_*() methods</A></H2> + FLTK keeps the information about the most recent event in static +storage. This information is good until the next event is processed. +Thus it is valid inside <TT>handle()</TT> and <TT>callback()</TT> + methods. +<P>These are all trivial inline functions and thus very fast and small: </P> +<UL> +<LI><A name=event_button>Fl::event_button</A></LI> +<LI><A name=event_clicks>Fl::event_clicks</A></LI> +<LI><A name=event_inside>Fl::event_inside</A></LI> +<LI><A name=event_is_click>Fl::event_is_click</A></LI> +<LI><A name=event_key>Fl::event_key</A></LI> +<LI><A name=event_length>Fl::event_length</A></LI> +<LI><A name=event_state>Fl::event_state</A></LI> +<LI><A name=event_text>Fl::event_text</A></LI> +<LI><A name=event_x>Fl::event_x</A></LI> +<LI><A name=event_x_root>Fl::event_x_root</A></LI> +<LI><A name=event_y>Fl::event_y</A></LI> +<LI><A name=event_y_root>Fl::event_y_root</A></LI> +<LI><A name=get_key>Fl::get_key</A></LI> +<LI><A name=get_mouse>Fl::get_mouse</A></LI> +<LI><A name=test_shortcut>Fl::test_shortcut</A></LI> +</UL> +<H2><A name=propagation>Event Propagation</A></H2> + FLTK follows very simple and unchangeable rules for sending events. +The major innovation is that widgets can indicate (by returning 0 from +the <TT>handle()</TT> method) that they are not interested in an event, +and FLTK can then send that event elsewhere. This eliminates the need +for "interests" (event masks or tables), and this is probably the main +reason FLTK is much smaller than other toolkits. +<P>Most events are sent directly to the <TT>handle()</TT> method of the <TT> +Fl_Window</TT> that the window system says they belong to. The window +(actually the <TT>Fl_Group</TT> that <TT>Fl_Window</TT> is a subclass +of) is responsible for sending the events on to any child widgets. To +make the <TT>Fl_Group</TT> code somewhat easier, FLTK sends some events +(<TT>FL_DRAG</TT>, <TT>FL_RELEASE</TT>, <TT>FL_KEYBOARD</TT>, <TT> +FL_SHORTCUT</TT>, <TT>FL_UNFOCUS</TT>, and <TT>FL_LEAVE</TT>) directly +to leaf widgets. These procedures control those leaf widgets: </P> +<UL> +<LI><A href=osissues.html#add_handler>Fl::add_handler</A></LI> +<LI><A href=functions.html#belowmouse>Fl::belowmouse</A></LI> +<LI><A href=functions.html#focus>Fl::focus</A></LI> +<LI><A href=functions.html#grab>Fl::grab</A></LI> +<LI><A href=functions.html#modal>Fl::modal</A></LI> +<LI><A href=functions.html#pushed>Fl::pushed</A></LI> +<LI><A href=functions.html#release>Fl::release</A></LI> +<LI><A href=Fl_Widget.html#Fl_Widget.take_focus>Fl_Widget::take_focus</A> +</LI> +</UL> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/fluid.html b/documentation/fluid.html index c54a8c3e0..fc6519cbd 100644 --- a/documentation/fluid.html +++ b/documentation/fluid.html @@ -1,151 +1,104 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="FLUID">8 - Programming with FLUID</A></H1> - -This chapter shows how to use the Fast Light User-Interface Designer ("FLUID") to create -your GUIs. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=FLUID>8 - Programming with FLUID</A></H1> + This chapter shows how to use the Fast Light User-Interface Designer +("FLUID") to create your GUIs. <H2>What is FLUID?</H2> - -The Fast Light User Interface Designer, or "FLUID", is a graphical -editor that is used to produce FLTK source code. - -<p>FLUID edits and saves its state in ".fl" files. These files are -text, and you can (with care) edit them in a text editor, perhaps to -get some special effects. - -<p>FLUID can "compile" the .fl file into a .cxx and a .h file. The .cxx -file defines all the objects from the .fl file and the .h file -declares all the global ones. - -<p>A simple program can be made by putting all your code (including a -<tt>main()</tt> function) into the .fl file and thus making the .cxx -file a single source file to compile. Most programs are more complex -than this, so you write other .cxx files that call the FLUID -functions. These .cxx files must <tt>#include</tt> the .h file or -they can <tt>#include</tt> the .cxx file so it still appears to be a single -source file. - -<center><img src=fluid-org.gif></center> - -<p>Normally the FLUID file defines one or more "functions", which -output C++ functions. Each function defines a one or more FLTK -windows, and all the widgets that go inside those windows. - -<p>Widgets created by FLUID are either "named", "complex named" or -"unnamed". A named widget has a legal C++ variable identifier as its -name (i.e. only alphanumeric and underscore). In this case FLUID -defines a global variable or class member that will point at the widget -after the function defining it is called. A "complex named" object has -punctuation such as '.' or '->' or any other symbols in its name. In -this case FLUID assigns a pointer to the widget to the name, but does -not attempt to declare it. This can be used to get the widgets into -structures. An "unnamed" widget has a blank name and no pointer to -them is stored. - -<p>Widgets may either call a named callback function that you write in -another source file, or you can supply a small piece of C++ source and -FLUID will write a private callback function into the .cxx file. - -<h2>A Short Tutorial</h2> - -<ol> - - <li>Type "FLUID&" - - <li>Pick "New/code/function" off the menu. - - <li>Hit Tab, Delete to delete the function name and hit OK. This is - how you get FLUID to output a "main()" function. The text "main()" - with a triangle next to it should appear highlighted in the main - window. - - <li>Pick "New/group/Window" off the menu. - - <li>Move the new window and resize it to the size you want. - - <li>Pick "New/buttons/Button" off the menu. - - <li>Hit the "OK" button to dismiss the panel that appears. - - <li>In the window you created, try moving the button by dragging it - around. Notice that it "snaps" to fixed locations. If you want to - drag it smoothly, hold down Alt. You can also change the size of the - steps with Edit/Preferences. - - <li>Try resizing the widget by dragging the edges and corners. - - <li>Type Alt+c to copy the widget. - - <li>Type Alt+v to paste a copy into the window. - - <li>Type Alt+v several times. - - <li>Drag the widgets and resize them so they don't overlap. Notice - that you have to click a widget to pick it first, then drag it. - - <li>Try selecting several widgets by dragging a box around them. Check - what happens when you move them, or when you drag an edge to resize - them. - - <li>You can also use Shift+click to toggle widgets on and off. - - <li>You can also select widgets by clicking on them in the list in the - main window, try that. - - <li>Double-click one of the widgets. You will get a control panel. - - <li>Try changing the "label". Try changing other items near the top of - the panel. To see any changes to the box type clearer, type "Alt+o" - to make the red overlay disappear. - - <li>Type "#include <stdlib.h>" into the first line of "extra code:". - - <li>Type "exit(0);" into the "callback:". - - <li>Hit OK. - - <li>Pick "File/Save As" off the menu. - - <li>Type "test.fl" into the file chooser and hit return. - - <li>Pick "File/Write Code" off the menu, hit OK on the confirmation panel. - - <li>Go back to your terminal window. Type "more test.cxx" and "more - test.h" and you can see the code it made. Also try "more test.fl" to - see how FLUID saves its data. - - <li>Type "make test" (you may have to add libaries to your Makefile). - - <li>Type "./test" to run your program. - - <li>Try the buttons. The one you put the code into will exit the - program. - - <li>Type "Alt+Q" to exit FLUID. - - <li>Ok, now try to make a real program. - -</ol> - -<h2>Running FLUID Under UNIX</h2> - -To run FLUID under UNIX, type: - -<ul><pre> -fluid <i>filename.fl</i> & -</pre></ul> - -to edit the .fl file <i>filename.fl</i>. If the file does not exist -you will get an error pop-up, but if you dismiss it you will be editing -a blank file of that name. You can run FLUID without any name, in -which case you will be editing an unnamed blank setup (but you can use -save-as to write it to a file). - -<p>You can provide any of the standard FLTK switches before the name: - -<ul><pre> + The Fast Light User Interface Designer, or "FLUID", is a graphical +editor that is used to produce FLTK source code. +<P>FLUID edits and saves its state in ".fl" files. These files are +text, and you can (with care) edit them in a text editor, perhaps to +get some special effects. </P> +<P>FLUID can "compile" the .fl file into a .cxx and a .h file. The +.cxx file defines all the objects from the .fl file and the .h file +declares all the global ones. </P> +<P>A simple program can be made by putting all your code (including a <TT> +main()</TT> function) into the .fl file and thus making the .cxx file a +single source file to compile. Most programs are more complex than +this, so you write other .cxx files that call the FLUID functions. + These .cxx files must <TT>#include</TT> the .h file or they can <TT> +#include</TT> the .cxx file so it still appears to be a single source +file. +<CENTER><IMG src=./fluid-org.gif></CENTER> +</P> +<P>Normally the FLUID file defines one or more "functions", which +output C++ functions. Each function defines a one or more FLTK +windows, and all the widgets that go inside those windows. </P> +<P>Widgets created by FLUID are either "named", "complex named" or +"unnamed". A named widget has a legal C++ variable identifier as its +name (i.e. only alphanumeric and underscore). In this case FLUID +defines a global variable or class member that will point at the widget +after the function defining it is called. A "complex named" object has +punctuation such as '.' or '->' or any other symbols in its name. In +this case FLUID assigns a pointer to the widget to the name, but does +not attempt to declare it. This can be used to get the widgets into +structures. An "unnamed" widget has a blank name and no pointer to +them is stored. </P> +<P>Widgets may either call a named callback function that you write in +another source file, or you can supply a small piece of C++ source and +FLUID will write a private callback function into the .cxx file. </P> +<H2>A Short Tutorial</H2> +<OL> +<LI>Type "FLUID" </LI> +<LI>Pick "New/code/function" off the menu. </LI> +<LI>Hit Tab, Delete to delete the function name and hit OK. This is + how you get FLUID to output a "main()" function. The text "main()" + with a triangle next to it should appear highlighted in the main + window. </LI> +<LI>Pick "New/group/Window" off the menu. </LI> +<LI>Move the new window and resize it to the size you want. </LI> +<LI>Pick "New/buttons/Button" off the menu. </LI> +<LI>Hit the "OK" button to dismiss the panel that appears. </LI> +<LI>In the window you created, try moving the button by dragging it + around. Notice that it "snaps" to fixed locations. If you want to + drag it smoothly, hold down Alt. You can also change the size of the + steps with Edit/Preferences. </LI> +<LI>Try resizing the widget by dragging the edges and corners. </LI> +<LI>Type Alt+c to copy the widget. </LI> +<LI>Type Alt+v to paste a copy into the window. </LI> +<LI>Type Alt+v several times. </LI> +<LI>Drag the widgets and resize them so they don't overlap. Notice + that you have to click a widget to pick it first, then drag it. </LI> +<LI>Try selecting several widgets by dragging a box around them. Check + what happens when you move them, or when you drag an edge to resize + them. </LI> +<LI>You can also use Shift+click to toggle widgets on and off. </LI> +<LI>You can also select widgets by clicking on them in the list in the + main window, try that. </LI> +<LI>Double-click one of the widgets. You will get a control panel. </LI> +<LI>Try changing the "label". Try changing other items near the top of + the panel. To see any changes to the box type clearer, type "Alt+o" + to make the red overlay disappear. </LI> +<LI>Type "#include <stdlib.h>" into the first line of "extra code:". </LI> +<LI>Type "exit(0);" into the "callback:". </LI> +<LI>Hit OK. </LI> +<LI>Pick "File/Save As" off the menu. </LI> +<LI>Type "test.fl" into the file chooser and hit return. </LI> +<LI>Pick "File/Write Code" off the menu, hit OK on the confirmation +panel. </LI> +<LI>Go back to your terminal window. Type "more test.cxx" and "more + test.h" and you can see the code it made. Also try "more test.fl" to + see how FLUID saves its data. </LI> +<LI>Type "make test" (you may have to add libaries to your Makefile). </LI> +<LI>Type "./test" to run your program. </LI> +<LI>Try the buttons. The one you put the code into will exit the + program. </LI> +<LI>Type "Alt+Q" to exit FLUID. </LI> +<LI>Ok, now try to make a real program. </LI> +</OL> +<H2>Running FLUID Under UNIX</H2> + To run FLUID under UNIX, type: +<UL> +<PRE> +fluid <I>filename.fl</I> </PRE> +</UL> + to edit the .fl file <I>filename.fl</I>. If the file does not exist +you will get an error pop-up, but if you dismiss it you will be editing +a blank file of that name. You can run FLUID without any name, in +which case you will be editing an unnamed blank setup (but you can use +save-as to write it to a file). +<P>You can provide any of the standard FLTK switches before the name: </P> +<UL> +<PRE> -display host:n.n -geometry WxH+X+Y -title windowtitle @@ -154,696 +107,495 @@ save-as to write it to a file). -fg color -bg color -bg2 color -</pre></ul> - -Changing the colors may be useful to see what your interface will -look at if the user calls it with the same switches. - -<p>In the current version, if you don't go into the background (with -'&') then you will be able to abort FLUID by typing ^C on the terminal. -It will exit immediately, losing any changes. - -<h2>Running FLUID Under Microsoft Windows</h2> - -To run FLUID under windows, double-click on the <i>fluid.exe</i> file. -You can also run FLUID from the </i>Command Prompt</i> window (FLUID -always runs in the background). - -<h2>Compiling .fl files</h2> - -FLUID can also be called as a command-line "compiler" to create the -.cxx and .h file from a .fl file. To do this type: - -<ul><pre> - FLUID -c <i>filename.fl</i> -</pre></ul> - -This will read the .fl file and write <i>filename.cxx</i> and -<i>filename.h</i>. The directory will be stripped, so they are written to -the current directory always. If there are any errors -reading or writing the files it will print the error and exit with a -non-zero code. In a makefile you can use a line like this: -work: - -<ul><pre> +</PRE> +</UL> + Changing the colors may be useful to see what your interface will look +at if the user calls it with the same switches. +<P>In the current version, if you don't go into the background (with +'then you will be able to abort FLUID by typing ^C on the terminal. It +will exit immediately, losing any changes. </P> +<H2>Running FLUID Under Microsoft Windows</H2> + To run FLUID under windows, double-click on the <I>fluid.exe</I> file. +You can also run FLUID from the Command Prompt window (FLUID always +runs in the background). +<H2>Compiling .fl files</H2> + FLUID can also be called as a command-line "compiler" to create the +.cxx and .h file from a .fl file. To do this type: +<UL> +<PRE> + FLUID -c <I>filename.fl</I> +</PRE> +</UL> + This will read the .fl file and write <I>filename.cxx</I> and <I> +filename.h</I>. The directory will be stripped, so they are written to +the current directory always. If there are any errors reading or +writing the files it will print the error and exit with a non-zero +code. In a makefile you can use a line like this: work: +<UL> +<PRE> my_panels.h my_panels.cxx: my_panels.fl fluid -c my_panels.fl -</pre></ul> - -Some versions of make will accept rules like this to allow all .fl -files found to be compiled: - -<ul><pre> +</PRE> +</UL> + Some versions of make will accept rules like this to allow all .fl +files found to be compiled: +<UL> +<PRE> .SUFFIXES: .fl .cxx .h .fl.h .fl.cxx: fluid -c $< -</pre></ul> - -<h2>The Widget Browser</h2> - -<table cellpadding=0 cellspacing=0> -<tr> -<td> - -The main window shows a menu bar and a scrolling browser of all the -defined widgets. The name of the .fl file being edited is shown in -the window title. - -<p>The widgets are stored in a hierarchy. You can open and close a -level by clicking the "triangle" at the left of a widget. This -widget is the <i>parent</i>, and all the widgets listed below it are its -<i>children</i>. There can be zero children. - -<p>The top level of the hierarchy is <i>functions</i>. Each of these -will produce a single C++ public function in the output .cxx file. -Calling the function will create all of its child windows. - -<p>The second level of the hierarchy is <i>windows</i>. Each of these -produces an instance of class Fl_Window. - -<p>Below that are either <i>widgets</i> (subclasses of Fl_Widget) or -<i>groups</i> of widgets (including other groups). Plain groups are -for layout, navigation, and resize purposes. <i>Tab groups</i> -provide the well-known file-card tab interface. - -<p>Widgets are shown in the browser as either their <i>name</i> (such -as "main_panel" in the example), or if <i>unnamed</i> as their -<i>type</i> and <i>label</i> (such as "Button "the green""). - -</td> -<td><img src="fluid_main.gif" width=245></td> -</tr> -</table> - -You <i>select</i> widgets by clicking on their names, which -highlights them (you can also select widgets from any displayed -window). You can select many widgets by dragging the mouse across -them, or by using shift+click to toggle them on and off. To select no -widgets, click in the blank area under the last widget. Notice that -hidden children may be selected and there is no visual indication of -this. - -<p>You <i>open</i> widgets by double clicking them, or (to open several -widgets you have picked) by typing the F1 key. This will bring up a -control panel or window from which you can change the widget. - -<h2>Menu Items</h2> - -<p>The menu bar at the top is duplicated as a pop-up menu on any -displayed window. The shortcuts for all the menu items work in any -window. The menu items are: - -<h3>File/Open... (Alt+Shift+O)</h3> - -Discard the current editing session and read in a different .fl file. -You are asked for confirmation if you have changed the current data. - -<p>FLUID can also read .fd files produced by the Forms and XForms -"fdesign" programs. It is best to read them with Merge. FLUID does not -understand everything in a .fd file, and will print a warning message -on the controlling terminal for all data it does not understand. You -will probably need to edit the resulting setup to fix these errors. -Be careful not to save the file without changing the name, as FLUID -will write over the .fd file with its own format, which fdesign -cannot read! - +</PRE> +</UL> +<H2>The Widget Browser</H2> +<TABLE cellpadding=0 cellspacing=0> +<TR><TD>The main window shows a menu bar and a scrolling browser of all +the defined widgets. The name of the .fl file being edited is shown in +the window title. +<P>The widgets are stored in a hierarchy. You can open and close a +level by clicking the "triangle" at the left of a widget. This widget +is the <I>parent</I>, and all the widgets listed below it are its <I> +children</I>. There can be zero children. </P> +<P>The top level of the hierarchy is <I>functions</I>. Each of these +will produce a single C++ public function in the output .cxx file. +Calling the function will create all of its child windows. </P> +<P>The second level of the hierarchy is <I>windows</I>. Each of these +produces an instance of class Fl_Window. </P> +<P>Below that are either <I>widgets</I> (subclasses of Fl_Widget) or <I> +groups</I> of widgets (including other groups). Plain groups are for +layout, navigation, and resize purposes. <I>Tab groups</I> provide the +well-known file-card tab interface. </P> +<P>Widgets are shown in the browser as either their <I>name</I> (such +as "main_panel" in the example), or if <I>unnamed</I> as their <I>type</I> + and <I>label</I> (such as "Button "the green""). </P> +</TD><TD><IMG src=./fluid_main.gif width=245></TD></TR> +</TABLE> + You <I>select</I> widgets by clicking on their names, which highlights +them (you can also select widgets from any displayed window). You can +select many widgets by dragging the mouse across them, or by using +shift+click to toggle them on and off. To select no widgets, click in +the blank area under the last widget. Notice that hidden children may +be selected and there is no visual indication of this. +<P>You <I>open</I> widgets by double clicking them, or (to open several +widgets you have picked) by typing the F1 key. This will bring up a +control panel or window from which you can change the widget. </P> +<H2>Menu Items</H2> +<P>The menu bar at the top is duplicated as a pop-up menu on any +displayed window. The shortcuts for all the menu items work in any +window. The menu items are: </P> +<H3>File/Open... (Alt+Shift+O)</H3> + Discard the current editing session and read in a different .fl file. +You are asked for confirmation if you have changed the current data. +<P>FLUID can also read .fd files produced by the Forms and XForms +"fdesign" programs. It is best to read them with Merge. FLUID does +not understand everything in a .fd file, and will print a warning +message on the controlling terminal for all data it does not +understand. You will probably need to edit the resulting setup to fix +these errors. Be careful not to save the file without changing the +name, as FLUID will write over the .fd file with its own format, which +fdesign cannot read! </P> <H3>File/Save (Alt+s)</H3> - -Write the current data to the .fl file. If the file is unnamed -(because FLUID was started with no name) then ask for a file name. - + Write the current data to the .fl file. If the file is unnamed +(because FLUID was started with no name) then ask for a file name. <H3>File/Save As...(Alt+Shift+S)</H3> - -Ask for a new name to save the file as, and save it. - + Ask for a new name to save the file as, and save it. <H3>File/Merge... (Alt+i)</H3> - -Insert the contents of another .fl file, without changing the name of -the current .fl file. All the functions (even if they have the same -names as the current ones) are added, you will have to use cut/paste -to put the widgets where you want. - + Insert the contents of another .fl file, without changing the name of +the current .fl file. All the functions (even if they have the same +names as the current ones) are added, you will have to use cut/paste to +put the widgets where you want. <H3>File/Write code (Alt+Shift+C)</H3> - -"Compiles" the data into a .cxx and .h file. These are exactly the same -as the files you get when you run FLUID with the -c switch. - -<p>The output file names are the same as the .fl file, with the -leading directory and trailing ".fl" stripped, and ".h" or ".cxx" -appended. Currently there is no way to override this. - + "Compiles" the data into a .cxx and .h file. These are exactly the +same as the files you get when you run FLUID with the -c switch. +<P>The output file names are the same as the .fl file, with the leading +directory and trailing ".fl" stripped, and ".h" or ".cxx" appended. + Currently there is no way to override this. </P> <H3>File/Quit (Alt+q)</H3> - -Exit FLUID. You are asked for confirmation if you have changed the -current data. - + Exit FLUID. You are asked for confirmation if you have changed the +current data. <H3>Edit/Undo (Alt+z)</H3> - -Don't you wish... This isn't implemented yet. You should do save -often so that any mistakes you make don't irretrivably destroy your -data. - + Don't you wish... This isn't implemented yet. You should do save +often so that any mistakes you make don't irretrivably destroy your +data. <H3>Edit/Cut (Alt+x)</H3> - -Delete the selected widgets and all their children. These are saved -to a "clipboard" file (/usr/tmp/cut_buffer.fl) and can be pasted back -into this FLUID or any other one. - + Delete the selected widgets and all their children. These are saved +to a "clipboard" file (/usr/tmp/cut_buffer.fl) and can be pasted back +into this FLUID or any other one. <H3>Edit/Copy (Alt+c)</H3> - -Copy the selected widgets and all their children to the "clipboard" file. - + Copy the selected widgets and all their children to the "clipboard" +file. <H3>Edit/Paste (Alt+c)</H3> - -Paste in the widgets in the clipboard file. - -<p>If the widget is a window, it is added to whatever function is -selected, or contains the current selection. - -<p>If the widget is a normal widget, it is added to whatever window or -group is selected. If none is, it is added to the window or group -that is the parent of the current selection. - -<p>To avoid confusion, it is best to select exactly one widget before -doing a paste. - -<p>Cut/paste is the only way to change the parent of a widget. - + Paste in the widgets in the clipboard file. +<P>If the widget is a window, it is added to whatever function is +selected, or contains the current selection. </P> +<P>If the widget is a normal widget, it is added to whatever window or +group is selected. If none is, it is added to the window or group that +is the parent of the current selection. </P> +<P>To avoid confusion, it is best to select exactly one widget before +doing a paste. </P> +<P>Cut/paste is the only way to change the parent of a widget. </P> <H3>Edit/Select All (Alt+a)</H3> - -Select all widgets in the same group as the current selection. - -<p>If they are all selected already then this selects all widgets in -that group's parent. Repeatedly typing Alt+a will select larger and -larger groups of widgets until everything is selected. - + Select all widgets in the same group as the current selection. +<P>If they are all selected already then this selects all widgets in +that group's parent. Repeatedly typing Alt+a will select larger and +larger groups of widgets until everything is selected. </P> <H3>Edit/Open... (F1 or double click)</H3> - -If the current widget is a window and it is not displayed, display it. -Otherwise open a control panel for the most recent (and possibly all) -selected widgets. - + If the current widget is a window and it is not displayed, display it. +Otherwise open a control panel for the most recent (and possibly all) +selected widgets. <H3>Edit/Sort</H3> - -All the selected widgets are sorted into left to right, top to bottom -order. You need to do this to make navigation keys in FLTK work -correctly. You may then fine-tune the sorting with "Earlier" and -"Later". This does not affect the positions of windows or functions. - + All the selected widgets are sorted into left to right, top to bottom +order. You need to do this to make navigation keys in FLTK work +correctly. You may then fine-tune the sorting with "Earlier" and +"Later". This does not affect the positions of windows or functions. <H3>Edit/Earlier (F2)</H3> - -All the selected widgets are moved one earlier in order amoung the -children of their parent (if possible). This will affect navigation -order, and if the widgets overlap it will affect how they draw, as the -later widget is drawn on top of the earlier one. You can also use -this to reorder functions and windows within functions. - + All the selected widgets are moved one earlier in order amoung the +children of their parent (if possible). This will affect navigation +order, and if the widgets overlap it will affect how they draw, as the +later widget is drawn on top of the earlier one. You can also use this +to reorder functions and windows within functions. <H3>Edit/Later (F3)</H3> - -All the selected widgets are moved one later in order amoung the -children of their parent (if possible). - + All the selected widgets are moved one later in order amoung the +children of their parent (if possible). <H3>Edit/Group (F7)</H3> - -Create a new Fl_Group and make all the currently selected widgets be -children of it. - + Create a new Fl_Group and make all the currently selected widgets be +children of it. <H3>Edit/Ungroup (F8)</H3> - -If all the children of a group are selected, delete that group and -make them all be children of its parent. - + If all the children of a group are selected, delete that group and +make them all be children of its parent. <H3>Edit/Overlays on/off (Alt+o)</H3> - -Toggle the display of the red overlays off, without changing the -selection. This makes it easier to see box borders and how the layout -looks. The overlays will be forced back on if you change the selection. - + Toggle the display of the red overlays off, without changing the +selection. This makes it easier to see box borders and how the layout +looks. The overlays will be forced back on if you change the +selection. <H3>Edit/Preferences (Alt+p)</H3> - -Currently the only preferences are for the "alignment grid" that all -widgets snap to when you move them and resize them, and for the "snap" -which is how far a widget has to be dragged from its original -position to actually change. - + Currently the only preferences are for the "alignment grid" that all +widgets snap to when you move them and resize them, and for the "snap" +which is how far a widget has to be dragged from its original position +to actually change. <H3>New/code/Function</H3> - -Create a new C function. You will be asked for a name for the -function. This name should be a legal C++ function template, without -the return type. You can pass arguments, they can be referred to by -code you type into the individual widgets. - -<p>If the function contains any unnamed windows, it will be declared -as returning an Fl_Window*. The unnamed window will be returned from -it (more than one unnamed window is useless). If the function -contains only named windows it will be declared as returning void. - -<p>It is possible to make the .cxx output be a self-contained program -that can be compiled and executed. This is done by deleting the -function name, in which case "main(argc,argv)" is used. The function -will call show() on all the windows it creates and then call -Fl::run(). This can be used to test resize behavior or other parts of -the user interface. I'm not sure if it is possible to create really -useful programs using just FLUID. - -<p>You can change the function name by double clicking the function. - + Create a new C function. You will be asked for a name for the +function. This name should be a legal C++ function template, without +the return type. You can pass arguments, they can be referred to by +code you type into the individual widgets. +<P>If the function contains any unnamed windows, it will be declared as +returning an Fl_Window*. The unnamed window will be returned from it +(more than one unnamed window is useless). If the function contains +only named windows it will be declared as returning void. </P> +<P>It is possible to make the .cxx output be a self-contained program +that can be compiled and executed. This is done by deleting the +function name, in which case "main(argc,argv)" is used. The function +will call show() on all the windows it creates and then call Fl::run(). + This can be used to test resize behavior or other parts of the user +interface. I'm not sure if it is possible to create really useful +programs using just FLUID. </P> +<P>You can change the function name by double clicking the function. </P> <H3>New/Window</H3> - -Create a new Fl_Window. It is added to the currently selected -function, or to the function containing the currently selected item. -The window will appear, sized to 100x100. You will want to resize it -to whatever size you require. - -<p>You also get the window's control panel, which is almost exactly -the same as any other Fl_Widget, and is described in the next chapter. - + Create a new Fl_Window. It is added to the currently selected +function, or to the function containing the currently selected item. +The window will appear, sized to 100x100. You will want to resize it +to whatever size you require. +<P>You also get the window's control panel, which is almost exactly the +same as any other Fl_Widget, and is described in the next chapter. </P> <H3>New/...</H3> - -All other items on the New menu are subclasses of Fl_Widget. Creating -them will add them to the currently selected group or window, or the -group or window containing the currently selected widget. The initial -dimensions and position are chosen by copying the current widget, if -possible. - -<p>When you create the widget you will get the widget's control panel, -described in the next chapter. - + All other items on the New menu are subclasses of Fl_Widget. Creating +them will add them to the currently selected group or window, or the +group or window containing the currently selected widget. The initial +dimensions and position are chosen by copying the current widget, if +possible. +<P>When you create the widget you will get the widget's control panel, +described in the next chapter. </P> <H3>Help/About FLUID</H3> - -Pops up a panel showing the version of FLUID. - + Pops up a panel showing the version of FLUID. <H3>Help/Manual</H3> - -Not yet implemented. Use a HTML or PDF file viewer to read these pages -instead. - -<h2>The Widget Panel</h2> - -<table cellpadding=0 cellspacing=0> -<tr> -<td> - -When you double-click a widget or a set of widgets you will get the -"widget attribute panel". - -<p>When you change attributes using this panel, the changes are -reflected immediately in the window. It is useful to hit the "no -overlay" button (or type Alt+o) to hide the red overlay so you can see -the widgets more accurately, especially when setting the box type. - -<p>If you have several widgets selected, they may have different -values for the fields. In this case the value for <i>one</i> of the -widgets is shown. But if you change this value, <i>all</i> the -selected widgets are changed to the new value. - -<p>Hitting "OK" makes the changes permanent. Selecting a different -widget also makes the changes permanent. FLUID checks for simple -syntax errors in any code (such as mismatched parenthesis) before -saving any text. - -</td> -<td><img src="fluid_widget.gif" width=225></td> -</tr> -</table> - -"Revert" or "Cancel" put everything back to when you last brought -up the panel or hit OK. However in the current version of FLUID, -changes to "visible" attributes (such as the color, label, box) are -not undone by revert or cancel. Changes to code like the callbacks -is undone, however. - -<a name=widget_attributes> -<h2>Widget Attributes</h2> - + Not yet implemented. Use a HTML or PDF file viewer to read these +pages instead. +<H2>The Widget Panel</H2> +<TABLE cellpadding=0 cellspacing=0> +<TR><TD>When you double-click a widget or a set of widgets you will get +the "widget attribute panel". +<P>When you change attributes using this panel, the changes are +reflected immediately in the window. It is useful to hit the "no +overlay" button (or type Alt+o) to hide the red overlay so you can see +the widgets more accurately, especially when setting the box type. </P> +<P>If you have several widgets selected, they may have different values +for the fields. In this case the value for <I>one</I> of the widgets +is shown. But if you change this value, <I>all</I> the selected +widgets are changed to the new value. </P> +<P>Hitting "OK" makes the changes permanent. Selecting a different +widget also makes the changes permanent. FLUID checks for simple +syntax errors in any code (such as mismatched parenthesis) before +saving any text. </P> +</TD><TD><IMG src=./fluid_widget.gif width=225></TD></TR> +</TABLE> + "Revert" or "Cancel" put everything back to when you last brought up +the panel or hit OK. However in the current version of FLUID, changes +to "visible" attributes (such as the color, label, box) are not undone +by revert or cancel. Changes to code like the callbacks is undone, +however. <A name=widget_attributes> +<H2>Widget Attributes</H2> <H3>Name (text field)</H3> - -Name of a global C variable to declare, and to store a pointer to this -widget into. This variable will be of type "<class>*". If the name -is blank then no variable is created. - -<p>You can name several widgets with "name[0]", "name[1]", "name[2]", -etc. This will cause FLUID to declare an array of pointers. The -array is big enough that the highest number found can be stored. All -widgets that in the array must be the same type. - + Name of a global C variable to declare, and to store a pointer to this +widget into. This variable will be of type "<class>*". If the name is +blank then no variable is created. +<P>You can name several widgets with "name[0]", "name[1]", "name[2]", +etc. This will cause FLUID to declare an array of pointers. The array +is big enough that the highest number found can be stored. All widgets +that in the array must be the same type. </P> <H3>Type (upper-right pulldown menu)</H3> - -Some classes have subtypes that modify their appearance or behavior. -You pick the subtype off of this menu. - + Some classes have subtypes that modify their appearance or behavior. +You pick the subtype off of this menu. <H3>Box (pulldown menu)</H3> - -The boxtype to draw as a background for the widget. - -<p>Many widgets will work, and draw faster, with a "frame" instead of -a "box". A frame does not draw the colored interior, leaving whatever -was already there visible. Be careful, as FLUID may draw this ok but -the real program leave unwanted stuff inside the widget. - -<p>If a window is filled with child widgets, you can speed up -redrawing by changing the window's box type to "NO_BOX". FLUID will -display a checkerboard for any areas that are not colored in by boxes -(notice that this checkerboard is not drawn by the resulting program, -instead random garbage is left there). - + The boxtype to draw as a background for the widget. +<P>Many widgets will work, and draw faster, with a "frame" instead of a +"box". A frame does not draw the colored interior, leaving whatever +was already there visible. Be careful, as FLUID may draw this ok but +the real program leave unwanted stuff inside the widget. </P> +<P>If a window is filled with child widgets, you can speed up redrawing +by changing the window's box type to "NO_BOX". FLUID will display a +checkerboard for any areas that are not colored in by boxes (notice +that this checkerboard is not drawn by the resulting program, instead +random garbage is left there). </P> <H3>Color</H3> - -<p>The color to draw the box with. - +<P>The color to draw the box with. </P> <H3>Color2</H3> - -<p>Some widgets will use this color for certain parts. FLUID does not -always show the result of this: this is the color buttons draw in when -pushed down, and the color of input fields when they have the focus. - +<P>Some widgets will use this color for certain parts. FLUID does not +always show the result of this: this is the color buttons draw in when +pushed down, and the color of input fields when they have the focus. </P> <H3>Label</H3> - -String to print next to or inside the button. - -<p>You can put newlines into the string to make multiple lines, the -easiest way is by typing ctrl+j. - + String to print next to or inside the button. +<P>You can put newlines into the string to make multiple lines, the +easiest way is by typing ctrl+j. </P> <H3>Label style (pull down menu)</H3> - -How to draw the label. Normal, shadowned, engraved, and embossed -change the appearance of the text. "symbol" requires the label to -start with an '@' sign to draw a named <a -href=Labeltypes.html#symbols>symbol</a>. - -<p>From this menu you can also pick <a -href=#images>"Image..."</a>. This lets you use the contents -of an image file (currently an xpm pixmap or xbm bitmap) to label the -widget. - + How to draw the label. Normal, shadowned, engraved, and embossed +change the appearance of the text. "symbol" requires the label to +start with an '@' sign to draw a named <A href=Labeltypes.html#symbols> +symbol</A>. +<P>From this menu you can also pick <A href=drawing.html#images> +"Image..."</A>. This lets you use the contents of an image file +(currently an xpm pixmap or xbm bitmap) to label the widget. </P> <H3>Label alignement (buttons)</H3> - -Where to draw the label. The arrows put it on that side of the -widget, you can combine the to put it in the corner. The "box" button -puts the label inside the widget, rather than outside. - + Where to draw the label. The arrows put it on that side of the +widget, you can combine the to put it in the corner. The "box" button +puts the label inside the widget, rather than outside. <H3>Label font</H3> - -Font to draw the label in. Ignored by symbols, bitmaps, and pixmaps. -Your program can change the actual font used by these "slots", in case -you want some font other than the 16 provided. - + Font to draw the label in. Ignored by symbols, bitmaps, and pixmaps. +Your program can change the actual font used by these "slots", in case +you want some font other than the 16 provided. <H3>Label size</H3> - -Point size for the font to draw the label in. Ignored by symbols, -bitmaps, and pixmaps. To see the result without dismissing the panel, -type the new number and then Tab. - + Point size for the font to draw the label in. Ignored by symbols, +bitmaps, and pixmaps. To see the result without dismissing the panel, +type the new number and then Tab. <H3>Label color</H3> - -Color to draw the label. Ignored by pixmaps (bitmaps, however, do use -this color as the foreground color). - + Color to draw the label. Ignored by pixmaps (bitmaps, however, do use +this color as the foreground color). <H3>Text font, size, color</H3> - -Some widgets display text, such as input fields, pull-down menus, -browsers. You can change this here. - + Some widgets display text, such as input fields, pull-down menus, +browsers. You can change this here. <H3>Visible</H3> - -If you turn this off the widget is hidden initially. Don't change -this for windows or for the immediate children of a Tabs group. - + If you turn this off the widget is hidden initially. Don't change +this for windows or for the immediate children of a Tabs group. <H3>Active</H3> - -If you turn this off the widget is deactivated initially. Currently -no FLTK widgets display the fact that they are inactive (like by graying -out), but this may change in the future. - + If you turn this off the widget is deactivated initially. Currently +no FLTK widgets display the fact that they are inactive (like by +graying out), but this may change in the future. <H3>Resizable</H3> - -If a window is resizable or has an immediate child that is resizable, -then the user will be able to resize it. In addition all the size -changes of a window or group will go "into" the resizable child. If -you have a large data display surrounded by buttons, you probably want -that data area to be resizable. - -<p>Only one child can be resizable. Turning this on turns it off for -other children. - -<p>You can get more complex behavior by making invisible boxes the -resizable widget, or by using hierarchies of groups. Unfortunatley -the only way to test it is to compile the program. Resizing the FLUID -window is <i>not</i> the same as what will happen in the user program. - + If a window is resizable or has an immediate child that is resizable, +then the user will be able to resize it. In addition all the size +changes of a window or group will go "into" the resizable child. If +you have a large data display surrounded by buttons, you probably want +that data area to be resizable. +<P>Only one child can be resizable. Turning this on turns it off for +other children. </P> +<P>You can get more complex behavior by making invisible boxes the +resizable widget, or by using hierarchies of groups. Unfortunatley the +only way to test it is to compile the program. Resizing the FLUID +window is <I>not</I> the same as what will happen in the user program. </P> <H3>Hotspot</H3> - -Each window may have exactly one hotspot (turning this on will turn -off any others). This will cause it to be positioned with that widget -centered on the mouse. This position is determined <i>when the FLUID -function is called, so you should call it immediately before showing -the window</i>. If you want the window to hide and then reappear at a -new position, you should have your program set the hotspot itself just -before show(). - + Each window may have exactly one hotspot (turning this on will turn +off any others). This will cause it to be positioned with that widget +centered on the mouse. This position is determined <I>when the FLUID +function is called, so you should call it immediately before showing +the window</I>. If you want the window to hide and then reappear at a +new position, you should have your program set the hotspot itself just +before show(). <H3>subclass</H3> - -This is how you put your own subclasses of Fl_Widget in. Whatever -identifier you type in here will be the class that is instantiated. - -<p>In addition, no #include header file is put in the .h file. You -must provide a #include line as the first of the "extra code" which -declares your subclass. - -<p>The class had better be similar to the class you are spoofing. It -does not have to be a subclass. It is sometimes useful to change this -to another FLTK class: currently the only way to get a double-buffered -window is to change this field for the window to "Fl_Double_Window" -and to add "#include <FL/Fl_Double_Window.h>" to the extra code. - + This is how you put your own subclasses of Fl_Widget in. Whatever +identifier you type in here will be the class that is instantiated. +<P>In addition, no #include header file is put in the .h file. You +must provide a #include line as the first of the "extrawhich declares +your subclass. </P> +<P>The class had better be similar to the class you are spoofing. It +does not have to be a subclass. It is sometimes useful to change this +to another FLTK class: currently the only way to get a double-buffered +window is to change this field for the window to "Fl_Double_Window" and +to add "#include <FL/Fl_Double_Window.h>" to the extra code. </P> <H3>Extra code</H3> - -These four fields let you type in literal lines of code to dump into -the .h or .cxx files. - -<p>If the text starts with a '#' or the word "extern" then FLUID -thinks this is an "include" line, and it is written to the .h file. -If the same include line occurs several times then only one copy is -written. - -<p>All other lines are "code" lines. The widget being constructed is -pointed to by the local variable 'o'. The window being constructed is -pointed to by the local variable 'w'. You can also access any -arguments passed to the function here, and any named widgets that are -before this one. - -<p>FLUID will check for matching parenthesis, braces, and quotes, but -does not do much other error checking. Be careful here, as it may be -hard to figure out what widget is producing an error in the compiler. -If you need more than 4 lines you probably should call a function in -your own .cxx code. - + These four fields let you type in literal lines of code to dump into +the .h or .cxx files. +<P>If the text starts with a '#' or the word "extern" then FLUID thinks +this is an "include" line, and it is written to the .h file. If the +same include line occurs several times then only one copy is written. </P> +<P>All other lines are "code" lines. The widget being constructed is +pointed to by the local variable 'o'. The window being constructed is +pointed to by the local variable 'w'. You can also access any +arguments passed to the function here, and any named widgets that are +before this one. </P> +<P>FLUID will check for matching parenthesis, braces, and quotes, but +does not do much other error checking. Be careful here, as it may be +hard to figure out what widget is producing an error in the compiler. +If you need more than 4 lines you probably should call a function in +your own .cxx code. </P> <H3>Callback</H3> - -This can either be the name of a function, or a small snippet of -code. FLUID thinks that if there is any punctuation then it is code. - -<p>A name names a function in your own code. It must be declared as -"void <name>(<class>*,void*)". - -<p>A code snippet is inserted into a static function in the .cxx output -file. The function prototype is -"void f(<class>* o, void* v)", so you can refer to -the widget as 'o' and the user_data as 'v'. FLUID will check for -matching parenthesis, braces, and quotes, but does not do much other -error checking. Be careful here, as it may be hard to figure out what -widget is producing an error in the compiler. - -<p>If the callback is blank then no callback is set. - + This can either be the name of a function, or a small snippet of code. + FLUID thinks that if there is any punctuation then it is code. +<P>A name names a function in your own code. It must be declared as +"voidname>(<class>*,void*)". </P> +<P>A code snippet is inserted into a static function in the .cxx output +file. The function prototype is "voidclass>*so you can refer to the +widget as 'o' and the user_data as 'v'. FLUID will check for matching +parenthesis, braces, and quotes, but does not do much other error +checking. Be careful here, as it may be hard to figure out what widget +is producing an error in the compiler. </P> +<P>If the callback is blank then no callback is set. </P> <H3>user_data</H3> - -<p>This is a value for the user_data() of the widget. If blank the -default value of zero is used. This can be any piece of C code that -can be put "(void*)(<here>)". - +<P>This is a value for the user_data() of the widget. If blank the +default value of zero is used. This can be any piece of C code that +can be put "(void*)(<here>)". </P> <H3>User data type</H3> - -The "void*" in the callback function prototypes is replaced with -this. You may want to use "long" for old XForms code. Be warned that -anything other than "void*" is not guaranteed to work by the C++ spec! -However on most architectures other pointer types are ok, and long is -usually ok. - + The "void*" in the callback function prototypes is replaced with this. + You may want to use "long" for old XForms code. Be warned that +anything other than "void*" is not guaranteed to work by the C++ spec! +However on most architectures other pointer types are ok, and long is +usually ok. <H3>When</H3> - -When to do the callback. Can be "never", "changed", "release". The -value of "enter key" is only useful for text input fields. The "no -change" button means the callback is done on the matching event even -if the data is not changed. - -<p>There are rare but useful other values for the when() field that -are not in the menu. You should use the extra code fields to put -these values in. - -<a name=windows> -<h2>Selecting & Moving Widgets</h2> - -<p>Double-clicking a window name in the browser will display it, if -not displayed yet. From this display you can select widgets, sets of -widgets, and move or resize them. To close a window either -double-click it or type Esc. - -<p>To select a widget, click it. To select several widgets drag a -rectangle around them. Holding down shift will toggle the selection -of the widgets instead. - -<p>You cannot pick hidden widgets. You also cannot choose some -widgets if they are completely overlapped by later widgets. Use the -browser to select these widgets. - -<p>The selected widgets are shown with a red "overlay" line around -them. You can move the widgets by dragging this box. Or you can -resize them by dragging the outer edges and corners. Hold down the -Alt key while dragging the mouse to defeat the snap-to-grid effect for -fine positioning. - -<p>If there is a tab box displayed you can change which child is -visible by clicking on the file tabs. The child you pick is -selected. - -<p>The arrow, tab, and shift+tab keys "navigate" the selection. Left, -right, tab, or shift+tab move to the next or previous widgets in the -hierarchy. Hit the right arrow enough and you will select every -widget in the window. Up/down widgets move to the previous/next -widgets that overlap horizontally. If the navigation does not seem to -work you probably need to "Sort" the widgets. This is important if -you have input fields, as FLTK uses the same rules when using arrow keys -to move between input fields. - -<p>To "open" a widget, double click it. To open several widgets -select them and then type F1 or pick "Edit/Open" off the pop-up menu. - -<p>Type Alt+o to temporarily toggle the overlay off without changing -the selection, so you can see the widget borders. - -<p>You can resize the window by using the window manager border -controls. FLTK will attempt to round the window size to the nearest -multiple of the grid size and makes it big enough to contain all the -widgets (it does this using illegal X methods, so it is possible it -will barf with some window managers!). Notice that the actual window -in your program may not be resizable, and if it is, the effect on -child widgets may be different. - -<p>The panel for the window (which you get by double-clicking it) is -almost identical to the panel for any other Fl_Widget. There are -three extra items: - + When to do the callback. Can be "never", "changed", "release". The +value of "enter key" is only useful for text input fields. The "no +change" button means the callback is done on the matching event even if +the data is not changed. +<P>There are rare but useful other values for the when() field that are +not in the menu. You should use the extra code fields to put these +values in. <A name=windows></P> +<H2>Selecting Moving Widgets</H2> +<P>Double-clicking a window name in the browser will display it, if not +displayed yet. From this display you can select widgets, sets of +widgets, and move or resize them. To close a window either +double-click it or type Esc. </P> +<P>To select a widget, click it. To select several widgets drag a +rectangle around them. Holding down shift will toggle the selection of +the widgets instead. </P> +<P>You cannot pick hidden widgets. You also cannot choose some widgets +if they are completely overlapped by later widgets. Use the browser to +select these widgets. </P> +<P>The selected widgets are shown with a red "overlay" line around +them. You can move the widgets by dragging this box. Or you can +resize them by dragging the outer edges and corners. Hold down the Alt +key while dragging the mouse to defeat the snap-to-grid effect for fine +positioning. </P> +<P>If there is a tab box displayed you can change which child is +visible by clicking on the file tabs. The child you pick is selected. </P> +<P>The arrow, tab, and shift+tab keys "navigate" the selection. Left, +right, tab, or shift+tab move to the next or previous widgets in the +hierarchy. Hit the right arrow enough and you will select every widget +in the window. Up/down widgets move to the previous/next widgets that +overlap horizontally. If the navigation does not seem to work you +probably need to "Sort" the widgets. This is important if you have +input fields, as FLTK uses the same rules when using arrow keys to move +between input fields. </P> +<P>To "open" a widget, double click it. To open several widgets select +them and then type F1 or pick "Edit/Open" off the pop-up menu. </P> +<P>Type Alt+o to temporarily toggle the overlay off without changing +the selection, so you can see the widget borders. </P> +<P>You can resize the window by using the window manager border +controls. FLTK will attempt to round the window size to the nearest +multiple of the grid size and makes it big enough to contain all the +widgets (it does this using illegal X methods, so it is possible it +will barf with some window managers!). Notice that the actual window +in your program may not be resizable, and if it is, the effect on child +widgets may be different. </P> +<P>The panel for the window (which you get by double-clicking it) is +almost identical to the panel for any other Fl_Widget. There are three +extra items: </P> <H3>Border</H3> - -This button turns the window manager border on or off. On most window -managers you will have to close the window and reopen it to see the -effect. - + This button turns the window manager border on or off. On most window +managers you will have to close the window and reopen it to see the +effect. <H3>xclass</H3> - -The string typed into here is passed to the X window manager as the -class. This can change the icon or window decorations. On most -(all?) window managers you will have to close the window and reopen it -to see the effect. - -<a name=images> -<h2>Image Labels</h2> - -<p>Selecting "Image..." off the label style pull-down menu will bring -up a file chooser from which you pick the image file. If an image has -already been chosen, you can change the image used by picking -"Image..." again. The name of the image will appear in the "label" -field, but you can't edit it. - -<p>The <i>contents</i> of the image file are written to the .cxx file, -so if you wish to distribute the C code, you only need to copy the .cxx -file, not the images. If many widgets share the same image then only -one copy is written. - -<p>However the <i>file name</i> is stored in the .fl file, so to read -the .fl file you need the image files as well. Filenames are relative -to the location the .fl file is (not necessarily the current -directory). I recommend you either put the images in the same -directory as the .fl file, or use absolute path names. - + The string typed into here is passed to the X window manager as the +class. This can change the icon or window decorations. On most (all?) +window managers you will have to close the window and reopen it to see +the effect. <A name=images> +<H2>Image Labels</H2> +<P>Selecting "Image..." off the label style pull-down menu will bring +up a file chooser from which you pick the image file. If an image has +already been chosen, you can change the image used by picking +"Image..." again. The name of the image will appear in the "label" +field, but you can't edit it. </P> +<P>The <I>contents</I> of the image file are written to the .cxx file, +so if you wish to distribute the C code, you only need to copy the .cxx +file, not the images. If many widgets share the same image then only +one copy is written. </P> +<P>However the <I>file name</I> is stored in the .fl file, so to read +the .fl file you need the image files as well. Filenames are relative +to the location the .fl file is (not necessarily the current +directory). I recommend you either put the images in the same +directory as the .fl file, or use absolute path names. </P> <H3>Notes for all image types</H3> - -<p>FLUID runs using the default visual of your X server. This may be -8 bits, which will give you dithered images. You may get better -results in your actual program by adding the code "Fl::visual(FL_RGB)" -to your code right before the first window is displayed. - -<p>All widgets with the same image on them share the same code and -source X pixmap. Thus once you have put an image on a widget, it is -nearly free to put the same image on many other widgets. - -<p>If you are using a painting program to edit an image: the only way -to convince FLUID to read the image file again is to remove the image -from all widgets that are using it (including ones in closed windows), -which will cause it to free its internal copy, and then set the image -again. You may find it easier to exit FLUID and run it again. - -<p>Don't rely on how FLTK crops images that are outside the widget, as -this may change in future versions! The cropping of inside labels -will probably be unchanged. - -<p>To more accurately place images, make a new "box" widget and put -the image in that as the label. This is also how you can put both an -image and text label on the same widget. If your widget is a button, -and you want the image inside it, you must change the button's boxtype -to FL_UP_FRAME (or another frame), otherwise when it is pushed it will -erase the image. - +<P>FLUID runs using the default visual of your X server. This may be 8 +bits, which will give you dithered images. You may get better results +in your actual program by adding the code "Fl::visual(FL_RGB)" to your +code right before the first window is displayed. </P> +<P>All widgets with the same image on them share the same code and +source X pixmap. Thus once you have put an image on a widget, it is +nearly free to put the same image on many other widgets. </P> +<P>If you are using a painting program to edit an image: the only way +to convince FLUID to read the image file again is to remove the image +from all widgets that are using it (including ones in closed windows), +which will cause it to free its internal copy, and then set the image +again. You may find it easier to exit FLUID and run it again. </P> +<P>Don't rely on how FLTK crops images that are outside the widget, as +this may change in future versions! The cropping of inside labels will +probably be unchanged. </P> +<P>To more accurately place images, make a new "box" widget and put the +image in that as the label. This is also how you can put both an image +and text label on the same widget. If your widget is a button, and you +want the image inside it, you must change the button's boxtype to +FL_UP_FRAME (or another frame), otherwise when it is pushed it will +erase the image. </P> <H3>XBM (X bitmap files)</H3> - -<p>FLUID will read X bitmap files. These files have C source code to -define a bitmap. Sometimes they are stored with the ".h" or ".bm" -extension rather than the standard ".xbm". - -<p>FLUID will output code to construct an Fl_Bitmap widget and use it -to label the widget. The '1' bits in the bitmap are drawn using the -label color of the widget. You can change the color in FLUID. The -'0' bits are transparent. - -<p>The program "bitmap" on the X distribution does an ok job of -editing bitmaps. - +<P>FLUID will read X bitmap files. These files have C source code to +define a bitmap. Sometimes they are stored with the ".h" or ".bm" +extension rather than the standard ".xbm". </P> +<P>FLUID will output code to construct an Fl_Bitmap widget and use it +to label the widget. The '1' bits in the bitmap are drawn using the +label color of the widget. You can change the color in FLUID. The '0' +bits are transparent. </P> +<P>The program "bitmap" on the X distribution does an ok job of editing +bitmaps. </P> <H3>XPM (X pixmap files)</H3> - -<p>FLUID will read X pixmap files as used by the libxpm library. -These files have C source code to define a pixmap. The filenames -usually have a ".xpm" extension. - -<p>FLUID will output code to construct an Fl_Pixmap widget and use it -to label the widget. The label color of the widget is ignored, even -for 2-color images that could be a bitmap. - -<p>XPM files can mark a single color as being transparent. Currently -FLTK and FLUID simulate this transparency rather badly. It will use the -color() of the widget as the background, and all widgets using the -same pixmap are assummed to have the same color. This may be fixed in -the future or on non-X systems. - -<p>I have not found any good editors for small iconic pictures. For -pixmaps I have used <a href=http://www.danbbs.dk/~torsten/xpaint/index.html>XPaint</a>. This -(and most other) painting programs are designed for large full color -images and are difficult to use to edit an image of small size and few -colors. - +<P>FLUID will read X pixmap files as used by the libxpm library. These +files have C source code to define a pixmap. The filenames usually +have a ".xpm" extension. </P> +<P>FLUID will output code to construct an Fl_Pixmap widget and use it +to label the widget. The label color of the widget is ignored, even +for 2-color images that could be a bitmap. </P> +<P>XPM files can mark a single color as being transparent. Currently +FLTK and FLUID simulate this transparency rather badly. It will use +the color() of the widget as the background, and all widgets using the +same pixmap are assummed to have the same color. This may be fixed in +the future or on non-X systems. </P> +<P>I have not found any good editors for small iconic pictures. For +pixmaps I have used <A href=http://www.danbbs.dk/~torsten/xpaint/index.html> +XPaint</A>. This (and most other) painting programs are designed for +large full color images and are difficult to use to edit an image of +small size and few colors. </P> <H3>GIF files</H3> - -<p>FLUID will also read GIF image files. These files are often used -on html documents to make icons. This lets you use nice icons that -you steal off the net in your user interface. - -<p>FLUID converts these into (modified) XPM format and uses an -Fl_Pixmap widget to label the widget. Transparency is handled the same -as for xpm files. Notice that the conversion removes the compression, -so the code may be much bigger than the .gif file. Only the first -image of an animated gif file is used. - -<p>Behavior and performance with large .gif files is not guaranteed! - -</BODY> -</HTML> +<P>FLUID will also read GIF image files. These files are often used on +html documents to make icons. This lets you use nice icons that you +steal off the net in your user interface. </P> +<P>FLUID converts these into (modified) XPM format and uses an +Fl_Pixmap widget to label the widget. Transparency is handled the same +as for xpm files. Notice that the conversion removes the compression, +so the code may be much bigger than the .gif file. Only the first +image of an animated gif file is used. </P> +<P>Behavior and performance with large .gif files is not guaranteed! </P> +</A></A></BODY></HTML>
\ No newline at end of file diff --git a/documentation/forms.html b/documentation/forms.html index c1c69cf0e..6fd5282d7 100644 --- a/documentation/forms.html +++ b/documentation/forms.html @@ -1,271 +1,200 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="forms">E - Forms Compatibility</A></H1> - -This appendix describes the Forms compatibility included with FLTK. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=forms>E - Forms Compatibility</A></H1> + This appendix describes the Forms compatibility included with FLTK. <H2>Importing Forms Layout Files</H2> - -<a href="#FLUID">FLUID</a> can read the .fd files put out by all -versions of Forms and XForms fdesign. However, it will mangle them a -bit, but it prints a warning message about anything it does not -understand. FLUID cannot write fdesign files, so you should save to a -new name so you don't write over the old one. - -<p>You will need to edit your main code considerably to get it to link -with the output from FLUID. If you are not interested in this you may -have more immediate luck with the forms compatibility header, -<tt><FL/forms.H></tt>. - +<A href=fluid.html#FLUID>FLUID</A> can read the .fd files put out by +all versions of Forms and XForms fdesign. However, it will mangle them +a bit, but it prints a warning message about anything it does not +understand. FLUID cannot write fdesign files, so you should save to a +new name so you don't write over the old one. +<P>You will need to edit your main code considerably to get it to link +with the output from FLUID. If you are not interested in this you may +have more immediate luck with the forms compatibility header, <TT> +<FL/forms.H></TT>. </P> <H2>Using the Compatibility Header File</H2> - -You should be able to compile existing Forms or XForms source code -by changing the include directory switch to your compiler so that the -<tt>forms.h</tt> file supplied with FLTK is included. Take a look at -<tt>forms.h</tt> to see how it works, but the basic trick is lots of -inline functions. Most of the XForms demo programs work without -changes. - -<p>You will also have to compile your Forms or XForms program using a -C++ compiler. The FLTK library does not provide C bindings or header -files. - -<p>Although FLTK was designed to be compatable with the GL Forms library -(version 0.3 or so), XForms has bloated severely and it's interface is -X-specific. Therefore, XForms compatibility is no longer a goal of -FLTK. Compatibility was limited to things that were free, or that -would add code that would not be linked in if the feature is unused, -or that was not X-specific. - -<p>To use any new features of FLTK, you should rewrite your code to not -use the inline functions and instead use "pure" FLTK. This will make -it a lot cleaner and make it easier to figure out how to call the FLTK -functions. Unfortunately this conversion is harder than expected and -even Digital Domain's inhouse code still uses <tt>forms.H</tt> a lot. - -<h2>Problems you will encounter</h2> - -<p>Many parts of XForms use X-specific structures like <tt>XEvent</tt> -in their interface. I did not emulate these! Unfortunately these -features (such as the "canvas" widget) are needed by most large -programs. You will need to rewrite these to use FLTK subclasses. - -<p><a href="#Fl_Free"><tt>Fl_Free</tt></a> widgets emulate the -<i>old</i> Forms "free" widget. It may be useful for porting programs -that change the <tt>handle()</tt> function on widgets, but you will -still need to rewrite things. - -<p><a href="#Fl_Timer"><tt>Fl_Timer</tt></a> widgets are provided to -emulate the XForms timer. These work, but are quite inefficient and -inaccurate compared to using <a -href="#add_timeout"><tt>Fl::add_timeout()</tt></a>. - -<p><i>All instance variables are hidden.</i> -If you directly refer to the x, y, w, h, label, or other fields of -your Forms widgets you will have to add empty parenthesis after each -reference. The easiest way to do this is to globally replace "->x" -with "->x()", etc. Replace "boxtype" with "box()". - -<p><tt>const char *</tt> arguments to most FLTK methods are simply -stored, while Forms would <tt>strdup()</tt> the passed string. This is -most noticable with the label of widgets. Your program must always -pass static data such as a string constant or malloc'd buffer to -<tt>label()</tt>. If you are using labels to display program output -you may want to try the <a href="#Fl_Output"><tt>Fl_Output</tt></a> widget. - -<p>The default fonts and sizes are matched to the older GL version of -Forms, so all labels will draw somewhat larger than an XForms program -does. - -<p>fdesign outputs a setting of a "fdui" instance variable to the main -window. I did not emulate this because I wanted all instance variables -to be hidden. You can store the same information in the -<tt>user_data()</tt> field of a window. To do this, search through -the fdesign output for all occurances of "->fdui" and edit to use -"->user_data()" instead. This will require casts and is not trivial. - -<p>The prototype for the functions passed to <tt>fl_add_timeout()</tt> -and <tt>fl_set_idle_callback()</tt> callback are different. - -<p><b>All the following XForms calls are missing:</b><p> - -<ul> - <li><tt>FL_REVISION</tt>, <tt>fl_library_version()</tt> - <li><tt>FL_RETURN_DBLCLICK</tt> (use <tt>Fl::event_clicks()</tt>) - <li><tt>fl_add_signal_callback()</tt> - <li><tt>fl_set_form_atactivate()</tt> & <tt>fl_set_form_atdeactivate()</tt> - <li><tt>fl_set_form_property()</tt> - <li><tt>fl_set_app_mainform()</tt>, <tt>fl_get_app_mainform()</tt> - <li><tt>fl_set_form_minsize()</tt>, <tt>fl_set_form_maxsize()</tt> - <li><tt>fl_set_form_event_cmask()</tt>, <tt>fl_get_form_event_cmask()</tt> - <li><tt>fl_set_form_dblbuffer()</tt>, <tt>fl_set_object_dblbuffer()</tt> (use an - <tt>Fl_Double_Window</tt> instead) - <li><tt>fl_adjust_form_size()</tt> - <li><tt>fl_register_raw_callback()</tt> - <li><tt>fl_set_object_bw()</tt>, <tt>fl_set_border_width()</tt> - <li><tt>fl_set_object_resize()</tt>, <tt>fl_set_object_gravity()</tt> - <li><tt>fl_set_object_shortcutkey()</tt> - <li><tt>fl_set_object_automatic()</tt> - <li><tt>fl_get_object_bbox()</tt> (maybe FLTK should do this) - <li><tt>fl_set_object_prehandler()</tt>, <tt>fl_set_object_posthandler()</tt> - <li><tt>fl_enumerate_fonts()</tt> - <li>Most drawing functions - <li><tt>fl_set_coordunit()</tt> (FLTK uses pixels all the time) - <li><tt>fl_ringbell()</tt> - <li><tt>fl_gettime()</tt> - <li><tt>fl_win*()</tt> (all these functions) - <li><tt>fl_initialize(argc,argv,x,y,z)</tt> ignores last 3 arguments - <li><tt>fl_read_bitmapfile()</tt>, <tt>fl_read_pixmapfile()</tt> - <li><tt>fl_addto_browser_chars()</tt> - <li><tt>FL_MENU_BUTTON</tt> just draws normally - <li><tt>fl_set_bitmapbutton_file()</tt>, <tt>fl_set_pixmapbutton_file()</tt> - <li><tt>FL_CANVAS</tt> objects - <li><tt>FL_DIGITAL_CLOCK</tt> (comes out analog) - <li><tt>fl_create_bitmap_cursor()</tt>, <tt>fl_set_cursor_color()</tt> - <li><tt>fl_set_dial_angles()</tt> - <li><tt>fl_show_oneliner()</tt> - <li><tt>fl_set_choice_shortcut(a,b,c) - <li>command log - <li>Only some of file selector is emulated - <li><tt>FL_DATE_INPUT</tt> - <li><tt>fl_pup*()</tt> (all these functions) - <li>textbox object (should be easy but I had no sample programs) - <li>xyplot object -</ul> - -<h2>Additional Notes</h2> - -These notes were written for porting programs written with the older -IRISGL version of Forms. Most of these problems are the same ones -encountered when going from old Forms to XForms: - -<h3>Does Not Run In Background</h3> - -The IRISGL library always forked when you created the first window, unless -"foreground()" was called. FLTK acts like "foreground()" is called all -the time. If you really want the fork behavior do "if (fork()) -exit(0)" right at the start of your program. - -<h3>You Cannot Use IRISGL windows or fl_queue</h3> - -If a Forms (not XForms) program if you wanted your own window for -displaying things you would create a IRISGL window and draw in it, -periodically calling Forms to check if the user hit buttons on the -panels. If the user did things to the IRISGL window, you would find -this out by having the value FL_EVENT returned from the call to Forms. - -<p>None of this works with FLTK. Nor will it compile, the necessary -calls are not in the interface. - -<p>You have to make a subclass of <a -href="#Fl_Gl_Window"><tt>Fl_Gl_Window</tt></a> and write a <tt>draw()</tt> -method and <tt>handle()</tt> method. This may require anywhere from a trivial -to a major rewrite. - -<p>If you draw into the overlay planes you will have to also write a -<tt>draw_overlay()</tt> method and call <tt>redraw_overlay()</tt> on the -OpenGL window. - -<p>One easy way to hack your program so it works is to make the -<tt>draw()</tt> and <tt>handle()</tt> methods on your window set some -static variables, storing what event happened. Then in the main loop -of your program, call <tt>Fl::wait()</tt> and then check these -variables, acting on them as though they are events read from -<tt>fl_queue</tt>. - -<h3>You Must Use OpenGL to Draw Everything</h3> - -<p>The file <tt><FL/gl.h></tt> defines replacements for a lot of -IRISGL calls, translating them to OpenGL. There are much better -translators available that you might want to investigate. - -<h3>You Cannot Make Forms Subclasses</h3> - -Programs that call <tt>fl_make_object</tt> or directly setting the -handle routine will not compile. You have to rewrite them to use a -subclass of <tt>Fl_Widget</tt>. It is important to note that the -<tt>handle()</tt> method is not exactly the same as the -<tt>handle()</tt> function of Forms. Where a Forms <tt>handle()</tt> -returned non-zero, your <tt>handle()</tt> must call -<tt>do_callback()</tt>. And your <tt>handle()</tt> must return non-zero -if it "understood" the event. - -<p>An attempt has been made to emulate the "free" widget. This -appears to work quite well. It may be quicker to modify your subclass -into a "free" widget, since the "handle" functions match. - -<p>If your subclass draws into the overlay you are in trouble and will -have to rewrite things a lot. - -<h3>You Cannot Use <device.h></h3> - -If you have written your own "free" widgets you will probably get a -lot of errors about "getvaluator". You should substitute: - -<table border=1> -<tr> - <th align=center>Forms</th> - <th align=center>FLTK</th> -</tr> -<tr> - <td>MOUSE_X</td> - <td>Fl::event_x_root()</td> -</tr> -<tr> - <td>MOUSE_Y</td> - <td>Fl::event_y_root()</td> -</tr> -<tr> - <td>LEFTSHIFTKEY,RIGHTSHIFTKEY</td> - <td>Fl::event_shift()</td> -</tr> -<tr> - <td>CAPSLOCKKEY</td> - <td>Fl::event_capslock()</td> -</tr> -<tr> - <td>LEFTCTRLKEY,RIGHTCTRLKEY</td> - <td>Fl::event_ctrl()</td> -</tr> -<tr> - <td>LEFTALTKEY,RIGHTALTKEY</td> - <td>Fl::event_alt()</td> -</tr> -<tr> - <td>MOUSE1,RIGHTMOUSE</td> - <td>Fl::event_state()&FL_BUTTON3</td> -</tr> -<tr> - <td>MOUSE2,MIDDLEMOUSE</td> - <td>Fl::event_state()&FL_BUTTON2</td> -</tr> -<tr> - <td>MOUSE3,LEFTMOUSE</td> - <td>Fl::event_state()&FL_BUTTON1</td> -</tr> -</table> - -Anything else in <tt>getvaluator</tt> and you are on your own... - -<h3>Font Numbers Are Different</h3> - -The "style" numbers have been changed because I wanted to insert -bold-italic versions of the normal fonts. If you use Times, Courier, -or Bookman to display any text you will get a different font out of -FLTK. If you are really desperate to fix this use the following code: - -<ul><pre> -fl_font_name(3,"*courier-medium-r-no*"); -fl_font_name(4,"*courier-bold-r-no*"); -fl_font_name(5,"*courier-medium-o-no*"); -fl_font_name(6,"*times-medium-r-no*"); -fl_font_name(7,"*times-bold-r-no*"); -fl_font_name(8,"*times-medium-i-no*"); -fl_font_name(9,"*bookman-light-r-no*"); -fl_font_name(10,"*bookman-demi-r-no*"); -fl_font_name(11,"*bookman-light-i-no*"); -</pre></ul> - -</BODY> -</HTML> + You should be able to compile existing Forms or XForms source code by +changing the include directory switch to your compiler so that the <TT> +forms.h</TT> file supplied with FLTK is included. Take a look at <TT> +forms.h</TT> to see how it works, but the basic trick is lots of inline +functions. Most of the XForms demo programs work without changes. +<P>You will also have to compile your Forms or XForms program using a +C++ compiler. The FLTK library does not provide C bindings or header +files. </P> +<P>Although FLTK was designed to be compatable with the GL Forms +library (version 0.3 or so), XForms has bloated severely and it's +interface is X-specific. Therefore, XForms compatibility is no longer +a goal of FLTK. Compatibility was limited to things that were free, or +that would add code that would not be linked in if the feature is +unused, or that was not X-specific. </P> +<P>To use any new features of FLTK, you should rewrite your code to not +use the inline functions and instead use "pure" FLTK. This will make +it a lot cleaner and make it easier to figure out how to call the FLTK +functions. Unfortunately this conversion is harder than expected and +even Digital Domain's inhouse code still uses <TT>forms.H</TT> a lot. </P> +<H2>Problems you will encounter</H2> +<P>Many parts of XForms use X-specific structures like <TT>XEvent</TT> + in their interface. I did not emulate these! Unfortunately these +features (such as the "canvas" widget) are needed by most large +programs. You will need to rewrite these to use FLTK subclasses. </P> +<P><A href=Fl_Free.html#Fl_Free><TT>Fl_Free</TT></A> widgets emulate +the <I>old</I> Forms "free" widget. It may be useful for porting +programs that change the <TT>handle()</TT> function on widgets, but you +will still need to rewrite things. </P> +<P><A href=Fl_Timer.html#Fl_Timer><TT>Fl_Timer</TT></A> widgets are +provided to emulate the XForms timer. These work, but are quite +inefficient and inaccurate compared to using <A href=functions.html#add_timeout> +<TT>Fl::add_timeout()</TT></A>. </P> +<P><I>All instance variables are hidden.</I> If you directly refer to +the x, y, w, h, label, or other fields of your Forms widgets you will +have to add empty parenthesis after each reference. The easiest way to +do this is to globally replace "->x" with "->x()", etc. Replace +"boxtype" with "box()". </P> +<P><TT>const char *</TT> arguments to most FLTK methods are simply +stored, while Forms would <TT>strdup()</TT> the passed string. This is +most noticable with the label of widgets. Your program must always +pass static data such as a string constant or malloc'd buffer to <TT> +label()</TT>. If you are using labels to display program output you +may want to try the <A href=Fl_Output.html#Fl_Output><TT>Fl_Output</TT></A> + widget. </P> +<P>The default fonts and sizes are matched to the older GL version of +Forms, so all labels will draw somewhat larger than an XForms program +does. </P> +<P>fdesign outputs a setting of a "fdui" instance variable to the main +window. I did not emulate this because I wanted all instance variables +to be hidden. You can store the same information in the <TT>user_data()</TT> + field of a window. To do this, search through the fdesign output for +all occurances of "->fdui" and edit to use "->user_data()" instead. + This will require casts and is not trivial. </P> +<P>The prototype for the functions passed to <TT>fl_add_timeout()</TT> + and <TT>fl_set_idle_callback()</TT> callback are different. </P> +<P><B>All the following XForms calls are missing:</B></P> +<P> +<UL> +<LI><TT>FL_REVISION</TT>, <TT>fl_library_version()</TT></LI> +<LI><TT>FL_RETURN_DBLCLICK</TT> (use <TT>Fl::event_clicks()</TT>) </LI> +<LI><TT>fl_add_signal_callback()</TT></LI> +<LI><TT>fl_set_form_atactivate()</TT> <TT>fl_set_form_atdeactivate()</TT> +</LI> +<LI><TT>fl_set_form_property()</TT></LI> +<LI><TT>fl_set_app_mainform()</TT>, <TT>fl_get_app_mainform()</TT></LI> +<LI><TT>fl_set_form_minsize()</TT>, <TT>fl_set_form_maxsize()</TT></LI> +<LI><TT>fl_set_form_event_cmask()</TT>, <TT>fl_get_form_event_cmask()</TT> +</LI> +<LI><TT>fl_set_form_dblbuffer()</TT>, <TT>fl_set_object_dblbuffer()</TT> + (use an <TT>Fl_Double_Window</TT> instead) </LI> +<LI><TT>fl_adjust_form_size()</TT></LI> +<LI><TT>fl_register_raw_callback()</TT></LI> +<LI><TT>fl_set_object_bw()</TT>, <TT>fl_set_border_width()</TT></LI> +<LI><TT>fl_set_object_resize()</TT>, <TT>fl_set_object_gravity()</TT></LI> +<LI><TT>fl_set_object_shortcutkey()</TT></LI> +<LI><TT>fl_set_object_automatic()</TT></LI> +<LI><TT>fl_get_object_bbox()</TT> (maybe FLTK should do this) </LI> +<LI><TT>fl_set_object_prehandler()</TT>, <TT>fl_set_object_posthandler()</TT> +</LI> +<LI><TT>fl_enumerate_fonts()</TT></LI> +<LI>Most drawing functions </LI> +<LI><TT>fl_set_coordunit()</TT> (FLTK uses pixels all the time) </LI> +<LI><TT>fl_ringbell()</TT></LI> +<LI><TT>fl_gettime()</TT></LI> +<LI><TT>fl_win*()</TT> (all these functions) </LI> +<LI><TT>fl_initialize(argc,argv,x,y,z)</TT> ignores last 3 arguments </LI> +<LI><TT>fl_read_bitmapfile()</TT>, <TT>fl_read_pixmapfile()</TT></LI> +<LI><TT>fl_addto_browser_chars()</TT></LI> +<LI><TT>FL_MENU_BUTTON</TT> just draws normally </LI> +<LI><TT>fl_set_bitmapbutton_file()</TT>, <TT>fl_set_pixmapbutton_file()</TT> +</LI> +<LI><TT>FL_CANVAS</TT> objects </LI> +<LI><TT>FL_DIGITAL_CLOCK</TT> (comes out analog) </LI> +<LI><TT>fl_create_bitmap_cursor()</TT>, <TT>fl_set_cursor_color()</TT></LI> +<LI><TT>fl_set_dial_angles()</TT></LI> +<LI><TT>fl_show_oneliner()</TT></LI> +<LI><TT>fl_set_choice_shortcut(a,b,c) </TT></LI> +<LI>command log </LI> +<LI>Only some of file selector is emulated </LI> +<LI><TT>FL_DATE_INPUT</TT></LI> +<LI><TT>fl_pup*()</TT> (all these functions) </LI> +<LI>textbox object (should be easy but I had no sample programs) </LI> +<LI>xyplot object </LI> +</UL> +<H2>Additional Notes</H2> + These notes were written for porting programs written with the older +IRISGL version of Forms. Most of these problems are the same ones +encountered when going from old Forms to XForms: +<H3>Does Not Run In Background</H3> + The IRISGL library always forked when you created the first window, +unless "foreground()" was called. FLTK acts like "foreground()" is +called all the time. If you really want the fork behavior do "if +(fork()) exit(0)" right at the start of your program. +<H3>You Cannot Use IRISGL windows or fl_queue</H3> + If a Forms (not XForms) program if you wanted your own window for +displaying things you would create a IRISGL window and draw in it, +periodically calling Forms to check if the user hit buttons on the +panels. If the user did things to the IRISGL window, you would find +this out by having the value FL_EVENT returned from the call to Forms. +<P>None of this works with FLTK. Nor will it compile, the necessary +calls are not in the interface. </P> +<P>You have to make a subclass of <A href=Fl_Gl_Window.html#Fl_Gl_Window> +<TT>Fl_Gl_Window</TT></A> and write a <TT>draw()</TT> method and <TT> +handle()</TT> method. This may require anywhere from a trivial to a +major rewrite. </P> +<P>If you draw into the overlay planes you will have to also write a <TT> +draw_overlay()</TT> method and call <TT>redraw_overlay()</TT> on the +OpenGL window. </P> +<P>One easy way to hack your program so it works is to make the <TT> +draw()</TT> and <TT>handle()</TT> methods on your window set some +static variables, storing what event happened. Then in the main loop +of your program, call <TT>Fl::wait()</TT> and then check these +variables, acting on them as though they are events read from <TT> +fl_queue</TT>. </P> +<H3>You Must Use OpenGL to Draw Everything</H3> +<P>The file <TT><FL/gl.h></TT> defines replacements for a lot of IRISGL +calls, translating them to OpenGL. There are much better translators +available that you might want to investigate. </P> +<H3>You Cannot Make Forms Subclasses</H3> + Programs that call <TT>fl_make_object</TT> or directly setting the +handle routine will not compile. You have to rewrite them to use a +subclass of <TT>Fl_Widget</TT>. It is important to note that the <TT> +handle()</TT> method is not exactly the same as the <TT>handle()</TT> + function of Forms. Where a Forms <TT>handle()</TT> returned non-zero, +your <TT>handle()</TT> must call <TT>do_callback()</TT>. And your <TT> +handle()</TT> must return non-zero if it "understood" the event. +<P>An attempt has been made to emulate the "free" widget. This appears +to work quite well. It may be quicker to modify your subclass into a +"free" widget, since the "handle" functions match. </P> +<P>If your subclass draws into the overlay you are in trouble and will +have to rewrite things a lot. </P> +<H3>You Cannot Use <device.h></H3> + If you have written your own "free" widgets you will probably get a +lot of errors about "getvaluator". You should substitute: +<TABLE border=1> +<TR><TH align=center>Forms</TH><TH align=center>FLTK</TH></TR> +<TR><TD>MOUSE_X</TD><TD>Fl::event_x_root()</TD></TR> +<TR><TD>MOUSE_Y</TD><TD>Fl::event_y_root()</TD></TR> +<TR><TD>LEFTSHIFTKEY,RIGHTSHIFTKEY</TD><TD>Fl::event_shift()</TD></TR> +<TR><TD>CAPSLOCKKEY</TD><TD>Fl::event_capslock()</TD></TR> +<TR><TD>LEFTCTRLKEY,RIGHTCTRLKEY</TD><TD>Fl::event_ctrl()</TD></TR> +<TR><TD>LEFTALTKEY,RIGHTALTKEY</TD><TD>Fl::event_alt()</TD></TR> +<TR><TD>MOUSE1,RIGHTMOUSE</TD><TD>Fl::event_state()</TD></TR> +<TR><TD>MOUSE2,MIDDLEMOUSE</TD><TD>Fl::event_state()</TD></TR> +<TR><TD>MOUSE3,LEFTMOUSE</TD><TD>Fl::event_state()</TD></TR> +</TABLE> + Anything else in <TT>getvaluator</TT> and you are on your own... +<H3>Font Numbers Are Different</H3> + The "style" numbers have been changed because I wanted to insert +bold-italic versions of the normal fonts. If you use Times, Courier, +or Bookman to display any text you will get a different font out of +FLTK. If you are really desperate to fix this use the following code: +<UL> +<PRE> +fl_font_name(3,"*courier-medium-r-no*"); +fl_font_name(4,"*courier-bold-r-no*"); +fl_font_name(5,"*courier-medium-o-no*"); +fl_font_name(6,"*times-medium-r-no*"); +fl_font_name(7,"*times-bold-r-no*"); +fl_font_name(8,"*times-medium-i-no*"); +fl_font_name(9,"*bookman-light-r-no*"); +fl_font_name(10,"*bookman-demi-r-no*"); +fl_font_name(11,"*bookman-light-i-no*"); +</PRE> +</UL> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/functions.html b/documentation/functions.html index 9bea40ce4..815d11dd0 100644 --- a/documentation/functions.html +++ b/documentation/functions.html @@ -1,319 +1,241 @@ -<HTML> -<BODY> - +<HTML><BODY> <H1 ALIGN=RIGHT><A NAME=functions>B - Function Reference</A></H1> - -This appendix describes all of the <tt>fl_</tt> functions and -<tt>Fl::</tt> methods. For a description of the FLTK widgets, see <a -href="#widgets">Appendix A</a>. - + This appendix describes all of the <TT>fl_</TT> functions and <TT>Fl::</TT> + methods. For a description of the FLTK widgets, see <A href=widgets.html#widgets> +Appendix A</A>. <H2>Functions</H2> - -<h3><a name="fl_color_chooser">int fl_color_chooser(const char*, double &r, double &g, double &b)<br> -int fl_color_chooser(const char *, uchar &r, uchar &g, uchar &b)</a></h3> - -The double version takes RGB values in the range 0.0 to 1.0. The -uchar version takes RGB values in the range 0 to 255. - -<center><img src="fl_color_chooser.jpg"></center> - -<p><tt>fl_color_chooser()</tt> pops up a window to let the user pick an -arbitrary RGB color. They can pick the hue and saturation in the "hue -box" on the left (hold down CTRL to just change the saturation), and -the brighness using the vertical slider. Or they can type the 8-bit -numbers into the RGB <a -href="#Fl_Value_Input"><tt>Fl_Value_Input</tt></a> fields, or drag the -mouse across them to adjust them. The pull-down menu lets the user set -the input fields to show RGB, HSV, or 8-bit RGB (0 to 255). - -<p>This returns non-zero if the user picks ok, and updates the RGB -values. If the user picks cancel or closes the window this returns -zero and leaves RGB unchanged. - -<p>If you use the color chooser on an 8-bit screen, it will allocate -all the available colors, leaving you no space to exactly represent -the color the user picks! You can however use <a -href="#fl_rectf"><tt>fl_rectf()</tt></a> to fill a region with a -simulated color using dithering. - -<h3><a name="fl_show_colormap">int fl_show_colormap(int oldcol)</a></h3> - -<tt>fl_show_colormap()</tt> pops up a panel of the 256 colors you -can access with <a href="#fl_color"><tt>fl_color()</tt></a> and lets the -user pick one of them. It returns the new color index, or the old one -if the user types ESC or clicks outside the window. - -<center><img src="fl_show_colormap.gif"></center> - -<h3><a name="fl_message">void fl_message(const char *, ...)</a></h3> - -Displays a printf-style message in a pop-up box with an "OK" -button, waits for the user to hit the button. The message will wrap -to fit the window, or may be many lines by putting <tt>\n</tt> characters into -it. The enter key is a shortcut for the OK button. - -<center><img src="fl_message.gif"></center> - -<h3><a name="fl_">void fl_alert(const char *, ...)</a></h3> - -Same as <tt>fl_message()</tt> except for the "!" symbol. - -<center><img src="fl_alert.gif"></center> - -<h3><a name="fl_ask">int fl_ask(const char *, ...)</a></h3> - -Displays a printf-style message in a pop-up box with an "Yes" and "No" -button and waits for the user to hit a button. The return value is 1 -if the user hits Yes, 0 if they pick No. The enter key is a shortcut -for Yes and ESC is a shortcut for No. - -<center><img src="fl_ask.gif"></center> - -<h3><a name="fl_choice">int fl_choice(const char *q, const char *b0, const char *b1, const char *b2, ...)</a></h3> - -Shows the message with three buttons below it marked with the strings -<tt>b0</tt>, <tt>b1</tt>, and <tt>b2</tt>. Returns 0, 1, or 2 -depending on which button is hit. ESC is a shortcut for button 0 and -the enter key is a shortcut for button 1. Notice the "misordered" -position of the buttons. You can hide buttons by passing <tt>NULL</tt> -as their labels. - -<center><img src="fl_choice.gif"></center> - -<h3><a name="fl_input">const char *fl_input(const char *label, const char *deflt = 0, ...)</a></h3> - -Pops up a window displaying a string, lets the user edit it, and return -the new value. The cancel button returns <tt>NULL</tt>. <i>The -returned pointer is only valid until the next time <tt>fl_input()</tt> -is called</i>. Due to back-compatability, the arguments to any printf -commands in the label are after the default value. - -<center><img src="fl_input.gif"></center> - -<h3><a name="fl_password">const char *fl_password(const char *label, const char *deflt = 0, ...)</a></h3> - -Same as <tt>fl_input()</tt> except an <a -href="#Fl_Secret_Input"><tt>Fl_Secret_Input</tt></a> field is used. - -<center><img src="fl_password.gif"></center> - -<h3><a name="fl_message_font">void fl_message_font(Fl_Font fontid, uchar size)</a></h3> - -Change the font and font size used for the messages in all the popups. - -<h3><a name="fl_message_icon">Fl_Widget *fl_message_icon()</a></h3> - -Returns a pointer to the box at the left edge of all the popups. You -can alter the font, color, or label (including making it a Pixmap), -before calling the functions. - -<h3><a name="fl_file_chooser">char *fl_file_chooser(const char * message, const char *pattern, const char *fname)</a></h3> - -FLTK provides a "tab completion" file chooser that makes it easy to -choose files from large directories. This file chooser has several -unique features, the major one being that the Tab key completes -filenames like it does in Emacs or tcsh, and the list always shows all -possible completions. - -<center><img src="filechooser.gif"></center> - -<tt>fl_file_chooser()</tt> pops up the file chooser, waits for the user -to pick a file or Cancel, and then returns a pointer to that filename -or <tt>NULL</tt> if Cancel is chosen. - -<p><tt>message</tt> is a string used to title the window. - -<p><tt>pattern</tt> is used to limit the files listed in a directory to -those matching the pattern. This matching is done by <a -href="#filename_match"><tt>filename_match()</tt></a>. Use -<tt>NULL</tt> to show all files. - -<p><tt>fname</tt> is a default filename to fill in the chooser with. If -this is <tt>NULL</tt> then the last filename that was choosen is used (unless -that had a different pattern, in which case just the last directory -with no name is used). The first time the file chooser is called this -defaults to a blank string. - -<p>The returned value points at a static buffer that is only good -until the next time <tt>fl_file_chooser()</tt> is called. - -<h3><a name="fl_file_chooser_callback">void fl_file_chooser_callback(void (*cb)(const char *))</a></h3> - -Set a function that is called every time the user clicks a file in the -currently popped-up file chooser. This could be used to preview the -contents of the file. It has to be reasonably fast, and cannot create -FLTK windows. - -<h3><a name="filename_list">int filename_list(const char *d, dirent ***list)</a></h3> - -This is a portable and const-correct wrapper for the -<tt>fl_scandir</tt> function. <tt>d</tt> is the name of a directory -(it does not matter if it has a trailing slash or not). For each file -in that directory a "dirent" structure is created. The only portable -thing about a dirent is that dirent.d_name is the nul-terminated file -name. An array of pointers to these dirents is created and a pointer -to the array is returned in <tt>*list</tt>. The number of entries is -given as a return value. If there is an error reading the directory a -number less than zero is returned, and <tt>errno</tt> has the reason -(<tt>errno</tt> does not work under WIN32). The files are sorted in -"alphanumeric" order, where an attempt is made to put unpadded numbers -in consecutive order. - -<p>You can free the returned list of files with the following code: - -<ul><pre> -for (int i = return_value; i > 0;) free((void*)(list[--i])); +<H3><A name=fl_color_chooser>int fl_color_chooser(const char*, double +&r, double &g, double &b) +<BR> int fl_color_chooser(const char *, uchar &r, uchar &g, uchar &b)</A> +</H3> + The double version takes RGB values in the range 0.0 to 1.0. The +uchar version takes RGB values in the range 0 to 255. +<CENTER><IMG src=./fl_color_chooser.jpg></CENTER> +<P><TT>fl_color_chooser()</TT> pops up a window to let the user pick an +arbitrary RGB color. They can pick the hue and saturation in the "hue +box" on the left (hold down CTRL to just change the saturation), and +the brighness using the vertical slider. Or they can type the 8-bit +numbers into the RGB <A href=Fl_Value_Input.html#Fl_Value_Input><TT> +Fl_Value_Input</TT></A> fields, or drag the mouse across them to adjust +them. The pull-down menu lets the user set the input fields to show +RGB, HSV, or 8-bit RGB (0 to 255). </P> +<P>This returns non-zero if the user picks ok, and updates the RGB +values. If the user picks cancel or closes the window this returns +zero and leaves RGB unchanged. </P> +<P>If you use the color chooser on an 8-bit screen, it will allocate +all the available colors, leaving you no space to exactly represent the +color the user picks! You can however use <A href=#fl_rectf><TT> +fl_rectf()</TT></A> to fill a region with a simulated color using +dithering. </P> +<H3><A name=fl_show_colormap>int fl_show_colormap(int oldcol)</A></H3> +<TT>fl_show_colormap()</TT> pops up a panel of the 256 colors you can +access with <A href=#fl_color><TT>fl_color()</TT></A> and lets the user +pick one of them. It returns the new color index, or the old one if +the user types ESC or clicks outside the window. +<CENTER><IMG src=./fl_show_colormap.gif></CENTER> +<H3><A name=fl_message>void fl_message(const char *, ...)</A></H3> + Displays a printf-style message in a pop-up box with an "OK" button, +waits for the user to hit the button. The message will wrap to fit the +window, or may be many lines by putting <TT>\n</TT> characters into it. + The enter key is a shortcut for the OK button. +<CENTER><IMG src=./fl_message.gif></CENTER> +<H3><A name=fl_>void fl_alert(const char *, ...)</A></H3> + Same as <TT>fl_message()</TT> except for the "!" symbol. +<CENTER><IMG src=./fl_alert.gif></CENTER> +<H3><A name=fl_ask>int fl_ask(const char *, ...)</A></H3> + Displays a printf-style message in a pop-up box with an "Yes" and "No" +button and waits for the user to hit a button. The return value is 1 +if the user hits Yes, 0 if they pick No. The enter key is a shortcut +for Yes and ESC is a shortcut for No. +<CENTER><IMG src=./fl_ask.gif></CENTER> +<H3><A name=fl_choice>int fl_choice(const char *q, const char *b0, +const char *b1, const char *b2, ...)</A></H3> + Shows the message with three buttons below it marked with the strings <TT> +b0</TT>, <TT>b1</TT>, and <TT>b2</TT>. Returns 0, 1, or 2 depending on +which button is hit. ESC is a shortcut for button 0 and the enter key +is a shortcut for button 1. Notice the "misordered" position of the +buttons. You can hide buttons by passing <TT>NULL</TT> as their +labels. +<CENTER><IMG src=./fl_choice.gif></CENTER> +<H3><A name=fl_input>const char *fl_input(const char *label, const char +*deflt = 0, ...)</A></H3> + Pops up a window displaying a string, lets the user edit it, and +return the new value. The cancel button returns <TT>NULL</TT>. <I>The +returned pointer is only valid until the next time <TT>fl_input()</TT> + is called</I>. Due to back-compatability, the arguments to any printf +commands in the label are after the default value. +<CENTER><IMG src=./fl_input.gif></CENTER> +<H3><A name=fl_password>const char *fl_password(const char *label, +const char *deflt = 0, ...)</A></H3> + Same as <TT>fl_input()</TT> except an <A href=Fl_Secret_Input.html#Fl_Secret_Input> +<TT>Fl_Secret_Input</TT></A> field is used. +<CENTER><IMG src=./fl_password.gif></CENTER> +<H3><A name=fl_message_font>void fl_message_font(Fl_Font fontid, uchar +size)</A></H3> + Change the font and font size used for the messages in all the popups. +<H3><A name=fl_message_icon>Fl_Widget *fl_message_icon()</A></H3> + Returns a pointer to the box at the left edge of all the popups. You +can alter the font, color, or label (including making it a Pixmap), +before calling the functions. +<H3><A name=fl_file_chooser>char *fl_file_chooser(const char * message, +const char *pattern, const char *fname)</A></H3> + FLTK provides a "tab completion" file chooser that makes it easy to +choose files from large directories. This file chooser has several +unique features, the major one being that the Tab key completes +filenames like it does in Emacs or tcsh, and the list always shows all +possible completions. +<CENTER><IMG src=./filechooser.gif></CENTER> +<TT>fl_file_chooser()</TT> pops up the file chooser, waits for the user +to pick a file or Cancel, and then returns a pointer to that filename +or <TT>NULL</TT> if Cancel is chosen. +<P><TT>message</TT> is a string used to title the window. </P> +<P><TT>pattern</TT> is used to limit the files listed in a directory to +those matching the pattern. This matching is done by <A href=#filename_match> +<TT>filename_match()</TT></A>. Use <TT>NULL</TT> to show all files. </P> +<P><TT>fname</TT> is a default filename to fill in the chooser with. + If this is <TT>NULL</TT> then the last filename that was choosen is +used (unless that had a different pattern, in which case just the last +directory with no name is used). The first time the file chooser is +called this defaults to a blank string. </P> +<P>The returned value points at a static buffer that is only good until +the next time <TT>fl_file_chooser()</TT> is called. </P> +<H3><A name=fl_file_chooser_callback>void fl_file_chooser_callback(void +(*cb)(const char *))</A></H3> + Set a function that is called every time the user clicks a file in the +currently popped-up file chooser. This could be used to preview the +contents of the file. It has to be reasonably fast, and cannot create +FLTK windows. +<H3><A name=filename_list>int filename_list(const char *d, dirent +***list)</A></H3> + This is a portable and const-correct wrapper for the <TT>fl_scandir</TT> + function. <TT>d</TT> is the name of a directory (it does not matter if +it has a trailing slash or not). For each file in that directory a +"dirent" structure is created. The only portable thing about a dirent +is that dirent.d_name is the nul-terminated file name. An array of +pointers to these dirents is created and a pointer to the array is +returned in <TT>*list</TT>. The number of entries is given as a return +value. If there is an error reading the directory a number less than +zero is returned, and <TT>errno</TT> has the reason (<TT>errno</TT> + does not work under WIN32). The files are sorted in "alphanumeric" +order, where an attempt is made to put unpadded numbers in consecutive +order. +<P>You can free the returned list of files with the following code: </P> +<UL> +<PRE> +for (int i = return_value; i > 0;) free((void*)(list[--i])); free((void*)list); -</pre></ul> - -<h3><a name="filename_isdir">int filename_isdir(const char *f)</a></h3> - -Returns non-zero if the file exists and is a directory. - -<h3><a name="filename_name">const char *filename_name(const char *f)</a></h3> - -Returns a pointer to the character after the last slash, or to the -start of the filename if there is none. - -<h3><a name="filename_ext">const char *filename_ext(const char *f)</a></h3> - -Returns a pointer to the last period in <tt>filename_name(f)</tt>, or -a pointer to the trailing nul if none. - -<h3><a name="filename_setext">char *filename_setext(char *f, const char *ext)</a></h3> - -Does <tt>strcpy(filename_ext(f), ext ? ext : "")</tt>. Returns a -pointer to <tt>f</tt>. - -<h3><a name="filename_expand">int filename_expand(char *out, const char *in)</a></h3> - -Splits <tt>in</tt> at each slash character. Replaces any occurrance of -<tt>$X</tt> with <tt>getenv("X")</tt> (leaving it as <tt>$X</tt> if the -environment variable does not exist). Replaces any occurances of -<tt>~X</tt> with user <tt>X</tt>'s home directory (leaving it as -<tt>~X</tt> if the user does not exist). Any resulting double slashes -cause everything before the second slash to be deleted. Copies the -result to <tt>out</tt> (<tt>in</tt> and <tt>out</tt> may be the same -buffer). Returns non-zero if any changes were made. <i>In true retro -programming style, it is up to you to provide a buffer big enough for -the result. 1024 characters should be enough.</i> - -<h3><a name="filename_absolute">int filename_absolute(char *out, const char *in)</a></h3> - -If <tt>in</tt> does not start with a slash, this prepends the current -working directory to <tt>in</tt> and then deletes any occurances of -<tt>.</tt> and </tt>x/..</tt> from the result, which it copies to -<tt>out</tt> (<tt>in</tt> and <tt>out</tt> may be the same buffer). -Returns non-zero if any changes were made. <i>In true retro -programming style, it is up to you to provide a buffer big enough for -the result. 1024 characters should be enough.</i> - -<h3><a name="filename_match">int filename_match(const char *f, const char *pattern)</a></h3> - -Returns true if <tt>f</tt> matches <tt>pattern</tt>. The following syntax -is used by <tt>pattern</tt>: - -<ul> - - <li><tt>*</tt> matches any sequence of 0 or more characters. - - <li><tt>?</tt> matches any single character. - - <li><tt>[set]</tt> matches any character in the set. Set - can contain any single characters, or a-z to represent a range. To - match ] or - they must be the first characters. To match ^ or ! they - must not be the first characters. - - <li><tt>[^set]</b> or <b>[!set]</tt> matches any character - not in the set. - - <li><tt>{X|Y|Z}</b> or <b>{X,Y,Z}</tt> matches any one of - the subexpressions literally. - - <li><tt>\x</tt> quotes the character x so it has no special - meaning. - - <li><tt>x</tt> all other characters must be matched exactly. -</ul> - +</PRE> +</UL> +<H3><A name=filename_isdir>int filename_isdir(const char *f)</A></H3> + Returns non-zero if the file exists and is a directory. +<H3><A name=filename_name>const char *filename_name(const char *f)</A></H3> + Returns a pointer to the character after the last slash, or to the +start of the filename if there is none. +<H3><A name=filename_ext>const char *filename_ext(const char *f)</A></H3> + Returns a pointer to the last period in <TT>filename_name(f)</TT>, or +a pointer to the trailing nul if none. +<H3><A name=filename_setext>char *filename_setext(char *f, const char +*ext)</A></H3> + Does <TT>strcpy(filename_ext(f), ext ? ext : "")</TT>. Returns a +pointer to <TT>f</TT>. +<H3><A name=filename_expand>int filename_expand(char *out, const char +*in)</A></H3> + Splits <TT>in</TT> at each slash character. Replaces any occurrance +of <TT>$X</TT> with <TT>getenv("X")</TT> (leaving it as <TT>$X</TT> if +the environment variable does not exist). Replaces any occurances of <TT> +~X</TT> with user <TT>X</TT>'s home directory (leaving it as <TT>~X</TT> + if the user does not exist). Any resulting double slashes cause +everything before the second slash to be deleted. Copies the result to <TT> +out</TT> (<TT>in</TT> and <TT>out</TT> may be the same buffer). + Returns non-zero if any changes were made. <I>In true retro +programming style, it is up to you to provide a buffer big enough for +the result. 1024 characters should be enough.</I> +<H3><A name=filename_absolute>int filename_absolute(char *out, const +char *in)</A></H3> + If <TT>in</TT> does not start with a slash, this prepends the current +working directory to <TT>in</TT> and then deletes any occurances of <TT> +.</TT> and x/.. from the result, which it copies to <TT>out</TT> (<TT>in</TT> + and <TT>out</TT> may be the same buffer). Returns non-zero if any +changes were made. <I>In true retro programming style, it is up to you +to provide a buffer big enough for the result. 1024 characters should +be enough.</I> +<H3><A name=filename_match>int filename_match(const char *f, const char +*pattern)</A></H3> + Returns true if <TT>f</TT> matches <TT>pattern</TT>. The following +syntax is used by <TT>pattern</TT>: +<UL> +<LI><TT>*</TT> matches any sequence of 0 or more characters. </LI> +<LI><TT>?</TT> matches any single character. </LI> +<LI><TT>[set]</TT> matches any character in the set. Set can contain +any single characters, or a-z to represent a range. To match ] or - +they must be the first characters. To match ^ or ! they must not be +the first characters. </LI> +<LI><TT>[^set] or <B>[!set]</B></TT> matches any character not in the +set. </LI> +<LI><TT>{X|Y|Z} or <B>{X,Y,Z}</B></TT> matches any one of the +subexpressions literally. </LI> +<LI><TT>\x</TT> quotes the character x so it has no special meaning. </LI> +<LI><TT>x</TT> all other characters must be matched exactly. </LI> +</UL> <H2>Fl:: Methods</H2> - -<h3><a name="add_fd">static void Fl::add_fd(int fd, void (*cb)(int, void *), void * = 0)<br> -static void Fl::add_fd(int fd, int when, void (*cb)(int, void *), void * = 0)</a><br> -<a name="remove_fd">static void Fl::remove_fd(int)</a></h3> - -Add file descriptor <tt>fd</tt> to listen to. When the <tt>fd</tt> -becomes ready for reading the callback is done. The callback is passed -the <tt>fd</tt> and the arbitrary <tt>void *</tt> argument. -<tt>Fl::wait()</tt> will return immediately after calling the callback. - -<p>The second version takes a <tt>when</tt> bitfield, with the bits -<tt>FL_READ</tt>, <tt>FL_WRITE</tt>, and <tt>FL_EXCEPT</tt> defined, to -indicate when the callback should be done. - -<p>There can only be one callback of each type for a file descriptor. -<tt>Fl::remove_fd()</tt> gets rid of <i>all</i> the callbacks for a -given file descriptor. - -<p>Under UNIX <i>any</i> file descriptor can be monitored (files, -devices, pipes, sockets, etc.) Due to limitations in Microsoft Windows, -WIN32 applications can only monitor sockets. - -<h3><a name="add_handler">static void Fl::add_handler(int (*f)(int))</h3> - -Install a function to parse unrecognized events. If FLTK cannot figure -out what to do with an event, it calls each of these functions (most -recent first) until one of them returns non-zero. If none of them -returns non zero then the event is ignored. Events that cause this to -be called are: - -<ul> - - <li><tt>FL_SHORTCUT</tt> events that are not recognized by any - widget. This lets you provide global shortcut keys. - - <li>System events that FLTK does not recognize. See <a - href="#fl_xevent"><tt>fl_xevent</tt></a>. - - <li><i>Some</i> other events when the widget FLTK selected - returns zero from its <tt>handle()</tt> method. Exactly which - ones may change in future versions, however. - -</ul> - -<h3><a name="add_idle">static Fl::add_idle(void (*cb)(void *), void *)</a></h3> - -Adds a callback function that is called by <tt>Fl::wait()</tt> when there -is nothing to do. This can be used for background -processing. - -<p><i>Warning: this can absorb all your machine's time!</i> - -<p>You can have multiple idle callbacks. To remove an idle callback -use <a href="#remove_idle"><tt>Fl::remove_idle()</tt></a>. - -<p>Only <tt>Fl::wait()</tt> calls the idle callbacks. -<tt>Fl::wait(time)</tt>, <tt>Fl::check()</tt>, and <tt>Fl::ready()</tt> -ignore them so that these functions may be called by the idle callbacks -themselves without having to worry about recursion. - -<p>The idle callback can call any FLTK functions. However if you call -something that calls <tt>Fl::wait()</tt> (such as a message pop-up) you -should first remove the idle callback so that it does not recurse. - -<h3><a name="add_timeout">static void Fl::add_timeout(float t, void (*cb)(void *),void *v=0)</a></h3> - -Add a one-shot timeout callback. The timeout will happen as soon as -possible after <tt>t</tt> seconds after the last time <tt>wait()</tt> -was called. The optional <tt>void *</tt> argument is passed to the -callback. - -<p>This code will print "TICK" each second on stdout, no matter what -else the user or program does: - -<ul><pre> +<H3><A name=add_fd>static void Fl::add_fd(int fd, void (*cb)(int, void +*), void * = 0) +<BR> static void Fl::add_fd(int fd, int when, void (*cb)(int, void *), +void * = 0)</A> +<BR><A name=remove_fd>static void Fl::remove_fd(int)</A></H3> + Add file descriptor <TT>fd</TT> to listen to. When the <TT>fd</TT> + becomes ready for reading the callback is done. The callback is +passed the <TT>fd</TT> and the arbitrary <TT>void *</TT> argument. <TT> +Fl::wait()</TT> will return immediately after calling the callback. +<P>The second version takes a <TT>when</TT> bitfield, with the bits <TT> +FL_READ</TT>, <TT>FL_WRITE</TT>, and <TT>FL_EXCEPT</TT> defined, to +indicate when the callback should be done. </P> +<P>There can only be one callback of each type for a file descriptor. <TT> +Fl::remove_fd()</TT> gets rid of <I>all</I> the callbacks for a given +file descriptor. </P> +<P>Under UNIX <I>any</I> file descriptor can be monitored (files, +devices, pipes, sockets, etc.) Due to limitations in Microsoft Windows, +WIN32 applications can only monitor sockets. </P> +<H3><A name=add_handler>static void Fl::add_handler(int (*f)(int))</A></H3> + Install a function to parse unrecognized events. If FLTK cannot +figure out what to do with an event, it calls each of these functions +(most recent first) until one of them returns non-zero. If none of +them returns non zero then the event is ignored. Events that cause +this to be called are: +<UL> +<LI><TT>FL_SHORTCUT</TT> events that are not recognized by any widget. + This lets you provide global shortcut keys. </LI> +<LI>System events that FLTK does not recognize. See <A href=osissues.html#fl_xevent> +<TT>fl_xevent</TT></A>. </LI> +<LI><I>Some</I> other events when the widget FLTK selected returns +zero from its <TT>handle()</TT> method. Exactly which ones may change +in future versions, however. </LI> +</UL> +<H3><A name=add_idle>static Fl::add_idle(void (*cb)(void *), void *)</A></H3> + Adds a callback function that is called by <TT>Fl::wait()</TT> when +there is nothing to do. This can be used for background processing. +<P><I>Warning: this can absorb all your machine's time!</I></P> +<P>You can have multiple idle callbacks. To remove an idle callback use <A +href=#remove_idle><TT>Fl::remove_idle()</TT></A>. </P> +<P>Only <TT>Fl::wait()</TT> calls the idle callbacks. <TT>Fl::wait(time)</TT> +, <TT>Fl::check()</TT>, and <TT>Fl::ready()</TT> ignore them so that +these functions may be called by the idle callbacks themselves without +having to worry about recursion. </P> +<P>The idle callback can call any FLTK functions. However if you call +something that calls <TT>Fl::wait()</TT> (such as a message pop-up) you +should first remove the idle callback so that it does not recurse. </P> +<H3><A name=add_timeout>static void Fl::add_timeout(float t, void +(*cb)(void *),void *v=0)</A></H3> + Add a one-shot timeout callback. The timeout will happen as soon as +possible after <TT>t</TT> seconds after the last time <TT>wait()</TT> + was called. The optional <TT>void *</TT> argument is passed to the +callback. +<P>This code will print "TICK" each second on stdout, no matter what +else the user or program does: </P> +<UL> +<PRE> void callback(void *) { - printf("TICK\n"); + printf("TICK\n"); Fl::add_timeout(1.0,callback); } @@ -321,519 +243,385 @@ main() { Fl::add_timeout(1.0,callback); Fl::run(); } -</pre></ul> - -<h3><a name="arg">static int Fl::arg(int argc, char **argv, int &i)</a></h3> - -Consume a single switch from <tt>argv</tt>, starting at word -</tt>i</tt>. Returns the number of words eaten (1 or 2, or 0 if it is -not recognized) and adds the same value to <tt>i</tt>. You can use this -function if you prefer to control the incrementing through the -arguments yourself. - -<h3><a name="args">static int Fl::args(int argc, char **argv, int &i, int (*callback)(int, char**,int &)=0)<br> -void Fl::args(int argc, char **argv)</a></h3> - -FLTK provides an <i>entirely optional</i> command-line switch parser. -You don't have to call it if you don't like them! Everything it can do -can be done with other calls to FLTK. - -<p>To use the switch parser, call <tt>Fl::args(...)</tt> near the start of -your program. This does <i>not</i> open the display, instead switches -that need the display open are stashed into static variables. Then -you <i>must</i> display your first window by calling -<a href="#Fl_Window.show">window->show(argc,argv)</a>, which will do anything -stored in the static variables. - -<p><tt>callback</tt> lets you define your own switches. It is called -with the same <tt>argc</tt> and <tt>argv</tt>, and with <tt>i</tt> the index of each word. -The callback should return zero if the switch is unrecognized, and not -change <tt>i</tt>. It should return non-zero if the switch is recognized, and -add at least 1 to <tt>i</tt> (it can add more to consume words after the -switch). This function is called before any other tests, so you can -override any FLTK switch. - -<p>On return <tt>i</tt> is set to the index of the first non-switch. -This is either: - -<ul> - - <li>The first word that does not start with '-'. - - <li>The word '-' (used by many programs to name stdin as a file) - - <li>The first unrecognized switch (return value is 0). - - <li><tt>argc</tt> - -</ul> - -The return value is <tt>i</tt> unless an unrecognized switch is -found, in which case it is zero. If your program takes no arguments -other than switches you should produce an error if the return value is -less than <tt>argc</tt>. - -<p>All switches may be abbreviated to two letters and case is ignored: - -<ul> - - <li><tt>-display host:n.n</tt> The X display to use (ignored - under WIN32). - - <li><tt>-geometry WxH+X+Y</tt> The window position and size - will be modified according the the standard X geometry string. - - <li><tt>-name string</tt> Fl_Window::xclass(string) will be - done to the window, possibly changing its icon. - - <li><tt>-title string</tt> Fl_Window::label(string) will be - done to the window, changing both its title and the icontitle. - - <li><tt>-iconic</tt> Fl_Window::iconize() will be done to - the window. - - <li><tt>-bg color</tt> XParseColor is used to lookup the - passed color and then Fl::background() is done. Under WIN32 - only color names of the form "#xxxxxx" are understood. - - <li><tt>-bg2 color</tt> XParseColor is used to lookup the - passed color and then Fl::background2() is done. - - <li><tt>-fg color</tt> XParseColor is used to lookup the - passed color and then Fl::foreground() is done. - -</ul> - -The second form of <tt>Fl::args()</tt> is useful if your program does -not have command line switches of its own. It parses all the switches, -and if any are not recognized it calls <tt>Fl::abort(Fl::help)</tt>. - -<h3><a name="background">static void Fl::background(uchar, uchar, uchar)</a></h3> - -Changes <tt>fl_color(FL_GRAY)</tt> to the given color, and changes -the gray ramp from 32 to 56 to black to white. These are the colors -used as backgrounds by almost all widgets and used to draw the edges -of all the boxtypes. - -<h3><a name="background2">static void Fl::background2(uchar, uchar, uchar)</a></h3> - -Changes <tt>fl_color(FL_WHITE)</tt> and the same colors as -<tt>Fl::foreground()</tt>. This color is used as a background by -<tt>Fl_Input</tt> and other text widgets. - -<h3><a name="belowmouse">static Fl_Widget *Fl::belowmouse() const<br> -static void Fl::belowmouse(Fl_Widget *)</h3> - -Get or set the widget that is below the mouse. This is for -highlighting buttons. It is not used to send <tt>FL_PUSH</tt> or -<tt>FL_MOVE</tt> directly, for several obscure reasons, but those -events typically go to this widget. This is also the first widget -tried for <tt>FL_SHORTCUT</tt> events. - -<p>If you change the belowmouse widget, the previous one and all -parents (that don't contain the new widget) are sent <tt>FL_LEAVE</tt> -events. Changing this does <i>not</i> send <tt>FL_ENTER</tt> to this -or any widget, because sending <tt>FL_ENTER</tt> is supposed to -<i>test</i> if the widget wants the mouse (by it returning non-zero -from <tt>handle()</tt>). - -<h3><a name="box_dh">static int Fl::box_dh(Fl_Boxtype)</a></h3> - -Returns the height offset for the given boxtype. - -<h3><a name="box_dw">static int Fl::box_dw(Fl_Boxtype)</a></h3> - -Returns the width offset for the given boxtype. - -<h3><a name="box_dx">static int Fl::box_dx(Fl_Boxtype)</a></h3> - -Returns the X offset for the given boxtype. - -<h3><a name="box_dy">static int Fl::box_dy(Fl_Boxtype)</a></h3> - -Returns the Y offset for the given boxtype. - -<h3><a name="check">static int Fl::check()</a></h3> - -This does the same thing as <tt>Fl::wait(0)</tt>, except because it does not -have to return the elapsed time value it can be implemented faster on -certain systems. Use this to interrupt a big calculation: - -<ul><pre> +</PRE> +</UL> +<H3><A name=arg>static int Fl::arg(int argc, char **argv, int &i)</A></H3> + Consume a single switch from <TT>argv</TT>, starting at word i. + Returns the number of words eaten (1 or 2, or 0 if it is not +recognized) and adds the same value to <TT>i</TT>. You can use this +function if you prefer to control the incrementing through the +arguments yourself. +<H3><A name=args>static int Fl::args(int argc, char **argv, int &i, int +(*callback)(int, char**,int &)=0) +<BR> void Fl::args(int argc, char **argv)</A></H3> + FLTK provides an <I>entirely optional</I> command-line switch parser. + You don't have to call it if you don't like them! Everything it can do +can be done with other calls to FLTK. +<P>To use the switch parser, call <TT>Fl::args(...)</TT> near the start +of your program. This does <I>not</I> open the display, instead +switches that need the display open are stashed into static variables. +Then you <I>must</I> display your first window by calling <A href=Fl_Window.html#Fl_Window.show> +window->show(argc,argv)</A>, which will do anything stored in the +static variables. </P> +<P><TT>callback</TT> lets you define your own switches. It is called +with the same <TT>argc</TT> and <TT>argv</TT>, and with <TT>i</TT> the +index of each word. The callback should return zero if the switch is +unrecognized, and not change <TT>i</TT>. It should return non-zero if +the switch is recognized, and add at least 1 to <TT>i</TT> (it can add +more to consume words after the switch). This function is called +before any other tests, so you can override any FLTK switch. </P> +<P>On return <TT>i</TT> is set to the index of the first non-switch. +This is either: </P> +<UL> +<LI>The first word that does not start with '-'. </LI> +<LI>The word '-' (used by many programs to name stdin as a file) </LI> +<LI>The first unrecognized switch (return value is 0). </LI> +<LI><TT>argc</TT></LI> +</UL> + The return value is <TT>i</TT> unless an unrecognized switch is found, +in which case it is zero. If your program takes no arguments other +than switches you should produce an error if the return value is less +than <TT>argc</TT>. +<P>All switches may be abbreviated to two letters and case is ignored: </P> +<UL> +<LI><TT>-display host:n.n</TT> The X display to use (ignored under +WIN32). </LI> +<LI><TT>-geometry WxH+X+Y</TT> The window position and size will be +modified according the the standard X geometry string. </LI> +<LI><TT>-name string</TT> Fl_Window::xclass(string) will be done to +the window, possibly changing its icon. </LI> +<LI><TT>-title string</TT> Fl_Window::label(string) will be done to +the window, changing both its title and the icontitle. </LI> +<LI><TT>-iconic</TT> Fl_Window::iconize() will be done to the window. </LI> +<LI><TT>-bg color</TT> XParseColor is used to lookup the passed color +and then Fl::background() is done. Under WIN32 only color names of +the form "#xxxxxx" are understood. </LI> +<LI><TT>-bg2 color</TT> XParseColor is used to lookup the passed color +and then Fl::background2() is done. </LI> +<LI><TT>-fg color</TT> XParseColor is used to lookup the passed color +and then Fl::foreground() is done. </LI> +</UL> + The second form of <TT>Fl::args()</TT> is useful if your program does +not have command line switches of its own. It parses all the switches, +and if any are not recognized it calls <TT>Fl::abort(Fl::help)</TT>. +<H3><A name=background>static void Fl::background(uchar, uchar, uchar)</A> +</H3> + Changes <TT>fl_color(FL_GRAY)</TT> to the given color, and changes the +gray ramp from 32 to 56 to black to white. These are the colors used +as backgrounds by almost all widgets and used to draw the edges of all +the boxtypes. +<H3><A name=background2>static void Fl::background2(uchar, uchar, uchar)</A> +</H3> + Changes <TT>fl_color(FL_WHITE)</TT> and the same colors as <TT> +Fl::foreground()</TT>. This color is used as a background by <TT> +Fl_Input</TT> and other text widgets. +<H3><A name=belowmouse>static Fl_Widget *Fl::belowmouse() const +<BR> static void Fl::belowmouse(Fl_Widget *)</A></H3> + Get or set the widget that is below the mouse. This is for +highlighting buttons. It is not used to send <TT>FL_PUSH</TT> or <TT> +FL_MOVE</TT> directly, for several obscure reasons, but those events +typically go to this widget. This is also the first widget tried for <TT> +FL_SHORTCUT</TT> events. +<P>If you change the belowmouse widget, the previous one and all +parents (that don't contain the new widget) are sent <TT>FL_LEAVE</TT> + events. Changing this does <I>not</I> send <TT>FL_ENTER</TT> to this +or any widget, because sending <TT>FL_ENTER</TT> is supposed to <I>test</I> + if the widget wants the mouse (by it returning non-zero from <TT> +handle()</TT>). </P> +<H3><A name=box_dh>static int Fl::box_dh(Fl_Boxtype)</A></H3> + Returns the height offset for the given boxtype. +<H3><A name=box_dw>static int Fl::box_dw(Fl_Boxtype)</A></H3> + Returns the width offset for the given boxtype. +<H3><A name=box_dx>static int Fl::box_dx(Fl_Boxtype)</A></H3> + Returns the X offset for the given boxtype. +<H3><A name=box_dy>static int Fl::box_dy(Fl_Boxtype)</A></H3> + Returns the Y offset for the given boxtype. +<H3><A name=check>static int Fl::check()</A></H3> + This does the same thing as <TT>Fl::wait(0)</TT>, except because it +does not have to return the elapsed time value it can be implemented +faster on certain systems. Use this to interrupt a big calculation: +<UL> +<PRE> while (!calculation_done()) { calculate(); Fl::check(); if (user_hit_abort_button()) break; } -</pre></ul> - -This returns non-zero if any windows are displayed, and 0 if no -windows are displayed. - -<h3><a name="damage">static int Fl::damage()</a></h3> - -If true then <a href="#flush"><tt>flush()</tt></a> will do something. - -<h3><a name="display">static void Fl::display(const char *)</a></h3> - -Sets the X display to use for all windows. This function is ignored -under WIN32. - -<h3><a name="enable_symbols">static void Fl::enable_symbols()</a></h3> - -Enables the symbol drawing code. - -<h3><a name="event_button">static int Fl::event_button()</a></h3> - -Returns which mouse button was pressed. This returns garbage if the -most recent event was not a <tt>FL_PUSH</tt> or <tt>FL_RELEASE</tt> -event. - -<h3><a name="event_clicks">int Fl::event_clicks()<br> -void Fl::event_clicks(int)</a></h3> - -The first form returns non-zero if the most recent <tt>FL_PUSH</tt> or -<tt>FL_KEYBOARD</tt> was a "double click". Returns N-1 for N clicks. -A double click is counted if the same button is pressed again while -<tt>event_is_click()</tt> is true. - -<p>The second form directly sets the number returned by -<tt>Fl::event_clicks()</tt>. This can be used to set it to zero so -that later code does not think an item was double-clicked. - -<h3><a name="event_inside">int Fl::event_inside(const Fl_Widget *) const<br> -int Fl::event_inside(int x, int y, int w, int h)</a></h3> - -Returns non-zero if the current <tt>event_x</tt> and <tt>event_y</tt> -put it inside the widget or inside an arbitrary bounding box. You -should always call this rather than doing your own comparison so you -are consistent about edge effects. - -<h3><a name="event_is_click">int Fl::event_is_click()<br> -void Fl::event_is_click(0)</a></h3> - -The first form returns non-zero if the mouse has not moved far enough -and not enough time has passed since the last <tt>FL_PUSH</tt> or -<tt>FL_KEYBOARD</tt> event for it to be considered a "drag" rather than -a "click". You can test this on <tt>FL_DRAG</tt>, <tt>FL_RELEASE</tt>, -and <tt>FL_MOVE</tt> events. - -The second form clears the value returned by -<tt>Fl::event_is_click()</tt>. Useful to prevent the <i>next</i> click -from being counted as a double-click or to make a popup menu pick an -item with a single click. Don't pass non-zero to this. - -<h3><a name="event_key">int Fl::event_key()<br> -int Fl::event_key(int)</a><br> -<a name="get_key">int Fl::get_key(int)</a></h3> - -<tt>Fl::event_key()</tt> returns which key on the keyboard was last pushed. - -<p><tt>Fl::event_key(int)</tt> returns true if the given key was held -down (or pressed) <i>during</i> the last event. This is constant until -the next event is read from the server. - -<p><tt>Fl::get_key(int)</tt> returns true if the given key is held down -<i>now</i>. Under X this requires a round-trip to the server and is -<i>much</i> slower than <tt>Fl::event_key(int)</tt>. - -<p>Keys are identified by the <i>unshifted</i> values. FLTK defines a -set of symbols that should work on most modern machines for every key -on the keyboard: - -<ul> - - <li>All keys on the main keyboard producing a printable ASCII - character use the value of that ASCII character (as though shift, - ctrl, and caps lock were not on). The space bar is 32. - - <li>All keys on the numeric keypad producing a printable ASCII - character use the value of that ASCII character plus - <tt>FL_KP</tt>. The highest possible value is - <tt>FL_KP_Last</tt> so you can range-check to see if something is - on the keypad. - - <li>All numbered function keys use the number on the function key plus - <tt>FL_F</tt>. The highest possible number is - <tt>FL_F_Last</tt>, so you can range-check a value. - - <li>Buttons on the mouse are considered keys, and use the button - number (where the left button is 1) plus <tt>FL_Button</tt>. - - <li>All other keys on the keypad have a symbol: <tt>FL_Escape, - FL_BackSpace, FL_Tab, FL_Enter, FL_Print, FL_Scroll_Lock, FL_Pause, - FL_Insert, FL_Home, FL_Page_Up, FL_Delete, FL_End, FL_Page_Down, - FL_Left, FL_Up, FL_Right, FL_Down, FL_Shift_L, FL_Shift_R, - FL_Control_L, FL_Control_R, FL_Caps_Lock, FL_Alt_L, FL_Alt_R, - FL_Meta_L, FL_Meta_R, FL_Menu, FL_Num_Lock, FL_KP_Enter</tt>. Be - careful not to confuse these with the very similar, but all-caps, - symbols used by <a href="#event_state"><tt>Fl::event_state()</tt></a>. - -</ul> - -On X <tt>Fl::get_key(FL_Button+n)</tt> does not work. - -<p>On WIN32 <tt>Fl::get_key(FL_KP_Enter)</tt> and -<tt>Fl::event_key(FL_KP_Enter)</tt> do not work. - -<h3><a name="event_length">char *Fl::event_length()</a></h3> - -Returns the length of the text in <tt>Fl::event_text()</tt>. There -will always be a nul at this position in the text. However there may -be a nul before that if the keystroke translates to a nul character or -you paste a nul character. - -<h3><a name="event_state">ulong Fl::event_state()<br> -unsigned int Fl::event_state(ulong)</h3> - -This is a bitfield of what shift states were on and what mouse buttons -were held down during the most recent event. The second version -returns non-zero if any of the passed bits are turned on. The legal -bits are: - -<ul> - <li><tt>FL_SHIFT</tt> - <li><tt>FL_CAPS_LOCK</tt> - <li><tt>FL_CTRL</tt> - <li><tt>FL_ALT</tt> - <li><tt>FL_NUM_LOCK</tt> - <li><tt>FL_META</tt> - <li><tt>FL_SCROLL_LOCK</tt> - <li><tt>FL_BUTTON1</tt> - <li><tt>FL_BUTTON2</tt> - <li><tt>FL_BUTTON3</tt> -</ul> - -X servers do not agree on shift states, and FL_NUM_LOCK, FL_META, -and FL_SCROLL_LOCK may not work. The values were selected to match -the XFree86 server on Linux. In addition there is a bug in the way -X works so that the shift state is not correctly reported until the -first event <i>after</i> the shift key is pressed or released. - -<h3><a name="event_text">char *Fl::event_text()</a></h3> - -Returns the ASCII text (in the future this may be UTF-8) produced by -the last <tt>FL_KEYBOARD</tt> or <tt>FL_PASTEM</tt> or possibly other -event. A zero-length string is returned for any keyboard function keys -that do not produce text. This pointer points at a static buffer and is -only valid until the next event is processed. - -<p>Under X this is the result of calling <tt>XLookupString()</tt>. - -<h3><a name="event_x">static int Fl::event_x()<br> -<a name="event_y">static int Fl::event_y()</a></h3> - -Returns the mouse position of the event relative to the <tt>Fl_Window</tt> it -was passed to. - -<h3><a name="event_x_root">static int Fl::event_x_root()<br> -<a name="event_y_root">static int Fl::event_y_root()</a></h3> - -Returns the mouse position on the screen of the event. To find the -absolute position of an <tt>Fl_Window</tt> on the screen, use the difference -between <tt>event_x_root(),event_y_root()</tt> and -<tt>event_x(),event_y()</tt>. - -<h3><a name="first_window">static Fl_Window *Fl::first_window()</a></h3> - -Returns the first top-level window in the widget hierarchy. - -<h3><a name="flush">static void Fl::flush()</a></h3> - -Causes all the windows that need it to be redrawn and graphics forced -out through the pipes. This is what <tt>wait()</tt> does before -looking for events. - -<h3><a name="focus">static Fl_Widget *Fl::focus() const<br> -static void Fl::focus(Fl_Widget *)</a></h3> - -Get or set the widget that will receive <tt>FL_KEYBOARD</tt> events. - -<p>If you change <tt>Fl::focus()</tt>, the previous widget and all -parents (that don't contain the new widget) are sent -<tt>FL_UNFOCUS</tt> events. Changing the focus does <i>not</i> send -<tt>FL_FOCUS</tt> to this or any widget, because sending -<tt>FL_FOCUS</tt> is supposed to <i>test</i> if the widget wants the -focus (by it returning non-zero from <tt>handle()</tt>). - -<h3><a name="foreground">static void Fl::foreground(uchar, uchar, uchar)</a></h3> - -Changes <tt>fl_color(FL_BLACK)</tt>. Also changes -<tt>FL_INACTIVE_COLOR</tt> and <tt>FL_SELECTION_COLOR</tt> to -be a ramp between this and <tt>FL_WHITE</tt>. - -<h3><a name="free_color">static void Fl::free_color(Fl_Color, int overlay = 0)</a></h3> - -Frees the specified color from the colormap, if applicable. If -<tt>overlay</tt> is non-zero then the color is freed from the overlay -colormap. - -<h3><a name="get_color">static unsigned Fl::get_color(Fl_Color)<br> -static void Fl::get_color(Fl_Color, uchar &r, uchar &g, uchar &b)</a></h3> - -Returns the color index or RGB value for the given FLTK color index. - -<h3><a name="get_font">static const char *Fl::get_font(int face)</h4> - -Get the string for this face. This string is different for each face. -Under X this value is passed to XListFonts to get all the sizes of -this face. - -<h3><a name="get_font_name">static const char *Fl::get_font_name(int face, int *attributes = 0)</a></h3> - -Get a human-readable string describing the family of this face. This -is useful if you are presenting a choice to the user. There is no -guarantee that each face has a different name. The return value -points to a static buffer that is overwritten each call. - -<p>The integer pointed to by <tt>attributes</tt> (if the pointer is not -zero) is set to zero, <tt>FL_BOLD</tt> or <tt>FL_ITALIC</tt> or -<tt>FL_BOLD | FL_ITALIC</tt>. To locate a "family" of fonts, search -forward and back for a set with non-zero attributes, these faces along -with the face with a zero attribute before them constitute a family. - -<h3><a name="get_font_sizes">int get_font_sizes(int face, int *&sizep)</a></h3> - -Return an array of sizes in <tt>sizep</tt>. The return value is the -length of this array. The sizes are sorted from smallest to largest -and indicate what sizes can be given to <tt>fl_font()</tt> that will be -matched exactly (<tt>fl_font()</tt> will pick the closest size for -other sizes). A zero in the first location of the array indicates a -scalable font, where any size works, although the array may list sizes -that work "better" than others. Warning: the returned array points at -a static buffer that is overwritten each call. Under X this will open -the display. - -<h3><a name="get_mouse">static void Fl::get_mouse(int &x, int &y)</a></h3> - -Return where the mouse is on the screen by doing a round-trip query to -the server. You should use <tt>Fl::event_x_root()</tt> and -<tt>Fl::event_y_root()</tt> if possible, but this is necessary if you -are not sure if a mouse event has been processed recently (such as to -position your first window). If the display is not open, this will -open it. - -<h3><a name="get_system_colors">static void Fl::get_system_colors()</a></h3> - -Read the user preference colors from the system and use them to call -<tt>Fl::foreground()</tt>, <tt>Fl::background()</tt>, and -<tt>Fl::background2()</tt>. This is done by -<tt>Fl_Window::show(argc,argv)</tt> before applying the -fg and -bg -switches. - -<p>Currently this only does something on WIN32. In future versions for -X it may read the window manager (KDE, Gnome, etc.) setup as well. - -<h3><a name="gl_visual">static int Fl::gl_visual(int)</a></h3> - -This does the same thing as <a -href="#visual"><tt>Fl::visual(int)</tt></a> but also requires OpenGL -drawing to work. This <i>must</i> be done if you want to draw in -normal windows with OpenGL with <a -href="#gl_start"><tt>gl_start()</tt></a> and <tt>gl_end()</tt>. It may -be useful to call this so your X windows use the same visual as an <a -href="#Fl_Gl_Window"><tt>Fl_Gl_Window</tt></a>, which on some servers -will reduce colormap flashing. - -<p>See <a href="#Fl_Gl_Window.mode"><tt>Fl_Gl_Window</tt></a> for a -list of additional values for the argument. - -<h3><a name="grab">static void Fl::grab(Fl_Window &)<br> -static Fl_Window *Fl::grab()</h3> - -This is used when pop-up menu systems are active. Send all events to -the passed window no matter where the pointer or focus is (including in -other programs). The window <i>does not have to be -<tt>shown()</tt></i>, this lets the <tt>handle()</tt> method of a -"dummy" window override all event handling and allows you to map and -unmap a complex set of windows (under both X and WIN32 <i>some</i> -window must be mapped because the system interface needs a window id). - -<p><tt>Fl::event_x()</tt> and <tt>Fl::event_y()<.tt> are undefined if -the passed widget is not a mapped <tt>Fl_Window</tt>. Use -<tt>Fl::event_x_root()</tt> and <tt>Fl::event_y_root()</tt> instead. - -<p><i>Be careful that your program does not enter an infinite loop -while <tt>grab()</tt> is on. On X this will lock up your screen!</i> - -<p>The second function returns the current grab window, or <tt>NULL</tt> if -none. - -<h3><a name="h">static int Fl::h()</a></h3> - -Returns the height of the screen in pixels. - -<h3><a name="handle">static int Fl::handle(int, Fl_Window *)</a></h3> - -Sends the event to a window for processing. Returns non-zero if any -widget uses the event. - -<h3><a name="help">static const char *Fl::help</a></h3> - -This is the usage string that is displayed if <tt>Fl::args()</tt> -detects an invalid argument on the command-line. - -<h3><a name="modal">static Fl_Window *Fl::modal()</h3> - -The <tt>modal()</tt> window has its <tt>handle()</tt> method called for -all events, and no other windows will have <tt>handle()</tt> called. -If <a href="#grab"><tt>grab()</tt></a> has been done then this is equal -to <tt>grab()</tt>. Otherwise this is the most recently -<tt>shown()</tt> window with <a -href="#Fl_Window.modal"><tt>modal()</tt></a> true, or <tt>NULL</tt> if -there are no <tt>modal()</tt> windows <tt>shown()</tt>. - -<h3><a name="next_window">static Fl_Window *Fl::next_window(Fl_Window *)</a></h3> - -Returns the next top-level window in the widget hierarchy. - -<h3><a name="own_colormap">static void Fl::own_colormap()</a></h3> - -Makes FLTK use its own colormap. This may make FLTK display -better and will reduce conflicts with other programs that want lots of -colors. However the colors may flash as you move the cursor between -windows. - -<p>This does nothing if the current visual is not colormapped. - -<h3><a name="paste">static void Fl::paste(Fl_Widget *receiver)</a></h3> - -Set things up so the receiver widget will be called with an <a -href="#FL_PASTE"><tt>FL_PASTE</tt></a> event some time in the future. -The reciever should be prepared to be called <i>directly</i> by this, -or for it to happen <i>later</i>, or possibly <i>not at all</i>. This -allows the window system to take as long as necessary to retrieve the -paste buffer (or even to screw up completely) without complex and -error-prone synchronization code in FLTK. - -<h3><a name="pushed">static Fl_Widget *Fl::pushed() const<br> -static void Fl::pushed(Fl_Widget *)</h3> - -Get or set the widget that is being pushed. <tt>FL_DRAG</tt> or -<tt>FL_RELEASE</tt> (and any more <tt>FL_PUSH</tt>) events will be sent -to this widget. - -<p>If you change the pushed widget, the previous one and all parents -(that don't contain the new widget) are sent <tt>FL_RELEASE</tt> -events. Changing this does <i>not</i> send <tt>FL_PUSH</tt> to this or -any widget, because sending <tt>FL_PUSH</tt> is supposed to <i>test</i> -if the widget wants the mouse (by it returning non-zero from -<tt>handle()</tt>). - -<h3><a name="readqueue">static Fl_Widget *Fl::readqueue()</a></h3> - -All <tt>Fl_Widgets</tt> that don't have a callback defined use a -default callback that puts a pointer to the widget in this queue, and -this method reads the oldest widget out of this queue. - -<h3><a name="ready">static int Fl::ready()</a></h3> - -Returns non-zero if there are pending timeouts or events or file -descriptors. This does <i>not</i> call <tt>Fl::flush()</tt> or any -callbacks, which is useful if your program is in a state where such -callbacks are illegal: - -<ul><pre> +</PRE> +</UL> + This returns non-zero if any windows are displayed, and 0 if no +windows are displayed. +<H3><A name=damage>static int Fl::damage()</A></H3> + If true then <A href=#flush><TT>flush()</TT></A> will do something. +<H3><A name=display>static void Fl::display(const char *)</A></H3> + Sets the X display to use for all windows. This function is ignored +under WIN32. +<H3><A name=enable_symbols>static void Fl::enable_symbols()</A></H3> + Enables the symbol drawing code. +<H3><A name=event_button>static int Fl::event_button()</A></H3> + Returns which mouse button was pressed. This returns garbage if the +most recent event was not a <TT>FL_PUSH</TT> or <TT>FL_RELEASE</TT> + event. +<H3><A name=event_clicks>int Fl::event_clicks() +<BR> void Fl::event_clicks(int)</A></H3> + The first form returns non-zero if the most recent <TT>FL_PUSH</TT> or <TT> +FL_KEYBOARD</TT> was a "double click". Returns N-1 for N clicks. A +double click is counted if the same button is pressed again while <TT> +event_is_click()</TT> is true. +<P>The second form directly sets the number returned by <TT> +Fl::event_clicks()</TT>. This can be used to set it to zero so that +later code does not think an item was double-clicked. </P> +<H3><A name=event_inside>int Fl::event_inside(const Fl_Widget *) const +<BR> int Fl::event_inside(int x, int y, int w, int h)</A></H3> + Returns non-zero if the current <TT>event_x</TT> and <TT>event_y</TT> + put it inside the widget or inside an arbitrary bounding box. You +should always call this rather than doing your own comparison so you +are consistent about edge effects. +<H3><A name=event_is_click>int Fl::event_is_click() +<BR> void Fl::event_is_click(0)</A></H3> + The first form returns non-zero if the mouse has not moved far enough +and not enough time has passed since the last <TT>FL_PUSH</TT> or <TT> +FL_KEYBOARD</TT> event for it to be considered a "drag" rather than a +"click". You can test this on <TT>FL_DRAG</TT>, <TT>FL_RELEASE</TT>, +and <TT>FL_MOVE</TT> events. The second form clears the value returned +by <TT>Fl::event_is_click()</TT>. Useful to prevent the <I>next</I> + click from being counted as a double-click or to make a popup menu +pick an item with a single click. Don't pass non-zero to this. +<H3><A name=event_key>int Fl::event_key() +<BR> int Fl::event_key(int)</A> +<BR><A name=get_key>int Fl::get_key(int)</A></H3> +<TT>Fl::event_key()</TT> returns which key on the keyboard was last +pushed. +<P><TT>Fl::event_key(int)</TT> returns true if the given key was held +down (or pressed) <I>during</I> the last event. This is constant until +the next event is read from the server. </P> +<P><TT>Fl::get_key(int)</TT> returns true if the given key is held down <I> +now</I>. Under X this requires a round-trip to the server and is <I> +much</I> slower than <TT>Fl::event_key(int)</TT>. </P> +<P>Keys are identified by the <I>unshifted</I> values. FLTK defines a +set of symbols that should work on most modern machines for every key +on the keyboard: </P> +<UL> +<LI>All keys on the main keyboard producing a printable ASCII + character use the value of that ASCII character (as though shift, + ctrl, and caps lock were not on). The space bar is 32. </LI> +<LI>All keys on the numeric keypad producing a printable ASCII + character use the value of that ASCII character plus <TT>FL_KP</TT>. + The highest possible value is <TT>FL_KP_Last</TT> so you can +range-check to see if something is on the keypad. </LI> +<LI>All numbered function keys use the number on the function key plus <TT> +FL_F</TT>. The highest possible number is <TT>FL_F_Last</TT>, so you +can range-check a value. </LI> +<LI>Buttons on the mouse are considered keys, and use the button + number (where the left button is 1) plus <TT>FL_Button</TT>. </LI> +<LI>All other keys on the keypad have a symbol: <TT>FL_Escape, + FL_BackSpace, FL_Tab, FL_Enter, FL_Print, FL_Scroll_Lock, FL_Pause, + FL_Insert, FL_Home, FL_Page_Up, FL_Delete, FL_End, FL_Page_Down, + FL_Left, FL_Up, FL_Right, FL_Down, FL_Shift_L, FL_Shift_R, + FL_Control_L, FL_Control_R, FL_Caps_Lock, FL_Alt_L, FL_Alt_R, + FL_Meta_L, FL_Meta_R, FL_Menu, FL_Num_Lock, FL_KP_Enter</TT>. Be + careful not to confuse these with the very similar, but all-caps, + symbols used by <A href=events.html#event_state><TT>Fl::event_state()</TT> +</A>. </LI> +</UL> + On X <TT>Fl::get_key(FL_Button+n)</TT> does not work. +<P>On WIN32 <TT>Fl::get_key(FL_KP_Enter)</TT> and <TT> +Fl::event_key(FL_KP_Enter)</TT> do not work. </P> +<H3><A name=event_length>char *Fl::event_length()</A></H3> + Returns the length of the text in <TT>Fl::event_text()</TT>. There +will always be a nul at this position in the text. However there may +be a nul before that if the keystroke translates to a nul character or +you paste a nul character. +<H3><A name=event_state>ulong Fl::event_state() +<BR> unsigned int Fl::event_state(ulong)</A></H3> + This is a bitfield of what shift states were on and what mouse buttons +were held down during the most recent event. The second version +returns non-zero if any of the passed bits are turned on. The legal +bits are: +<UL> +<LI><TT>FL_SHIFT</TT></LI> +<LI><TT>FL_CAPS_LOCK</TT></LI> +<LI><TT>FL_CTRL</TT></LI> +<LI><TT>FL_ALT</TT></LI> +<LI><TT>FL_NUM_LOCK</TT></LI> +<LI><TT>FL_META</TT></LI> +<LI><TT>FL_SCROLL_LOCK</TT></LI> +<LI><TT>FL_BUTTON1</TT></LI> +<LI><TT>FL_BUTTON2</TT></LI> +<LI><TT>FL_BUTTON3</TT></LI> +</UL> + X servers do not agree on shift states, and FL_NUM_LOCK, FL_META, and +FL_SCROLL_LOCK may not work. The values were selected to match the +XFree86 server on Linux. In addition there is a bug in the way X works +so that the shift state is not correctly reported until the first event <I> +after</I> the shift key is pressed or released. +<H3><A name=event_text>char *Fl::event_text()</A></H3> + Returns the ASCII text (in the future this may be UTF-8) produced by +the last <TT>FL_KEYBOARD</TT> or <TT>FL_PASTEM</TT> or possibly other +event. A zero-length string is returned for any keyboard function keys +that do not produce text. This pointer points at a static buffer and is +only valid until the next event is processed. +<P>Under X this is the result of calling <TT>XLookupString()</TT>. </P> +<H3><A name=event_x>static int Fl::event_x() +<BR><A name=event_y>static int Fl::event_y()</A></A></H3> + Returns the mouse position of the event relative to the <TT>Fl_Window</TT> + it was passed to. +<H3><A name=event_x_root>static int Fl::event_x_root() +<BR><A name=event_y_root>static int Fl::event_y_root()</A></A></H3> + Returns the mouse position on the screen of the event. To find the +absolute position of an <TT>Fl_Window</TT> on the screen, use the +difference between <TT>event_x_root(),event_y_root()</TT> and <TT> +event_x(),event_y()</TT>. +<H3><A name=first_window>static Fl_Window *Fl::first_window()</A></H3> + Returns the first top-level window in the widget hierarchy. +<H3><A name=flush>static void Fl::flush()</A></H3> + Causes all the windows that need it to be redrawn and graphics forced +out through the pipes. This is what <TT>wait()</TT> does before +looking for events. +<H3><A name=focus>static Fl_Widget *Fl::focus() const +<BR> static void Fl::focus(Fl_Widget *)</A></H3> + Get or set the widget that will receive <TT>FL_KEYBOARD</TT> events. +<P>If you change <TT>Fl::focus()</TT>, the previous widget and all +parents (that don't contain the new widget) are sent <TT>FL_UNFOCUS</TT> + events. Changing the focus does <I>not</I> send <TT>FL_FOCUS</TT> to +this or any widget, because sending <TT>FL_FOCUS</TT> is supposed to <I> +test</I> if the widget wants the focus (by it returning non-zero from <TT> +handle()</TT>). </P> +<H3><A name=foreground>static void Fl::foreground(uchar, uchar, uchar)</A> +</H3> + Changes <TT>fl_color(FL_BLACK)</TT>. Also changes <TT> +FL_INACTIVE_COLOR</TT> and <TT>FL_SELECTION_COLOR</TT> to be a ramp +between this and <TT>FL_WHITE</TT>. +<H3><A name=free_color>static void Fl::free_color(Fl_Color, int overlay += 0)</A></H3> + Frees the specified color from the colormap, if applicable. If <TT> +overlay</TT> is non-zero then the color is freed from the overlay +colormap. +<H3><A name=get_color>static unsigned Fl::get_color(Fl_Color) +<BR> static void Fl::get_color(Fl_Color, uchar &r, uchar &g, uchar &b)</A> +</H3> + Returns the color index or RGB value for the given FLTK color index. +<H3><A name=get_font>static const char *Fl::get_font(int face) Get the +string for this face. This string is different for each face. Under X +this value is passed to XListFonts to get all the sizes of this face. </A> +</H3> +<H3><A name=get_font_name>static const char *Fl::get_font_name(int +face, int *attributes = 0)</A></H3> + Get a human-readable string describing the family of this face. This +is useful if you are presenting a choice to the user. There is no +guarantee that each face has a different name. The return value points +to a static buffer that is overwritten each call. +<P>The integer pointed to by <TT>attributes</TT> (if the pointer is not +zero) is set to zero, <TT>FL_BOLD</TT> or <TT>FL_ITALIC</TT> or <TT> +FL_BOLD | FL_ITALIC</TT>. To locate a "family" of fonts, search +forward and back for a set with non-zero attributes, these faces along +with the face with a zero attribute before them constitute a family. </P> +<H3><A name=get_font_sizes>int get_font_sizes(int face, int *&sizep)</A></H3> + Return an array of sizes in <TT>sizep</TT>. The return value is the +length of this array. The sizes are sorted from smallest to largest +and indicate what sizes can be given to <TT>fl_font()</TT> that will be +matched exactly (<TT>fl_font()</TT> will pick the closest size for +other sizes). A zero in the first location of the array indicates a +scalable font, where any size works, although the array may list sizes +that work "better" than others. Warning: the returned array points at +a static buffer that is overwritten each call. Under X this will open +the display. +<H3><A name=get_mouse>static void Fl::get_mouse(int &x, int &y)</A></H3> + Return where the mouse is on the screen by doing a round-trip query to +the server. You should use <TT>Fl::event_x_root()</TT> and <TT> +Fl::event_y_root()</TT> if possible, but this is necessary if you are +not sure if a mouse event has been processed recently (such as to +position your first window). If the display is not open, this will +open it. +<H3><A name=get_system_colors>static void Fl::get_system_colors()</A></H3> + Read the user preference colors from the system and use them to call <TT> +Fl::foreground()</TT>, <TT>Fl::background()</TT>, and <TT> +Fl::background2()</TT>. This is done by <TT>Fl_Window::show(argc,argv)</TT> + before applying the -fg and -bg switches. +<P>Currently this only does something on WIN32. In future versions for +X it may read the window manager (KDE, Gnome, etc.) setup as well. </P> +<H3><A name=gl_visual>static int Fl::gl_visual(int)</A></H3> + This does the same thing as <A href=#visual><TT>Fl::visual(int)</TT></A> + but also requires OpenGL drawing to work. This <I>must</I> be done if +you want to draw in normal windows with OpenGL with <A href=opengl.html#gl_start> +<TT>gl_start()</TT></A> and <TT>gl_end()</TT>. It may be useful to +call this so your X windows use the same visual as an <A href=Fl_Gl_Window.html#Fl_Gl_Window> +<TT>Fl_Gl_Window</TT></A>, which on some servers will reduce colormap +flashing. +<P>See <A href=Fl_Gl_Window.html#Fl_Gl_Window.mode><TT>Fl_Gl_Window</TT></A> + for a list of additional values for the argument. </P> +<H3><A name=grab>static void Fl::grab(Fl_Window static Fl_Window +*Fl::grab()</A></H3> + This is used when pop-up menu systems are active. Send all events to +the passed window no matter where the pointer or focus is (including in +other programs). The window <I>does not have to be <TT>shown()</TT></I> +, this lets the <TT>handle()</TT> method of a "dummy" window override +all event handling and allows you to map and unmap a complex set of +windows (under both X and WIN32 <I>some</I> window must be mapped +because the system interface needs a window id). +<P><TT>Fl::event_x()</TT> and <TT>Fl::event_y() +<!--.tt--> + are undefined if the +passed widget is not a mapped <TT>Fl_Window</TT>. Use <TT> +Fl::event_x_root()</TT> and <TT>Fl::event_y_root()</TT> instead. </TT></P> +<P><I>Be careful that your program does not enter an infinite loop +while <TT>grab()</TT> is on. On X this will lock up your screen!</I></P> +<P>The second function returns the current grab window, or <TT>NULL</TT> + if none. </P> +<H3><A name=h>static int Fl::h()</A></H3> + Returns the height of the screen in pixels. +<H3><A name=handle>static int Fl::handle(int, Fl_Window *)</A></H3> + Sends the event to a window for processing. Returns non-zero if any +widget uses the event. +<H3><A name=help>static const char *Fl::help</A></H3> + This is the usage string that is displayed if <TT>Fl::args()</TT> + detects an invalid argument on the command-line. +<H3><A name=modal>static Fl_Window *Fl::modal()</A></H3> + The <TT>modal()</TT> window has its <TT>handle()</TT> method called +for all events, and no other windows will have <TT>handle()</TT> + called. If <A href=#grab><TT>grab()</TT></A> has been done then this +is equal to <TT>grab()</TT>. Otherwise this is the most recently <TT> +shown()</TT> window with <A href=Fl_Window.html#Fl_Window.modal><TT> +modal()</TT></A> true, or <TT>NULL</TT> if there are no <TT>modal()</TT> + windows <TT>shown()</TT>. +<H3><A name=next_window>static Fl_Window *Fl::next_window(Fl_Window *)</A> +</H3> + Returns the next top-level window in the widget hierarchy. +<H3><A name=own_colormap>static void Fl::own_colormap()</A></H3> + Makes FLTK use its own colormap. This may make FLTK display better +and will reduce conflicts with other programs that want lots of colors. + However the colors may flash as you move the cursor between windows. +<P>This does nothing if the current visual is not colormapped. </P> +<H3><A name=paste>static void Fl::paste(Fl_Widget *receiver)</A></H3> + Set things up so the receiver widget will be called with an <A href=#FL_PASTE> +<TT>FL_PASTE</TT></A> event some time in the future. The reciever +should be prepared to be called <I>directly</I> by this, or for it to +happen <I>later</I>, or possibly <I>not at all</I>. This allows the +window system to take as long as necessary to retrieve the paste buffer +(or even to screw up completely) without complex and error-prone +synchronization code in FLTK. +<H3><A name=pushed>static Fl_Widget *Fl::pushed() const +<BR> static void Fl::pushed(Fl_Widget *)</A></H3> + Get or set the widget that is being pushed. <TT>FL_DRAG</TT> or <TT> +FL_RELEASE</TT> (and any more <TT>FL_PUSH</TT>) events will be sent to +this widget. +<P>If you change the pushed widget, the previous one and all parents +(that don't contain the new widget) are sent <TT>FL_RELEASE</TT> + events. Changing this does <I>not</I> send <TT>FL_PUSH</TT> to this +or any widget, because sending <TT>FL_PUSH</TT> is supposed to <I>test</I> + if the widget wants the mouse (by it returning non-zero from <TT> +handle()</TT>). </P> +<H3><A name=readqueue>static Fl_Widget *Fl::readqueue()</A></H3> + All <TT>Fl_Widgets</TT> that don't have a callback defined use a +default callback that puts a pointer to the widget in this queue, and +this method reads the oldest widget out of this queue. +<H3><A name=ready>static int Fl::ready()</A></H3> + Returns non-zero if there are pending timeouts or events or file +descriptors. This does <I>not</I> call <TT>Fl::flush()</TT> or any +callbacks, which is useful if your program is in a state where such +callbacks are illegal: +<UL> +<PRE> while (!calculation_done()) { calculate(); if (Fl::ready()) { @@ -842,225 +630,176 @@ while (!calculation_done()) { if (user_hit_abort_button()) break; } } -</pre></ul> - -<h3><a name="redraw">static void Fl::redraw()</a></h3> - -Redraws all widgets. - -<h3><a name="release">static void Fl::release()</a></h3> - -Turn off the <tt>grab()</tt> behavior. - -<h3><a name="remove_idle">static void Fl::remove_idle(void (*cb)(void *), void *= 0)</a></h3> - -Removes the specified idle callback. - -<h3><a name="remove_timeout">static void Fl::remove_timeout(void (*cb)(void *), void *= 0)</a></h3> - -Removes a timeout callback. It is harmless to remove a timeout callback -that no longer exists. - -<h3><a name="run">static Fl::run()</a></h3> - -Runs FLTK until there are no windows displayed, and then returns a zero. -<tt>Fl::run()</tt> is <i>exactly equivalent to:</i> - -<ul><pre> +</PRE> +</UL> +<H3><A name=redraw>static void Fl::redraw()</A></H3> + Redraws all widgets. +<H3><A name=release>static void Fl::release()</A></H3> + Turn off the <TT>grab()</TT> behavior. +<H3><A name=remove_idle>static void Fl::remove_idle(void (*cb)(void *), +void *= 0)</A></H3> + Removes the specified idle callback. +<H3><A name=remove_timeout>static void Fl::remove_timeout(void +(*cb)(void *), void *= 0)</A></H3> + Removes a timeout callback. It is harmless to remove a timeout +callback that no longer exists. +<H3><A name=run>static Fl::run()</A></H3> + Runs FLTK until there are no windows displayed, and then returns a +zero. <TT>Fl::run()</TT> is <I>exactly equivalent to:</I> +<UL> +<PRE> while (Fl::wait()); return 0; -</pre></ul> - -<h3><a name="selection">static void Fl::selection(Fl_Widget *owner, const char *stuff, int len)<br> -static const char* Fl::selection()<BR> -static int Fl::selection_length()</a></h3> - -The first form changes the current selection. The block of text is -copied to an internal buffer by FLTK (be careful if doing this in -response to an <tt>FL_PASTE</tt> as this <i>may</i> be the same buffer -returned by <tt>event_text()</tt>). The <tt>selection_owner()</tt> -widget is set to the passed owner (possibly sending -<tt>FL_SELECTIONCLEAR</tt> to the previous owner). - -The second form looks at the buffer containing the current selection. -The contents of this buffer are undefined if this program does not own -the current selection. - -<h3><a name="selection_owner">static Fl_Widget *Fl::selection_owner() const<BR> -static void Fl::selection_owner(Fl_Widget *)</a></h3> - -The single-argument <tt>selection_owner(x)</tt> call can be used to -move the selection to another widget or to set the owner to -<tt>NULL</tt>, without changing the actual text of the selection. -<tt>FL_SELECTIONCLEAR</tt> is sent to the previous selection owner, if -any. - -<p><i>Copying the buffer every time the selection is changed is -obviously wasteful, especially for large selections. An interface will -probably be added in a future version to allow the selection to be made -by a callback function. The current interface will be emulated on top -of this.</i> - -<h3><a name="set_boxtype">static void Fl::set_boxtype(Fl_Boxtype, Fl_Box_Draw_F *, uchar, uchar, uchar, uchar)<br> -static void Fl::set_boxtype(Fl_Boxtype, Fl_Boxtype from)</a></h3> - -The first form sets the function to call to draw a specific boxtype. - -<p>The second form copies the <tt>from</tt> boxtype. - -<h3><a name="set_color">static void Fl::set_color(Fl_Color, uchar r, uchar g, uchar b)</a></h3> - -Sets an entry in the <tt>fl_color</tt> index table. You can set -it to any 8-bit RGB color. The color is not allocated until -<tt>fl_color(i)</tt> is used. - -<h3><a name="set_font">static int Fl::set_font(int face, const char *)<br> -static int Fl::set_font(int face, int from)</a></h3> - -The first form changes a face. The string pointer is simply stored, -the string is not copied, so the string must be in static memory. - -<p>The second form copies one face to another. - -<h3><a name="set_fonts">int Fl::set_fonts(const char * = 0)</a></h3> - -FLTK will open the display, and add every font on the server to the -face table. It will attempt to put "families" of faces together, so -that the normal one is first, followed by bold, italic, and bold -italic. - -<p>The optional argument is a string to describe the set of fonts to -add. Passing <tt>NULL</tt> will select only fonts that have the ISO8859-1 -character set (and are thus usable by normal text). Passing "-*" will -select all fonts with any encoding as long as they have normal X font -names with dashes in them. Passing "*" will list every font that -exists (on X this may produce some strange output). Other values may -be useful but are system dependent. With WIN32 <tt>NULL</tt> selects fonts -with ISO8859-1 encoding and non-<tt>NULL</tt> selects all fonts. - -<p>The return value is how many faces are in the table after this is done. - -<h3><a name="set_labeltype">static void Fl::set_labeltype(Fl_Labeltype, Fl_Label_Draw_F *, Fl_Label_Measure_F *)<br> -static void Fl:set_labeltype(Fl_Labeltype, Fl_Labeltype from)</a></h3> - -The first form sets the functions to call to draw and measure a -specific labeltype. - -<p>The second form copies the <tt>from</tt> labeltype. - -<h3><a name="test_shortcut">int Fl::test_shortcut(ulong) const</a></h3> - -Test the current event, which must be an <tt>FL_KEYBOARD</tt> or -<tt>FL_SHORTCUT</tt>, against a shortcut value (described in <a -href="#Fl_Button.shortcut"><tt>Fl_Button</tt></a>). Returns non-zero -if there is a match. Not to be confused with -<a href="#Fl_Widge.test_shortcut"><tt>Fl_Widget::test_shortcut()</tt></a>. - -<h3><a name="visual">static int Fl::visual(int)</a></h3> - -Selects a visual so that your graphics are drawn correctly. This -does nothing if the default visual satisfies the capabilities, or if -no visual satisfies the capabilities, or on systems that don't have -such brain-dead notions. - -<p>Only the following combinations do anything useful: - -<ul> - - <li><tt>Fl::visual(FL_RGB)</tt> - - <br>Full/true color (if there are several depths FLTK chooses - the largest). Do this if you use <a href="#fl_draw_image"> - <tt>fl_draw_image</tt></a> for much better (non-dithered) - output. - <br> - - <li><tt>Fl::visual(FL_RGB8)</tt> - - <br>Full color with at least 24 bits of color. <tt>FL_RGB</tt> will always - pick this if available, but if not it will happily return a - less-than-24 bit deep visual. This call fails if 24 bits are not - available. - <br> - - <li><tt>Fl::visual(FL_DOUBLE|FL_INDEX)</tt> - - <br>Hardware double buffering. Call this if you are going to use - <a href="#Fl_Double_Window"><tt>Fl_Double_Window</tt></a>. - <br> - - <li><tt>Fl::visual(FL_DOUBLE|FL_RGB)</tt> - <li><tt>Fl::visual(FL_DOUBLE|FL_RGB8)</tt> - - <br>Hardware double buffering and full color. - <br> - -</ul> - -This returns true if the system has the capabilities by default or -FLTK suceeded in turing them on. Your program will still work even if -this returns false (it just won't look as good). - -<h3><a name="w">static int Fl::w()</a></h3> - -Returns the width of the screen in pixels. - -<h3><a name="wait">static int wait()<br> -static double wait(double time)</a></h3> - -Calls the idle function if any, then calls any pending timeout -functions, then calls <a href="#flush"><tt>Fl::flush()</tt></a>. If there are -any windows displayed it then waits some time for events (zero if -there is an idle(), the shortest timeout if there are any timeouts, or -forever) and calls the handle() function on those events, and then -returns non-zero. - -<p>Your program can check its global state and update things after -each call to <tt>Fl::wait()</tt>, which can be very useful in complex programs. - -<p>If there are no windows (this is checked after the idle and -timeouts are called) then <tt>Fl::wait()</tt> returns zero without waiting for -any events. Your program can either exit at this point, or call -<tt>show()</tt> on some window so the GUI can continue to operate. - -The second form of <tt>Fl::wait()</tt> waits only a certain amount of -time for anything to happen. This does the same as <tt>wait()</tt> -except if the given time (in seconds) passes it returns. The return -value is how much time remains. If the return value is zero or -negative then the entire time period elapsed. - -<p>If you do several <tt>wait(time)</tt> calls in a row, the subsequent ones -are measured from when the first one is called, even if you do -time-consuming calculations after they return. This allows you to -accurately make something happen at regular intervals. This code will -accurately call <tt>A()</tt> once per second (as long as it takes less than a -second to execute): - -<ul><pre> +</PRE> +</UL> +<H3><A name=selection>static void Fl::selection(Fl_Widget *owner, const +char *stuff, int len) +<BR> static const char* Fl::selection() +<BR> static int Fl::selection_length()</A></H3> + The first form changes the current selection. The block of text is +copied to an internal buffer by FLTK (be careful if doing this in +response to an <TT>FL_PASTE</TT> as this <I>may</I> be the same buffer +returned by <TT>event_text()</TT>). The <TT>selection_owner()</TT> + widget is set to the passed owner (possibly sending <TT> +FL_SELECTIONCLEAR</TT> to the previous owner). The second form looks +at the buffer containing the current selection. The contents of this +buffer are undefined if this program does not own the current +selection. +<H3><A name=selection_owner>static Fl_Widget *Fl::selection_owner() +const +<BR> static void Fl::selection_owner(Fl_Widget *)</A></H3> + The single-argument <TT>selection_owner(x)</TT> call can be used to +move the selection to another widget or to set the owner to <TT>NULL</TT> +, without changing the actual text of the selection. <TT> +FL_SELECTIONCLEAR</TT> is sent to the previous selection owner, if any. +<P><I>Copying the buffer every time the selection is changed is +obviously wasteful, especially for large selections. An interface will +probably be added in a future version to allow the selection to be made +by a callback function. The current interface will be emulated on top +of this.</I></P> +<H3><A name=set_boxtype>static void Fl::set_boxtype(Fl_Boxtype, +Fl_Box_Draw_F *, uchar, uchar, uchar, uchar) +<BR> static void Fl::set_boxtype(Fl_Boxtype, Fl_Boxtype from)</A></H3> + The first form sets the function to call to draw a specific boxtype. +<P>The second form copies the <TT>from</TT> boxtype. </P> +<H3><A name=set_color>static void Fl::set_color(Fl_Color, uchar r, +uchar g, uchar b)</A></H3> + Sets an entry in the <TT>fl_color</TT> index table. You can set it to +any 8-bit RGB color. The color is not allocated until <TT>fl_color(i)</TT> + is used. +<H3><A name=set_font>static int Fl::set_font(int face, const char *) +<BR> static int Fl::set_font(int face, int from)</A></H3> + The first form changes a face. The string pointer is simply stored, +the string is not copied, so the string must be in static memory. +<P>The second form copies one face to another. </P> +<H3><A name=set_fonts>int Fl::set_fonts(const char * = 0)</A></H3> + FLTK will open the display, and add every font on the server to the +face table. It will attempt to put "families" of faces together, so +that the normal one is first, followed by bold, italic, and bold +italic. +<P>The optional argument is a string to describe the set of fonts to +add. Passing <TT>NULL</TT> will select only fonts that have the +ISO8859-1 character set (and are thus usable by normal text). Passing +"-*" will select all fonts with any encoding as long as they have +normal X font names with dashes in them. Passing "*" will list every +font that exists (on X this may produce some strange output). Other +values may be useful but are system dependent. With WIN32 <TT>NULL</TT> + selects fonts with ISO8859-1 encoding and non-<TT>NULL</TT> selects +all fonts. </P> +<P>The return value is how many faces are in the table after this is +done. </P> +<H3><A name=set_labeltype>static void Fl::set_labeltype(Fl_Labeltype, +Fl_Label_Draw_F *, Fl_Label_Measure_F *) +<BR> static void Fl:set_labeltype(Fl_Labeltype, Fl_Labeltype from)</A></H3> + The first form sets the functions to call to draw and measure a +specific labeltype. +<P>The second form copies the <TT>from</TT> labeltype. </P> +<H3><A name=test_shortcut>int Fl::test_shortcut(ulong) const</A></H3> + Test the current event, which must be an <TT>FL_KEYBOARD</TT> or <TT> +FL_SHORTCUT</TT>, against a shortcut value (described in <A href=Fl_Button.html#Fl_Button.shortcut> +<TT>Fl_Button</TT></A>). Returns non-zero if there is a match. Not to +be confused with <A href=#Fl_Widge.test_shortcut><TT> +Fl_Widget::test_shortcut()</TT></A>. +<H3><A name=visual>static int Fl::visual(int)</A></H3> + Selects a visual so that your graphics are drawn correctly. This does +nothing if the default visual satisfies the capabilities, or if no +visual satisfies the capabilities, or on systems that don't have such +brain-dead notions. +<P>Only the following combinations do anything useful: </P> +<UL> +<LI><TT>Fl::visual(FL_RGB)</TT> +<BR>Full/true color (if there are several depths FLTK chooses the +largest). Do this if you use <A href=#fl_draw_image><TT>fl_draw_image</TT> +</A> for much better (non-dithered) output. +<BR> </LI> +<LI><TT>Fl::visual(FL_RGB8)</TT> +<BR>Full color with at least 24 bits of color. <TT>FL_RGB</TT> will +always pick this if available, but if not it will happily return a + less-than-24 bit deep visual. This call fails if 24 bits are not + available. +<BR> </LI> +<LI><TT>Fl::visual(FL_DOUBLE|FL_INDEX)</TT> +<BR>Hardware double buffering. Call this if you are going to use <A href=Fl_Double_Window.html#Fl_Double_Window> +<TT>Fl_Double_Window</TT></A>. +<BR> </LI> +<LI><TT>Fl::visual(FL_DOUBLE|FL_RGB)</TT></LI> +<LI><TT>Fl::visual(FL_DOUBLE|FL_RGB8)</TT> +<BR>Hardware double buffering and full color. +<BR> </LI> +</UL> + This returns true if the system has the capabilities by default or +FLTK suceeded in turing them on. Your program will still work even if +this returns false (it just won't look as good). +<H3><A name=w>static int Fl::w()</A></H3> + Returns the width of the screen in pixels. +<H3><A name=wait>static int wait() +<BR> static double wait(double time)</A></H3> + Calls the idle function if any, then calls any pending timeout +functions, then calls <A href=#flush><TT>Fl::flush()</TT></A>. If +there are any windows displayed it then waits some time for events +(zero if there is an idle(), the shortest timeout if there are any +timeouts, or forever) and calls the handle() function on those events, +and then returns non-zero. +<P>Your program can check its global state and update things after each +call to <TT>Fl::wait()</TT>, which can be very useful in complex +programs. </P> +<P>If there are no windows (this is checked after the idle and timeouts +are called) then <TT>Fl::wait()</TT> returns zero without waiting for +any events. Your program can either exit at this point, or call <TT> +show()</TT> on some window so the GUI can continue to operate. The +second form of <TT>Fl::wait()</TT> waits only a certain amount of time +for anything to happen. This does the same as <TT>wait()</TT> except +if the given time (in seconds) passes it returns. The return value is +how much time remains. If the return value is zero or negative then +the entire time period elapsed. </P> +<P>If you do several <TT>wait(time)</TT> calls in a row, the subsequent +ones are measured from when the first one is called, even if you do +time-consuming calculations after they return. This allows you to +accurately make something happen at regular intervals. This code will +accurately call <TT>A()</TT> once per second (as long as it takes less +than a second to execute): </P> +<UL> +<PRE> for (;;) { - for (float time = 1.0; time > 0; ) time = Fl::wait(time); + for (float time = 1.0; time > 0; ) time = Fl::wait(time); A(); } -</pre></ul> - -<h3><a name="warning">static void (*Fl::warning)(const char *, ...)</a><br> -<a name="error">static void (*Fl::error)(const char *, ...)</a><br> -<a name="fatal">static void (*Fl::fatal)(const char *, ...)</a></h3> - -FLTK will call these to print messages when unexpected conditions -occur. By default they <tt>fprintf</tt> to <tt>stderr</tt>, and -<tt>Fl::error</tt> and <tt>Fl::fatal</tt> call <tt>exit(1)</tt>. You -can override the behavior by setting the function pointers to your own -routines. - -<p><tt>Fl::warning</tt> means that there was a recoverable problem, the -display may be messed up but the user can probably keep working (all X -protocol errors call this). <tt>Fl::error</tt> means there is a -recoverable error, but the display is so messed up it is unlikely the -user can continue (very little calls this now). <tt>Fl::fatal</tt> -must not return, as FLTK is in an unusable state, however your version -may be able to use <tt>longjmp</tt> or an exception to continue, as -long as it does not call FLTK again. - -</BODY> -</HTML> +</PRE> +</UL> +<H3><A name=warning>static void (*Fl::warning)(const char *, ...)</A> +<BR><A name=error>static void (*Fl::error)(const char *, ...)</A> +<BR><A name=fatal>static void (*Fl::fatal)(const char *, ...)</A></H3> + FLTK will call these to print messages when unexpected conditions +occur. By default they <TT>fprintf</TT> to <TT>stderr</TT>, and <TT> +Fl::error</TT> and <TT>Fl::fatal</TT> call <TT>exit(1)</TT>. You can +override the behavior by setting the function pointers to your own +routines. +<P><TT>Fl::warning</TT> means that there was a recoverable problem, the +display may be messed up but the user can probably keep working (all X +protocol errors call this). <TT>Fl::error</TT> means there is a +recoverable error, but the display is so messed up it is unlikely the +user can continue (very little calls this now). <TT>Fl::fatal</TT> must +not return, as FLTK is in an unusable state, however your version may +be able to use <TT>longjmp</TT> or an exception to continue, as long as +it does not call FLTK again. </P> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/glut.html b/documentation/glut.html index 643f66dc2..cbfe12a37 100644 --- a/documentation/glut.html +++ b/documentation/glut.html @@ -1,194 +1,145 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="glut">D - GLUT Compatibility</A></H1> - -This appendix describes the GLUT compatibility header file supplied with -FLTK. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=glut>D - GLUT Compatibility</A></H1> + This appendix describes the GLUT compatibility header file supplied +with FLTK. <H2>Using the GLUT Compatibility Header File</H2> - -You should be able to compile existing GLUT source code by including -<tt><FL/glut.H></tt> instead of <tt><GL/glut.h></tt>. This can -be done by editing the source, by changing the <tt>-I</tt> switches to -the compiler, or by providing a symbolic link from <tt>GL/glut.h</tt> -to <tt>FL/glut.H</tt>. - -<p><i>All files calling GLUT procedures must be compiled with C++</i>. You may -have to alter them slightly to get them to compile without warnings, -and you may have to rename them to get make to use the C++ compiler. - -<p>You must link with the FLTK library. If you call any GLUT drawing -functions that FLTK does not emulate -(<tt>glutExtensionsSupported()</tt>, <tt>glutWire*()</tt>, -<tt>glutSolid*()</tt>, and <tt>glutStroke*()</tt>), you will also have -to link with the GLUT library (<i>after</i> the FLTK library!) - -<p>Most of <tt>FL/glut.H</tt> is inline functions. You should take a -look at it (and maybe at <tt>test/glut.cxx</tt> in the FLTK source) if -you are having trouble porting your GLUT program. - -<p>This has been tested with most of the demo programs that come with -the GLUT 3.3 distribution. - -<h2>Known Problems</h2> - -The following functions and/or arguments to functions are missing, -and you will have to replace them or comment them out for your code to -compile: - -<ul> - - <li><tt>glutLayerGet(GLUT_LAYER_IN_USE)</tt> - <li><tt>glutLayerGet(GLUT_HAS_OVERLAY)</tt> - <li><tt>glutSetColor(), glutGetColor(), glutCopyColormap()</tt> - <li><tt>glutInitDisplayMode(GLUT_STEREO)</tt> - <li><tt>glutInitDisplayMode(GLUT_LUMINANCE)</tt> - <li><tt>glutPushWindow()</tt> - <li><tt>glutWarpPointer()</tt> - <li>Spaceball, buttonbox, dials, tablet functions, - <tt>glutDeviceGet()</tt> - <li><tt>glutWindowStatusFunc()</tt> - <li><tt>glutGet(GLUT_WINDOW_NUM_CHILDREN)</tt> - <li><tt>glutGet(GLUT_SCREEN_WIDTH_MM)</tt> - <li><tt>glutGet(GLUT_SCREEN_HEIGHT_MM)</tt> - <li><tt>glutGet(GLUT_ELAPSED_TIME)</tt> - <li><tt>glutVideoResize()</tt> missing. - -</ul> - -Most of the symbols/enumerations have different values than -GLUT uses. This will break code that relies on the actual values. -The only symbols guaranteed to have the same values are true/false -pairs like <tt>GLUT_DOWN</tt> and <tt>GLUT_UP</tt>, mouse -buttons <tt>GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, -GLUT_RIGHT_BUTTON</tt>, and <tt>GLUT_KEY_F1</tt> thru -<tt>F12</tt>. - -<p>The strings passed as menu labels are not copied. - -<p><tt>glutPostRedisplay()</tt> does not work if called from -inside a display function. You must use <tt>glutIdleFunc()</tt> -if you want your display to update continuously. - -<p><tt>glutSwapBuffers()</tt> does not work from inside a display -function. This is on purpose, because FLTK swaps the buffers for you. - -<p><tt>glutUseLayer()</tt> does not work well, and should only be -used to initialize transformations inside a resize callback. You -should redraw overlays by using <tt>glutOverlayDisplayFunc()</tt>. - -<p>Overlays are cleared before the overlay display function is called. -<tt>glutLayerGet(GLUT_OVERLAY_DAMAGED)</tt> always returns true for -compatibility with some GLUT overlay programs. You must rewrite your -code so that <tt>gl_color()</tt> is used to choose colors in an -overlay, or you will get random overlay colors. - -<p><tt>glutSetCursor(GLUT_CURSOR_FULL_CROSSHAIR)</tt> just -results in a small crosshair. - -<p>The fonts used by <tt>glutBitmapCharacter() and -glutBitmapWidth()</tt> may be different. - -<p><tt>glutInit(argc,argv)</tt> will consume different switches than GLUT -does. It accepts the switches recognized by <a -href="#args"><tt>Fl::args()</tt></a>, and will accept any -abbreviation of these switches (such as "-di" for "-display"). - -<h2>Mixing GLUT and FLTK Code</h2> - -You can make your GLUT window a child of a <tt>Fl_Window</tt> with the -following scheme. The biggest trick is that GLUT insists on -<tt>show()</tt>'ing the window at the point it is created, which means the -<tt>Fl_Window</tt> parent window must already be shown. - -<ul> - - <li>Don't call <tt>glutInit()</tt>. - - <li>Create your <tt>Fl_Window</tt>, and any FLTK widgets. - Leave a blank area in the window for your GLUT window. - - <li><tt>show()</tt> the <tt>Fl_Window</tt>. Perhaps call - <tt>show(argc,argv)</tt>. - - <li>Call <tt>window->begin()</tt> so that the GLUT window will - be automatically added to it. - - <li>Use <tt>glutInitWindowSize()</tt> and - <tt>glutInitWindowPosition()</tt> to set the location in the - parent window to put the GLUT window. - - <li>Put your GLUT code next. It probably does not need many changes. - Call <tt>window->end()</tt> immediately after the <tt>glutCreateWindow()</tt>! - - <li>You can call either <tt>glutMainLoop()</tt>, - <tt>Fl::run()</tt>, or loop calling <tt>Fl::wait()</tt> to run - the program. - -</ul> - -<hr break> - -<h2><a name="Fl_Glut_Window">class Fl_Glut_Window</a></h2> - -<hr> - -<h3>Class Hierarchy</h3> - -<ul><pre> -<a href="#Fl_Gl_Window">Fl_Gl_Window</a> + You should be able to compile existing GLUT source code by including <TT> +<FL/glut.H></TT> instead of <TT><GL/glut.h></TT>. This can be done by +editing the source, by changing the <TT>-I</TT> switches to the +compiler, or by providing a symbolic link from <TT>GL/glut.h</TT> to <TT> +FL/glut.H</TT>. +<P><I>All files calling GLUT procedures must be compiled with C++</I>. + You may have to alter them slightly to get them to compile without +warnings, and you may have to rename them to get make to use the C++ +compiler. </P> +<P>You must link with the FLTK library. If you call any GLUT drawing +functions that FLTK does not emulate (<TT>glutExtensionsSupported()</TT> +, <TT>glutWire*()</TT>, <TT>glutSolid*()</TT>, and <TT>glutStroke*()</TT> +), you will also have to link with the GLUT library (<I>after</I> the +FLTK library!) </P> +<P>Most of <TT>FL/glut.H</TT> is inline functions. You should take a +look at it (and maybe at <TT>test/glut.cxx</TT> in the FLTK source) if +you are having trouble porting your GLUT program. </P> +<P>This has been tested with most of the demo programs that come with +the GLUT 3.3 distribution. </P> +<H2>Known Problems</H2> + The following functions and/or arguments to functions are missing, and +you will have to replace them or comment them out for your code to +compile: +<UL> +<LI><TT>glutLayerGet(GLUT_LAYER_IN_USE)</TT></LI> +<LI><TT>glutLayerGet(GLUT_HAS_OVERLAY)</TT></LI> +<LI><TT>glutSetColor(), glutGetColor(), glutCopyColormap()</TT></LI> +<LI><TT>glutInitDisplayMode(GLUT_STEREO)</TT></LI> +<LI><TT>glutInitDisplayMode(GLUT_LUMINANCE)</TT></LI> +<LI><TT>glutPushWindow()</TT></LI> +<LI><TT>glutWarpPointer()</TT></LI> +<LI>Spaceball, buttonbox, dials, tablet functions, <TT>glutDeviceGet()</TT> +</LI> +<LI><TT>glutWindowStatusFunc()</TT></LI> +<LI><TT>glutGet(GLUT_WINDOW_NUM_CHILDREN)</TT></LI> +<LI><TT>glutGet(GLUT_SCREEN_WIDTH_MM)</TT></LI> +<LI><TT>glutGet(GLUT_SCREEN_HEIGHT_MM)</TT></LI> +<LI><TT>glutGet(GLUT_ELAPSED_TIME)</TT></LI> +<LI><TT>glutVideoResize()</TT> missing. </LI> +</UL> + Most of the symbols/enumerations have different values than GLUT uses. + This will break code that relies on the actual values. The only +symbols guaranteed to have the same values are true/false pairs like <TT> +GLUT_DOWN</TT> and <TT>GLUT_UP</TT>, mouse buttons <TT> +GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, GLUT_RIGHT_BUTTON</TT>, and <TT> +GLUT_KEY_F1</TT> thru <TT>F12</TT>. +<P>The strings passed as menu labels are not copied. </P> +<P><TT>glutPostRedisplay()</TT> does not work if called from inside a +display function. You must use <TT>glutIdleFunc()</TT> if you want +your display to update continuously. </P> +<P><TT>glutSwapBuffers()</TT> does not work from inside a display +function. This is on purpose, because FLTK swaps the buffers for you. </P> +<P><TT>glutUseLayer()</TT> does not work well, and should only be used +to initialize transformations inside a resize callback. You should +redraw overlays by using <TT>glutOverlayDisplayFunc()</TT>. </P> +<P>Overlays are cleared before the overlay display function is called. <TT> +glutLayerGet(GLUT_OVERLAY_DAMAGED)</TT> always returns true for +compatibility with some GLUT overlay programs. You must rewrite your +code so that <TT>gl_color()</TT> is used to choose colors in an +overlay, or you will get random overlay colors. </P> +<P><TT>glutSetCursor(GLUT_CURSOR_FULL_CROSSHAIR)</TT> just results in a +small crosshair. </P> +<P>The fonts used by <TT>glutBitmapCharacter() and glutBitmapWidth()</TT> + may be different. </P> +<P><TT>glutInit(argc,argv)</TT> will consume different switches than +GLUT does. It accepts the switches recognized by <A href=functions.html#args> +<TT>Fl::args()</TT></A>, and will accept any abbreviation of these +switches (such as "-di" for "-display"). </P> +<H2>Mixing GLUT and FLTK Code</H2> + You can make your GLUT window a child of a <TT>Fl_Window</TT> with the +following scheme. The biggest trick is that GLUT insists on <TT>show()</TT> +'ing the window at the point it is created, which means the <TT> +Fl_Window</TT> parent window must already be shown. +<UL> +<LI>Don't call <TT>glutInit()</TT>. </LI> +<LI>Create your <TT>Fl_Window</TT>, and any FLTK widgets. Leave a +blank area in the window for your GLUT window. </LI> +<LI><TT>show()</TT> the <TT>Fl_Window</TT>. Perhaps call <TT> +show(argc,argv)</TT>. </LI> +<LI>Call <TT>window->begin()</TT> so that the GLUT window will be +automatically added to it. </LI> +<LI>Use <TT>glutInitWindowSize()</TT> and <TT>glutInitWindowPosition()</TT> + to set the location in the parent window to put the GLUT window. </LI> +<LI>Put your GLUT code next. It probably does not need many changes. + Call <TT>window->end()</TT> immediately after the <TT> +glutCreateWindow()</TT>! </LI> +<LI>You can call either <TT>glutMainLoop()</TT>, <TT>Fl::run()</TT>, or +loop calling <TT>Fl::wait()</TT> to run the program. </LI> +</UL> +<HR break> +<H2><A name=Fl_Glut_Window>class Fl_Glut_Window</A></H2> +<HR> +<H3>Class Hierarchy</H3> +<UL> +<PRE> +<A href=Fl_Gl_Window.html#Fl_Gl_Window>Fl_Gl_Window</A> | - +----<b>Fl_Glut_Window</b> -</pre></ul> - -<h3>Include Files</h3> - -<ul><pre> -#include <FL/glut.H> -</pre></ul> - -<h3>Description</h3> - -Each GLUT window is an instance of this class. You may find it useful to -manipulate instances directly rather than use GLUT window id's. These -may be created without opening the display, and thus can fit better -into FLTK's method of creating windows. - -<p>The current GLUT window is available in the global variable -<tt>glut_window</tt>. - -<p><tt>new Fl_Glut_Window(...)</tt> is the same as -<tt>glutCreateWindow()</tt> except it does not <tt>show()</tt> the window -or make the window current. - -<p><tt>window->make_current()</tt> is the same as -<tt>glutSetWindow(number)</tt>. If the window has not had -<tt>show()</tt> called on it yet, some functions that assumme an OpenGL -context will not work. If you do <tt>show()</tt> the window, call -<tt>make_current()</tt> again to set the context. - -<p><tt>~Fl_Glut_Window()</tt> is the same as -<tt>glutDestroyWindow()</tt>. - -<h3>Methods</h3> - -<ul> - <li><a href="#Fl_Glut_Window.Fl_Glut_Window">Fl_Glut_Window</a> - <li><a href="#Fl_Glut_Window.~Fl_Glut_Window">~Fl_Glut_Window</a> -</ul> - -<h4><a name="Fl_Glut_Window.Fl_Glut_Window">Fl_Glut_Window::Fl_Glut_Window(int x, int y, int w, int h, const char *title = 0)<br> -Fl_Glut_Window::Fl_Glut_Window(int w, int h, const char *title = 0)</a></h4> - -The first constructor takes 4 int arguments to create the window with -a preset position and size. The second constructor with 2 arguments -will create the window with a preset size, but the window manager -will choose the position according to it's own whims. - -<h4><a name="Fl_Glut_Window.~Fl_Glut_Window">virtual Fl_Glut_Window::~Fl_Glut_Window()</a></h4> - -Destroys the GLUT window. - -</BODY> -</HTML> + +----<B>Fl_Glut_Window</B> +</PRE> +</UL> +<H3>Include Files</H3> +<UL> +<PRE> +#include <FL/glut.H> +</PRE> +</UL> +<H3>Description</H3> + Each GLUT window is an instance of this class. You may find it useful +to manipulate instances directly rather than use GLUT window id's. + These may be created without opening the display, and thus can fit +better into FLTK's method of creating windows. +<P>The current GLUT window is available in the global variable <TT> +glut_window</TT>. </P> +<P><TT>new Fl_Glut_Window(...)</TT> is the same as <TT> +glutCreateWindow()</TT> except it does not <TT>show()</TT> the window +or make the window current. </P> +<P><TT>window->make_current()</TT> is the same as <TT> +glutSetWindow(number)</TT>. If the window has not had <TT>show()</TT> + called on it yet, some functions that assumme an OpenGL context will +not work. If you do <TT>show()</TT> the window, call <TT>make_current()</TT> + again to set the context. </P> +<P><TT>~Fl_Glut_Window()</TT> is the same as <TT>glutDestroyWindow()</TT> +. </P> +<H3>Methods</H3> +<UL> +<LI><A href=#Fl_Glut_Window.Fl_Glut_Window>Fl_Glut_Window</A></LI> +<LI><A href=#Fl_Glut_Window.~Fl_Glut_Window>~Fl_Glut_Window</A></LI> +</UL> +<H4><A name=Fl_Glut_Window.Fl_Glut_Window> +Fl_Glut_Window::Fl_Glut_Window(int x, int y, int w, int h, const char +*title = 0) +<BR> Fl_Glut_Window::Fl_Glut_Window(int w, int h, const char *title = 0)</A> +</H4> + The first constructor takes 4 int arguments to create the window with +a preset position and size. The second constructor with 2 arguments +will create the window with a preset size, but the window manager will +choose the position according to it's own whims. +<H4><A name=Fl_Glut_Window.~Fl_Glut_Window>virtual +Fl_Glut_Window::~Fl_Glut_Window()</A></H4> + Destroys the GLUT window. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/intro.html b/documentation/intro.html index f941e15da..6216c6b47 100644 --- a/documentation/intro.html +++ b/documentation/intro.html @@ -1,263 +1,198 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="intro">1 - Introduction to FLTK</A></H1> - -The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a LGPL'd C++ -graphical user interface toolkit for X (UNIX®), OpenGL®, and -Microsoft® Windows® NT 4.0, 95, or 98. It was originally -developed by Mr. Bill Spitzak and is currently maintained by a small -group of developers across the world with a central repository in the -US. - -<h2>History of FLTK</h2> - -It has always been Bill's belief that the GUI API of all modern systems -is much too high level. Toolkits (even FL) are <i>not</i> what should -be provided and documented as part of an operating system. The system -only has to provide arbitrary shaped but featureless windows, a -powerful set of graphics drawing calls, and a simple <i>unalterable</i> -method of delivering events to the owners of the windows. NeXT (if you -ignored NextStep) provided this, but they chose to hide it and tried to -push their own baroque toolkit instead... - -<p>Many of the ideas in FLTK were developed on a NeXT (but <i>not</i> -using NextStep) in 1987 in a C toolkit Bill called "views". Here he -came up with passing events downward in the tree and having the handle -routine return a value indicating the used the event, and the -table-driven menus. In general he was trying to prove that complex UI -ideas could be entirely implemented in a user space toolkit, with no -knowledge or support by the system. - -<p>After going to film school for a few years, Bill worked at Sun -Microsystems on the (doomed) NeWS project. Here he found an even -better and cleaner windowing system, and he reimplemented "views" atop -that. NeWS did have an unnecessarily complex method of delivering -events which hurt it. But the designers did admit that perhaps the -user could write just as good of a button as they could, and officially -exposed the lower level interface. - -<p>With the death of NeWS Bill realized that he would have to live with -X. The biggest problem with X is the "window manager", which means -that the toolkit can no longer control the window borders or drag the -window around. - -<p>At Digital Domain Bill discovered another toolkit, "Forms". Forms was -similar to his work, but provided many more widgets, since it was used -in many real applications, rather then as theoretical work. He decided -to use Forms, except he integrated his table-driven menus into it. -Several very large programs were created using this version of Forms. - -<p>The need to switch to OpenGL and GLX, portability, and a desire to -use C++ subclassing required a rewrite of Forms. This produced the -first version of FLTK. The conversion to C++ required so many changes -it made it impossible to recompile any Forms objects. Since it was -incompatible anyway, Bill decided to incorporate his older ideas as -much as possible by simplifying the lower level interface and the event -passing mechanisim. - -<p>Bill received permission to release it for free on the Internet, -with the GNU general public license. Response from Internet users -indicated that the Linux market dwarfed the SGI and high-speed GL -market, so he rewrote it to use X for all drawing, greatly speeding it -up on these machines. That is the version you have now. - -<p>Digital Domain has since withdrawn support for FLTK. While Bill is -no longer able to actively develop it, he still contributes to FLTK in -his free time and is a part of the FLTK development team. - -<h2>Features</h2> - -FLTK was designed to be statically linked. This was done by splitting it -into many small objects and desigining it so that functions that are not -used do not have pointers to them in the parts that are used, and thus -do not get linked in. This allows you to make an easy-to-install program, -or to modify FLTK to the exact requirements of your application, without -worrying about bloat. FLTK works fine as a shared library, though, and -has started being included on Linux distributions. - -<p>Here are some of the core features unique to FLTK: - -<ul> - <li>sizeof(Fl_Widget) == 40 to 48.</li> - - <li>The "core" (the "hello" program compiled & linked with a static FLTK - library using gcc on a 486 and then stripped) is 39.5K.</li> - - <li>A program including every widget is less than 108K. Does not use - macros, templates, multiple inheritance, or exceptions.</li> - - <li>Written directly atop Xlib (or WIN32) for maximum speed, - and carefully optimized for code size and performance.</li> - - <li>Precise low-level compatability between the X11 and WIN32 - version (only about 10% of the code is different).</li> - - <li>Interactive user interface builder program. Output is - human-readable and editable C++ source code.</li> - - <li>Support for the X11 double buffering extension (emulation - if not available and under Windows.)</li> - - <li>Support for X11 overlay hardware (emulation if none and - under WIN32.)</li> - - <li>Very small & fast portable 2-D drawing library to hide - Xlib and WIN32.</li> - - <li>OpenGL/Mesa drawing area widget.</li> - - <li>Support for OpenGL overlay hardware on both X11 and WIN32. - Emulation if none.</li> - - <li>Text input fields with Emacs key bindings, X cut & - paste, and foreign letter compose!</li> - - <li>Compatibility header file for the GLUT library.</li> - - <li>Compatibility header file for the XForms library.</li> - - <li>Much too much to list here...</li> -</ul> - -<h2>Licensing</h2> - -FLTK comes with complete free source code. FLTK is available under the -terms of the <a href="#licensing">GNU Library General Public -License</a>. Contrary to popular belief, it can be used in commercial -software! (Even Bill Gates could use it.) - -<h2>What Does "FLTK" Mean?</h2> - -FLTK was originally designed to be compatable with the Forms Library written -for SGI machines. In that library all the functions and structures started -with "fl_". This naming was extended to all new methods and widgets in -the C++ library, and this prefix was taken as the name of the library. -It is almost impossible to search for "FL" on the Internet, due to the -fact that it is also the abbreviation for Florida. After much debating -and searching for a new name for the toolkit, which was already in use -by several people, Bill came up with "FLTK", and even a bogus excuse that -it stands for "The Fast Light Tool Kit". - -<h2>Building and Installing FLTK Under UNIX</h2> - -In most cases you can just type "make". This will run configure with -the default of no options and then compile everything. - -<p>FLTK uses GNU autoconf to configure itself for your UNIX platform. The -main things that the configure script will look for are the X11, OpenGL -(or Mesa), and JPEG header and library files. Make sure that they -are in the standard include/library locations. - -<p>You can run configure yourself to get the exact setup you need. Type -"./configure <options>", where options are: - -<dl> -<dt>--enable-debug</dt> - -<dd>Enable debugging code & symbols</dd> - -<dt>--enable-shared</dt> - -<dd>Enable generation of shared libraries</dd> - -<dt>--bindir=/path</dt> - -<dd>Set the location for executables [default = /usr/local/bin]</dd> - -<dt>--libdir=/path</dt> - -<dd>Set the location for libraries [default = /usr/local/lib]</dd> - -<dt>--includedir=/path</dt> - -<dd>Set the location for include files. [default = /usr/local/include]</dd> - -<dt>--prefix=/dir</dt> - -<dd>Set the directory prefix for files [default = /usr/local]</dd> -</dl> - -When the configure script is done you can just run the "make" command. -This will build the library, FLUID tool, and all of the test programs. - -<p>To install the library, become root and type "make install". This -will copy the "fluid" executable to "bindir", the header files to "includedir", -and the library files to "libdir". - -<h2>Building FLTK Under Micrsoft Windows</h2> - -There are two ways to build FLTK under Microsoft Windows. The first -is to use the Visual C++ 5.0 project files under the "visualc" directory. -Just open (or double-click on) the "fltk.dsw" file to get the whole shebang. - -<p>The second method is to use a GNU-based development tool with the files -in the "makefiles" directory. To build using one of these tools simply -copy the appropriate makeinclude and config files to the main directory -and do a make: - -<ul><pre> -cp makefiles/makeinclude.<env> makeinclude -cp makefiles/config.<env> config.h +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=intro>1 - Introduction to FLTK</A></H1> + The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a LGPL'd +C++ graphical user interface toolkit for X (UNIX®), OpenGL®, and +Microsoft® Windows® NT 4.0, 95, or 98. It was originally developed by +Mr. Bill Spitzak and is currently maintained by a small group of +developers across the world with a central repository in the US. +<H2>History of FLTK</H2> + It has always been Bill's belief that the GUI API of all modern +systems is much too high level. Toolkits (even FL) are <I>not</I> what +should be provided and documented as part of an operating system. The +system only has to provide arbitrary shaped but featureless windows, a +powerful set of graphics drawing calls, and a simple <I>unalterable</I> + method of delivering events to the owners of the windows. NeXT (if +you ignored NextStep) provided this, but they chose to hide it and +tried to push their own baroque toolkit instead... +<P>Many of the ideas in FLTK were developed on a NeXT (but <I>not</I> + using NextStep) in 1987 in a C toolkit Bill called "views". Here he +came up with passing events downward in the tree and having the handle +routine return a value indicating the used the event, and the +table-driven menus. In general he was trying to prove that complex UI +ideas could be entirely implemented in a user space toolkit, with no +knowledge or support by the system. </P> +<P>After going to film school for a few years, Bill worked at Sun +Microsystems on the (doomed) NeWS project. Here he found an even +better and cleaner windowing system, and he reimplemented "views" atop +that. NeWS did have an unnecessarily complex method of delivering +events which hurt it. But the designers did admit that perhaps the +user could write just as good of a button as they could, and officially +exposed the lower level interface. </P> +<P>With the death of NeWS Bill realized that he would have to live with +X. The biggest problem with X is the "window manager", which means +that the toolkit can no longer control the window borders or drag the +window around. </P> +<P>At Digital Domain Bill discovered another toolkit, "Forms". Forms +was similar to his work, but provided many more widgets, since it was +used in many real applications, rather then as theoretical work. He +decided to use Forms, except he integrated his table-driven menus into +it. Several very large programs were created using this version of +Forms. </P> +<P>The need to switch to OpenGL and GLX, portability, and a desire to +use C++ subclassing required a rewrite of Forms. This produced the +first version of FLTK. The conversion to C++ required so many changes +it made it impossible to recompile any Forms objects. Since it was +incompatible anyway, Bill decided to incorporate his older ideas as +much as possible by simplifying the lower level interface and the event +passing mechanisim. </P> +<P>Bill received permission to release it for free on the Internet, +with the GNU general public license. Response from Internet users +indicated that the Linux market dwarfed the SGI and high-speed GL +market, so he rewrote it to use X for all drawing, greatly speeding it +up on these machines. That is the version you have now. </P> +<P>Digital Domain has since withdrawn support for FLTK. While Bill is +no longer able to actively develop it, he still contributes to FLTK in +his free time and is a part of the FLTK development team. </P> +<H2>Features</H2> + FLTK was designed to be statically linked. This was done by splitting +it into many small objects and desigining it so that functions that are +not used do not have pointers to them in the parts that are used, and +thus do not get linked in. This allows you to make an easy-to-install +program, or to modify FLTK to the exact requirements of your +application, without worrying about bloat. FLTK works fine as a shared +library, though, and has started being included on Linux distributions. +<P>Here are some of the core features unique to FLTK: </P> +<UL> +<LI>sizeof(Fl_Widget) == 40 to 48.</LI> +<LI>The "core" (the "hello" program compiled & linked with a static +FLTK library using gcc on a 486 and then stripped) is 39.5K.</LI> +<LI>A program including every widget is less than 108K. Does not use + macros, templates, multiple inheritance, or exceptions.</LI> +<LI>Written directly atop Xlib (or WIN32) for maximum speed, and +carefully optimized for code size and performance.</LI> +<LI>Precise low-level compatability between the X11 and WIN32 version +(only about 10% of the code is different).</LI> +<LI>Interactive user interface builder program. Output is + human-readable and editable C++ source code.</LI> +<LI>Support for the X11 double buffering extension (emulation if not +available and under Windows.)</LI> +<LI>Support for X11 overlay hardware (emulation if none and under +WIN32.)</LI> +<LI>Very small & fast portable 2-D drawing library to hide Xlib and +WIN32.</LI> +<LI>OpenGL/Mesa drawing area widget.</LI> +<LI>Support for OpenGL overlay hardware on both X11 and WIN32. + Emulation if none.</LI> +<LI>Text input fields with Emacs key bindings, X cut & paste, and +foreign letter compose!</LI> +<LI>Compatibility header file for the GLUT library.</LI> +<LI>Compatibility header file for the XForms library.</LI> +<LI>Much too much to list here...</LI> +</UL> +<H2>Licensing</H2> + FLTK comes with complete free source code. FLTK is available under the +terms of the <A href=#licensing>GNU Library General Public License</A>. +Contrary to popular belief, it can be used in commercial software! +(Even Bill Gates could use it.) +<H2>What Does "FLTK" Mean?</H2> + FLTK was originally designed to be compatable with the Forms Library +written for SGI machines. In that library all the functions and +structures started with "fl_". This naming was extended to all new +methods and widgets in the C++ library, and this prefix was taken as +the name of the library. It is almost impossible to search for "FL" on +the Internet, due to the fact that it is also the abbreviation for +Florida. After much debating and searching for a new name for the +toolkit, which was already in use by several people, Bill came up with +"FLTK", and even a bogus excuse that it stands for "The Fast Light Tool +Kit". +<H2>Building and Installing FLTK Under UNIX</H2> + In most cases you can just type "make". This will run configure with +the default of no options and then compile everything. +<P>FLTK uses GNU autoconf to configure itself for your UNIX platform. +The main things that the configure script will look for are the X11, +OpenGL (or Mesa), and JPEG header and library files. Make sure that +they are in the standard include/library locations. </P> +<P>You can run configure yourself to get the exact setup you need. Type +"./configure <options>", where options are: </P> +<DL> +<DT>--enable-debug</DT> +<DD>Enable debugging code & symbols</DD> +<DT>--enable-shared</DT> +<DD>Enable generation of shared libraries</DD> +<DT>--bindir=/path</DT> +<DD>Set the location for executables [default = /usr/local/bin]</DD> +<DT>--libdir=/path</DT> +<DD>Set the location for libraries [default = /usr/local/lib]</DD> +<DT>--includedir=/path</DT> +<DD>Set the location for include files. [default = /usr/local/include]</DD> +<DT>--prefix=/dir</DT> +<DD>Set the directory prefix for files [default = /usr/local]</DD> +</DL> + When the configure script is done you can just run the "make" command. +This will build the library, FLUID tool, and all of the test programs. +<P>To install the library, become root and type "make install". This +will copy the "fluid" executable to "bindir", the header files to +"includedir", and the library files to "libdir". </P> +<H2>Building FLTK Under Micrsoft Windows</H2> + There are two ways to build FLTK under Microsoft Windows. The first +is to use the Visual C++ 5.0 project files under the "visualc" +directory. Just open (or double-click on) the "fltk.dsw" file to get +the whole shebang. +<P>The second method is to use a GNU-based development tool with the +files in the "makefiles" directory. To build using one of these tools +simply copy the appropriate makeinclude and config files to the main +directory and do a make: </P> +<UL> +<PRE> +cp makefiles/makeinclude.<env> makeinclude +cp makefiles/config.<env> config.h make -</pre></ul> - -<h2>Building FLTK Under OS/2</h2> - -The current OS/2 build requires XFree86 for OS/2 to work. A native -Presentation Manager version has not been implemented yet (volunteers are -welcome!). - -<p>To build the XFree86 version of FLTK for OS/2, copy the appropriate -makeinclude and config files to the main directory and do a make: - -<ul><pre> +</PRE> +</UL> +<H2>Building FLTK Under OS/2</H2> + The current OS/2 build requires XFree86 for OS/2 to work. A native +Presentation Manager version has not been implemented yet (volunteers +are welcome!). +<P>To build the XFree86 version of FLTK for OS/2, copy the appropriate +makeinclude and config files to the main directory and do a make: </P> +<UL> +<PRE> cp makefiles/Makefile.os2x Makefile cp makefiles/makeinclude.os2x makeinclude cp makefiles/config.os2x config.h make -</pre></ul> - -<h2>Internet Resources</h2> - -FLTK is available on the 'net in a bunch of locations: - -<dl> -<dt>WWW</dt> - -<dd><a href="http://fltk.easysw.com">http://fltk.easysw.com</a></dd> - -<dt>FTP</dt> - -<dd><a href="ftp://ftp.easysw.com/pub/fltk">ftp://ftp.easysw.com/pub/fltk</a></dd> - -<dd><a href="ftp://ftp.funet.fi/mirrors/ftp.easysw.com/pub/fltk">ftp://ftp.funet.fi/mirrors/ftp.easysw.com/pub/fltk</a></dd> - -<dd><a href="ftp://ftp.northamerica.net/pub/ESP/fltk">ftp.northamerica.net/pub/ESP/fltk</a><br></dd> - -<dt>EMail</dt> - -<dd><a href="mailto:fltk@easysw.com">fltk@easysw.com</a> [see instructions below]</dd> - -<dd><a href="mailto:fltk-bugs@easysw.com">fltk-bugs@easysw.com</a> [for reporting bugs]</dd> -</dl> - -To send a message to the FLTK mailing list ("fltk@easysw.com") you must -first join the list. Non-member submissions are blocked to avoid -problems with SPAM... - -<p>To join the FLTK mailing list, send a message to "majordomo@easysw.com" -with "subscribe fltk" in the message body. A digest of this list is available -by subscribing to the "fltk-digest" mailing list. - -<h2>Reporting Bugs</h2> - -To report a bug in FLTK, send an email to "fltk-bugs@easysw.com". Please -include the FLTK version, operating system & version, and compiler -that you are using when describing the bug or problem. - -<p>For general support and questions, please use the FLTK mailing list -at "fltk@easysw.com". - -</body> -</html> +</PRE> +</UL> +<H2>Internet Resources</H2> + FLTK is available on the 'net in a bunch of locations: +<DL> +<DT>WWW</DT> +<DD><A href=http://fltk.easysw.com>http://fltk.easysw.com</A></DD> +<DT>FTP</DT> +<DD><A href=ftp://ftp.easysw.com/pub/fltk>ftp://ftp.easysw.com/pub/fltk</A> +</DD> +<DD><A href=ftp://ftp.funet.fi/mirrors/ftp.easysw.com/pub/fltk> +ftp://ftp.funet.fi/mirrors/ftp.easysw.com/pub/fltk</A></DD> +<DD><A href=ftp://ftp.northamerica.net/pub/ESP/fltk> +ftp.northamerica.net/pub/ESP/fltk</A> +<BR></DD> +<DT>EMail</DT> +<DD><A href=mailto:fltk@easysw.com>fltk@easysw.com</A> [see +instructions below]</DD> +<DD><A href=mailto:fltk-bugs@easysw.com>fltk-bugs@easysw.com</A> [for +reporting bugs]</DD> +</DL> + To send a message to the FLTK mailing list ("fltk@easysw.com") you +must first join the list. Non-member submissions are blocked to avoid +problems with SPAM... +<P>To join the FLTK mailing list, send a message to +"majordomo@easysw.com" with "subscribe fltk" in the message body. A +digest of this list is available by subscribing to the "fltk-digest" +mailing list. </P> +<H2>Reporting Bugs</H2> + To report a bug in FLTK, send an email to "fltk-bugs@easysw.com". +Please include the FLTK version, operating system & version, and +compiler that you are using when describing the bug or problem. +<P>For general support and questions, please use the FLTK mailing list +at "fltk@easysw.com". </P> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/license.html b/documentation/license.html index add40a768..ff88ad13b 100644 --- a/documentation/license.html +++ b/documentation/license.html @@ -1,468 +1,376 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="license">G - Software License</A></H1> - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=license>G - Software License</A></H1> <H2>GNU LIBRARY GENERAL PUBLIC LICENSE</H2> - -<P ALIGN=CENTER>Version 2, June 1991<BR> -Copyright (C) 1991 Free Software Foundation, Inc.<BR> -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA<BR> -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed.<BR> -[This is the first released version of the library GPL. It is -numbered 2 because it goes with version 2 of the ordinary GPL.] - +<P ALIGN=CENTER>Version 2, June 1991 +<BR> Copyright (C) 1991 Free Software Foundation, Inc. +<BR> 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +<BR> Everyone is permitted to copy and distribute verbatim copies of +this license document, but changing it is not allowed. +<BR> [This is the first released version of the library GPL. It is +numbered 2 because it goes with version 2 of the ordinary GPL.] </P> <H2>Preamble</H2> - -The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - -<P>This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - -<P>When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - -<P>To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - -<P>For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - -<P>Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - -<P>Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - -<P>Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - -<P>Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - -<P>The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - -<P>Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - -<P>However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - -<P>The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the libary" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - -<P>Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - -<H2 ALIGN=CENTER>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</H2> - -<STRONG>0.</STRONG> This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - -<P>A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - -<P>The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - -<P>"Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - -<P>Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - -<P><STRONG>1.</STRONG> You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - -<P>You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - -<P><STRONG>2.</STRONG> You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - -<BLOCKQUOTE> - -<STRONG>a)</STRONG> The modified work must itself be a software library. - -<P><STRONG>b)</STRONG> You must cause the files modified to carry prominent notices -stating that you changed the files and the date of any change. - -<P><STRONG>c)</STRONG> You must cause the whole of the work to be licensed at no -charge to all third parties under the terms of this License. - -<P><STRONG>d)</STRONG> If a facility in the modified Library refers to a function or a -table of data to be supplied by an application program that uses -the facility, other than as an argument passed when the facility -is invoked, then you must make a good faith effort to ensure that, -in the event an application does not supply such function or -table, the facility still operates, and performs whatever part of -its purpose remains meaningful. - -<P>(For example, a function in a library to compute square roots has -a purpose that is entirely well-defined independent of the -application. Therefore, Subsection 2d requires that any -application-supplied function or table used by this function must -be optional: if the application does not supply it, the square -root function must still compute square roots.) - -</BLOCKQUOTE> - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -<P>Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -<P>In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - -<P><STRONG>3.</STRONG> You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - -<P>Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - -<P>This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - -<P><STRONG>4.</STRONG> You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - -<P>If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - -<P><STRONG>5.</STRONG> A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - -<P>However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - -<P>When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - -<P>If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - -<P>Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - -<P><STRONG>6.</STRONG> As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - -<P>You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - -<BLOCKQUOTE> - -<STRONG>a)</STRONG> Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - -<P><STRONG>b)</STRONG> - Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - -<P><STRONG>c)</STRONG> - If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - -<P><STRONG>d)</STRONG> - Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. -</BLOCKQUOTE> - -For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - -<P>It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - -<P><STRONG>7.</STRONG> - You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - -<BLOCKQUOTE> - -<STRONG>a)</STRONG> - Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - -<P><STRONG>b)</STRONG> - Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. -</BLOCKQUOTE> - -<STRONG>8.</STRONG> - You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - -<P><STRONG>9.</STRONG> - You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - -<P><STRONG>10.</STRONG> - Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - -<P><STRONG>11.</STRONG> - If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -<P>If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -<P>It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -<P>This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - -<P><STRONG>12.</STRONG> - If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - -<P><STRONG>13.</STRONG> - The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -<P>Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - -<P><STRONG>14.</STRONG> - If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - + The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public Licenses +are intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. +<P>This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. </P> +<P>When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it in +new free programs; and that you know you can do these things. </P> +<P>To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the library, or if you modify it. </P> +<P>For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. </P> +<P>Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. </P> +<P>Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. </P> +<P>Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. </P> +<P>Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License, which was designed for utility +programs. This license, the GNU Library General Public License, +applies to certain designated libraries. This license is quite +different from the ordinary one; be sure to read it in full, and don't +assume that anything in it is the same as in the ordinary license. </P> +<P>The reason we have a separate public license for some libraries is +that they blur the distinction we usually make between modifying or +adding to a program and simply using it. Linking a program with a +library, without changing the library, is in some sense simply using +the library, and is analogous to running a utility program or +application program. However, in a textual and legal sense, the linked +executable is a combined work, a derivative of the original library, +and the ordinary General Public License treats it as such. </P> +<P>Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. </P> +<P>However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended +to permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to +achieve this as regards changes in header files, but we have achieved +it as regards changes in the actual functions of the Library.) The +hope is that this will lead to faster development of free libraries. </P> +<P>The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the libary" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. </P> +<P>Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. </P> +<H2 ALIGN=CENTER>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND +MODIFICATION</H2> +<STRONG>0.</STRONG> This License Agreement applies to any software +library which contains a notice placed by the copyright holder or other +authorized party saying it may be distributed under the terms of this +Library General Public License (also called "this License"). Each +licensee is addressed as "you". +<P>A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. </P> +<P>The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) </P> +<P>"Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. </P> +<P>Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does and +what the program that uses the Library does. </P> +<P><STRONG>1.</STRONG> You may copy and distribute verbatim copies of +the Library's complete source code as you receive it, in any medium, +provided that you conspicuously and appropriately publish on each copy +an appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the Library. </P> +<P>You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. </P> +<P><STRONG>2.</STRONG> You may modify your copy or copies of the +Library or any portion of it, thus forming a work based on the Library, +and copy and distribute such modifications or work under the terms of +Section 1 above, provided that you also meet all of these conditions: <BLOCKQUOTE> +<STRONG>a)</STRONG> The modified work must itself be a software +library. +<P><STRONG>b)</STRONG> You must cause the files modified to carry +prominent notices stating that you changed the files and the date of +any change. </P> +<P><STRONG>c)</STRONG> You must cause the whole of the work to be +licensed at no charge to all third parties under the terms of this +License. </P> +<P><STRONG>d)</STRONG> If a facility in the modified Library refers to +a function or a table of data to be supplied by an application program +that uses the facility, other than as an argument passed when the +facility is invoked, then you must make a good faith effort to ensure +that, in the event an application does not supply such function or +table, the facility still operates, and performs whatever part of its +purpose remains meaningful. </P> +<P>(For example, a function in a library to compute square roots has a +purpose that is entirely well-defined independent of the application. + Therefore, Subsection 2d requires that any application-supplied +function or table used by this function must be optional: if the +application does not supply it, the square root function must still +compute square roots.) </P> +</BLOCKQUOTE> These requirements apply to the modified work as a whole. + If identifiable sections of that work are not derived from the +Library, and can be reasonably considered independent and separate +works in themselves, then this License, and its terms, do not apply to +those sections when you distribute them as separate works. But when +you distribute the same sections as part of a whole which is a work +based on the Library, the distribution of the whole must be on the +terms of this License, whose permissions for other licensees extend to +the entire whole, and thus to each and every part regardless of who +wrote it. </P> +<P>Thus, it is not the intent of this section to claim rights or +contest your rights to work written entirely by you; rather, the intent +is to exercise the right to control the distribution of derivative or +collective works based on the Library. </P> +<P>In addition, mere aggregation of another work not based on the +Library with the Library (or with a work based on the Library) on a +volume of a storage or distribution medium does not bring the other +work under the scope of this License. </P> +<P><STRONG>3.</STRONG> You may opt to apply the terms of the ordinary +GNU General Public License instead of this License to a given copy of +the Library. To do this, you must alter all the notices that refer to +this License, so that they refer to the ordinary GNU General Public +License, version 2, instead of to this License. (If a newer version +than version 2 of the ordinary GNU General Public License has appeared, +then you can specify that version instead if you wish.) Do not make +any other change in these notices. </P> +<P>Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. </P> +<P>This option is useful when you wish to copy part of the code of the +Library into a program that is not a library. </P> +<P><STRONG>4.</STRONG> You may copy and distribute the Library (or a +portion or derivative of it, under Section 2) in object code or +executable form under the terms of Sections 1 and 2 above provided that +you accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections 1 +and 2 above on a medium customarily used for software interchange. </P> +<P>If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to distribute +the source code, even though third parties are not compelled to copy +the source along with the object code. </P> +<P><STRONG>5.</STRONG> A program that contains no derivative of any +portion of the Library, but is designed to work with the Library by +being compiled or linked with it, is called a "work that uses the +Library". Such a work, in isolation, is not a derivative work of the +Library, and therefore falls outside the scope of this License. </P> +<P>However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. Section +6 states terms for distribution of such executables. </P> +<P>When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. </P> +<P>If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) </P> +<P>Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, whether +or not they are linked directly with the Library itself. </P> +<P><STRONG>6.</STRONG> As an exception to the Sections above, you may +also compile or link a "work that uses the Library" with the Library to +produce a work containing portions of the Library, and distribute that +work under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. </P> +<P>You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: <BLOCKQUOTE><STRONG>a)</STRONG> Accompany the work +with the complete corresponding machine-readable source code for the +Library including whatever changes were used in the work (which must +be distributed under Sections 1 and 2 above); and, if the work is an +executable linked with the Library, with the complete machine-readable +"work that uses the Library", as object code and/or source code, so +that the user can modify the Library and then relink to produce a +modified executable containing the modified Library. (It is +understood that the user who changes the contents of definitions files +in the Library will not necessarily be able to recompile the +application to use the modified definitions.) +<P><STRONG>b)</STRONG> Accompany the work with a written offer, valid +for at least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more than the cost +of performing this distribution. </P> +<P><STRONG>c)</STRONG> If distribution of the work is made by offering +access to copy from a designated place, offer equivalent access to +copy the above specified materials from the same place. </P> +<P><STRONG>d)</STRONG> Verify that the user has already received a copy +of these materials or that you have already sent this user a copy. </P> +</BLOCKQUOTE> For an executable, the required form of the "work that +uses the Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major components +(compiler, kernel, and so on) of the operating system on which the +executable runs, unless that component itself accompanies the +executable. </P> +<P>It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. </P> +<P><STRONG>7.</STRONG> You may place library facilities that are a work +based on the Library side-by-side in a single library together with +other library facilities not covered by this License, and distribute +such a combined library, provided that the separate distribution of the +work based on the Library and of the other library facilities is +otherwise permitted, and provided that you do these two things: <BLOCKQUOTE> +<STRONG>a)</STRONG> Accompany the combined library with a copy of the +same work based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the Sections +above. +<P><STRONG>b)</STRONG> Give prominent notice with the combined library +of the fact that part of it is a work based on the Library, and +explaining where to find the accompanying uncombined form of the same +work. </P> +</BLOCKQUOTE><STRONG>8.</STRONG> You may not copy, modify, sublicense, +link with, or distribute the Library except as expressly provided under +this License. Any attempt otherwise to copy, modify, sublicense, link +with, or distribute the Library is void, and will automatically +terminate your rights under this License. However, parties who have +received copies, or rights, from you under this License will not have +their licenses terminated so long as such parties remain in full +compliance. </P> +<P><STRONG>9.</STRONG> You are not required to accept this License, +since you have not signed it. However, nothing else grants you +permission to modify or distribute the Library or its derivative works. + These actions are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Library (or any work based +on the Library), you indicate your acceptance of this License to do so, +and all its terms and conditions for copying, distributing or modifying +the Library or works based on it. </P> +<P><STRONG>10.</STRONG> Each time you redistribute the Library (or any +work based on the Library), the recipient automatically receives a +license from the original licensor to copy, distribute, link with or +modify the Library subject to these terms and conditions. You may not +impose any further restrictions on the recipients' exercise of the +rights granted herein. You are not responsible for enforcing compliance +by third parties to this License. </P> +<P><STRONG>11.</STRONG> If, as a consequence of a court judgment or +allegation of patent infringement or for any other reason (not limited +to patent issues), conditions are imposed on you (whether by court +order, agreement or otherwise) that contradict the conditions of this +License, they do not excuse you from the conditions of this License. + If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, +then as a consequence you may not distribute the Library at all. For +example, if a patent license would not permit royalty-free +redistribution of the Library by all those who receive copies directly +or indirectly through you, then the only way you could satisfy both it +and this License would be to refrain entirely from distribution of the +Library. </P> +<P>If any portion of this section is held invalid or unenforceable +under any particular circumstance, the balance of the section is +intended to apply, and the section as a whole is intended to apply in +other circumstances. </P> +<P>It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up +to the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that +choice. </P> +<P>This section is intended to make thoroughly clear what is believed +to be a consequence of the rest of this License. </P> +<P><STRONG>12.</STRONG> If the distribution and/or use of the Library +is restricted in certain countries either by patents or by copyrighted +interfaces, the original copyright holder who places the Library under +this License may add an explicit geographical distribution limitation +excluding those countries, so that distribution is permitted only in or +among countries not thus excluded. In such case, this License +incorporates the limitation as if written in the body of this License. </P> +<P><STRONG>13.</STRONG> The Free Software Foundation may publish +revised and/or new versions of the Library General Public License from +time to time. Such new versions will be similar in spirit to the +present version, but may differ in detail to address new problems or +concerns. </P> +<P>Each version is given a distinguishing version number. If the +Library specifies a version number of this License which applies to it +and "any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. </P> +<P><STRONG>14.</STRONG> If you wish to incorporate parts of the Library +into other free programs whose distribution conditions are incompatible +with these, write to the author to ask for permission. For software +which is copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. </P> <H2 ALIGN=CENTER>NO WARRANTY</H2> - -<P><STRONG>15.</STRONG> - BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -<P><STRONG>16.</STRONG> - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - +<P><STRONG>15.</STRONG> BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, +THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU +ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. </P> +<P><STRONG>16.</STRONG> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW +OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY +WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE +LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL +OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. </P> <H2 ALIGN=CENTER>END OF TERMS AND CONDITIONS</H2> - -</BODY> -</HTML> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/opengl.html b/documentation/opengl.html index f566d30ad..d618815d1 100644 --- a/documentation/opengl.html +++ b/documentation/opengl.html @@ -1,48 +1,33 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="opengl">9 - Using OpenGL</A></H1> - -This chapter discusses using FLTK for your OpenGL applications. - -<h2>Using OpenGL in FLTK</h2> - -The easiest way to make an OpenGL display is to subclass <a -href="#Fl_Gl_Window"><tt>Fl_Gl_Window</tt></a>. Your subclass must -implement a <tt>draw()</tt> method which uses OpenGL calls to draw the -display. Your main program should call <tt>redraw()</tt> when the -display needs to change, and (somewhat later) FLTK will call -<tt>draw()</tt>. - -<p>With a bit of care you can also use OpenGL to draw into normal FLTK -windows. This is mostly useful because you can use Gourand shading for -drawing your widgets. To do this you use the <a -href="#gl_start"><tt>gl_start()</tt></a> and <a -href="#gl_finish"><tt>gl_finish()</tt></a> functions around your OpenGL -code. - -<p>You must include FLTK's <tt><FL/gl.h></tt> header file. It will include -the file <tt><GL/gl.h></tt>, define some extra drawing functions -provided by FLTK, and include the <tt><windows.h></tt> header file needed -by WIN32 applications. - -<h2>Making a Subclass of Fl_Gl_Window</h2> - -To make a subclass of Fl_Gl_Window, you must provide: - -<ul> - - <li>A class definition. - <li>A <tt>draw()</tt> method. - <li>A <tt>handle()</tt> method (if you need to recieve input from - the user). -</ul> - -<h3>Defining the Subclass</h3> - -To define the subclass you just subclass <tt>Fl_Gl_Window</tt> class: - -<ul><pre> +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=opengl>9 - Using OpenGL</A></H1> + This chapter discusses using FLTK for your OpenGL applications. +<H2>Using OpenGL in FLTK</H2> + The easiest way to make an OpenGL display is to subclass <A href=Fl_Gl_Window.html#Fl_Gl_Window> +<TT>Fl_Gl_Window</TT></A>. Your subclass must implement a <TT>draw()</TT> + method which uses OpenGL calls to draw the display. Your main program +should call <TT>redraw()</TT> when the display needs to change, and +(somewhat later) FLTK will call <TT>draw()</TT>. +<P>With a bit of care you can also use OpenGL to draw into normal FLTK +windows. This is mostly useful because you can use Gourand shading for +drawing your widgets. To do this you use the <A href=#gl_start><TT> +gl_start()</TT></A> and <A href=#gl_finish><TT>gl_finish()</TT></A> + functions around your OpenGL code. </P> +<P>You must include FLTK's <TT><FL/gl.h></TT> header file. It will +include the file <TT><GL/gl.h></TT>, define some extra drawing +functions provided by FLTK, and include the <TT><windows.h></TT> header +file needed by WIN32 applications. </P> +<H2>Making a Subclass of Fl_Gl_Window</H2> + To make a subclass of Fl_Gl_Window, you must provide: +<UL> +<LI>A class definition. </LI> +<LI>A <TT>draw()</TT> method. </LI> +<LI>A <TT>handle()</TT> method (if you need to recieve input from the +user). </LI> +</UL> +<H3>Defining the Subclass</H3> + To define the subclass you just subclass <TT>Fl_Gl_Window</TT> class: +<UL> +<PRE> class MyWindow : public Fl_Gl_Window { void draw(); int handle(int); @@ -51,17 +36,16 @@ public: MyWindow(int X, int Y, int W, int H, const char *L) : Fl_Gl_Window(X, Y, W, H, L) {} }; -</pre></ul> - -The <tt>draw()</tt> and <tt>handle()</tt> methods are described below. Like -any widget, you can include additional private and public data in your class -(such as scene graph information, etc.) - -<h3>The draw() Method</H3> - -The <tt>draw()</tt> method is where you actually do your OpenGL drawing: - -<ul><pre> +</PRE> +</UL> + The <TT>draw()</TT> and <TT>handle()</TT> methods are described below. + Like any widget, you can include additional private and public data in +your class (such as scene graph information, etc.) +<H3>The draw() Method</H3> + The <TT>draw()</TT> method is where you actually do your OpenGL +drawing: +<UL> +<PRE> void MyWindow::draw() { if (!valid()) { ... set up projection, viewport, etc ... @@ -70,14 +54,13 @@ void MyWindow::draw() { } ... draw ... } -</pre></ul> - -<h3>The handle() Method</h3> - -The <tt>handle()</tt> method handles mouse and keyboard events for the -window: - -<ul><pre> +</PRE> +</UL> +<H3>The handle() Method</H3> + The <TT>handle()</TT> method handles mouse and keyboard events for the +window: +<UL> +<PRE> int MyWindow::handle(int event) { switch(event) { case FL_PUSH: @@ -103,16 +86,16 @@ int MyWindow::handle(int event) { return 0; } } -</pre></ul> - -When <tt>handle()</tt> is called, the OpenGL context is not set up! If your -display changes, you should call <tt>redraw()</tt> and let <tt>draw()</tt> do the work. -Don't call any OpenGL drawing functions from inside <tt>handle()</tt>! - -<p>You can call some OpenGL stuff like hit detection and texture loading -functions by doing: - -<ul><pre> +</PRE> +</UL> + When <TT>handle()</TT> is called, the OpenGL context is not set up! + If your display changes, you should call <TT>redraw()</TT> and let <TT> +draw()</TT> do the work. Don't call any OpenGL drawing functions from +inside <TT>handle()</TT>! +<P>You can call some OpenGL stuff like hit detection and texture +loading functions by doing: </P> +<UL> +<PRE> case FL_PUSH: make_current(); // make OpenGL context current if (!valid()) { @@ -121,154 +104,116 @@ functions by doing: } ... ok to call NON-DRAWING OpenGL code here, such as hit detection, loading textures, etc... -</pre></ul> - -Your main program can now create one of your windows by doing <tt>new -MyWindow(...)</tt>. You can also use <a href="#fluid">fluid</a> by: - -<ol> - <li>Put your class definition in a MyWindow.H file. - - <li>In fluid create a box object, resize & place where you want. - - <li>In the control panel, fill in the "class" field with MyWindow.H. - This will make fluid produce constructors for your new class. - - <li>In the "extra code" put <tt>#include "MyWindow.H"</tt>, so - that the fluid output file will compile. - -</ol> - -You must put <tt>glwindow->show()</tt> in your main code after calling -<tt>show()</tt> on the window containing the OpenGL window. - -<h2>Using OpenGL in Normal FLTK Windows</h2> - -You can put OpenGL code into an <a -href="#draw"><tt>Fl_Widget::draw()</tt></a> method or into the code for -a <a href="#boxtypes">boxtype</a> or other places with some care. - -<p>Most important, before you show <i>any</i> windows (including those -that don't have OpenGL drawing) you must initialize FLTK so that it -knows it is going to use OpenGL. You may use any of the symbols -described for <a -href="#Fl_Gl_Window.mode"><tt>Fl_Gl_Window::mode()</tt></a> to describe -how you intend to use OpenGL: - -<ul><pre> +</PRE> +</UL> + Your main program can now create one of your windows by doing <TT>new +MyWindow(...)</TT>. You can also use <A href=fluid.html#fluid>fluid</A> + by: +<OL> +<LI>Put your class definition in a MyWindow.H file. </LI> +<LI>In fluid create a box object, resize place where you want. </LI> +<LI>In the control panel, fill in the "class" field with MyWindow.H. + This will make fluid produce constructors for your new class. </LI> +<LI>In the "extra code" put <TT>#include "MyWindow.H"</TT>, so that +the fluid output file will compile. </LI> +</OL> + You must put <TT>glwindow->show()</TT> in your main code after calling <TT> +show()</TT> on the window containing the OpenGL window. +<H2>Using OpenGL in Normal FLTK Windows</H2> + You can put OpenGL code into an <A href=#draw><TT>Fl_Widget::draw()</TT> +</A> method or into the code for a <A href=common.html#boxtypes>boxtype</A> + or other places with some care. +<P>Most important, before you show <I>any</I> windows (including those +that don't have OpenGL drawing) you must initialize FLTK so that it +knows it is going to use OpenGL. You may use any of the symbols +described for <A href=Fl_Gl_Window.html#Fl_Gl_Window.mode><TT> +Fl_Gl_Window::mode()</TT></A> to describe how you intend to use OpenGL: </P> +<UL> +<PRE> Fl::gl_visual(FL_RGB); -</pre></ul> - -You can then put OpenGL drawing code anywhere you can draw normally -by surrounding it with: - -<ul><pre> +</PRE> +</UL> + You can then put OpenGL drawing code anywhere you can draw normally by +surrounding it with: +<UL> +<PRE> gl_start(); ... put your OpenGL code here ... gl_finish(); -</pre></ul> - -<a name="gl_start"><tt>gl_start()</tt></a> and <a -name="gl_finish"><tt>gl_finish()</tt></a> set up an OpenGL context with -an orthographic projection so that 0,0 is the lower-left corner of the -window and each pixel is one unit. The current clipping is reproduced -with OpenGL <tt>glScissor()</tt> commands. These also synchronize the -OpenGL graphics stream with the drawing done by other X, WIN32, or FLTK -functions. - -<p>The same context is reused each time. If your code changes the -projection transformation or anything else you should use -<tt>glPushMatrix()</tt> and <tt>glPopMatrix()</tt> functions to put the -state back before calling <tt>gl_finish()</tt>. - -<p>You may want to use <tt>Fl_Window::current()->h()</tt> to get -the drawable height so you can flip the Y coordinates. - -<p>Unfortunately, there are a bunch of limitations you must adhere to for -maximum portability: - -<ul> - - <li>You must choose a default visual with <a - href="#gl_visual"><tt>Fl::gl_visual()</tt></a>. - - <li>You cannot pass <tt>FL_DOUBLE</tt> to <tt>Fl::gl_visual()</tt>. - - <li>You cannot use <tt>Fl_Double_Window</tt> or - <tt>Fl_Overlay_Window</tt>. - -</ul> - -Do <i>not</i> call <tt>gl_start()</tt> or <tt>gl_finish()</tt> when drawing -into an <tt>Fl_Gl_Window</tt>! - -<h2>OpenGL drawing functions</h2> - -FLTK provides some useful OpenGL drawing functions. They can be freely -mixed with any OpenGL calls, and are defined by including -<tt><FL/gl.H></tt> (which you should include instead of the OpenGL -header <tt><GL/gl.h></tt>). - -<h3>void gl_color(Fl_Color)</h3> - -Set the current color to a FLTK color index. <i>For color-index modes -it will use <tt>fl_xpixel(c)</tt>, which is only right if this window -uses the default colormap!</i> - -<h3>void gl_rect(int x, int y, int w, int h)<br> -void gl_rectf(int x, int y, int w, int h)</h3> - -Outline or fill a rectangle with the current color. If -<tt>ortho()</tt> has been called, then the rectangle will exactly fill -the pixel rectangle passed. - -<h3>void gl_font(Fl_Font fontid, int size)</h3> - -Set the "current OpenGL font" to the same font you get by calling -<a href="#fl_font"><tt>fl_font()</tt></a>. - -<h3>int gl_height()<br> -int gl_descent()<br> -float gl_width(const char *)<br> -float gl_width(const char *, int n)<br> -float gl_width(uchar)</h3> - -Return information about the current OpenGL font. - -<h3>void gl_draw(const char *)<br> -void gl_draw(const char *, int n)</h3> - -Draw a nul-terminated string or an array of <tt>n</tt> characters in -the current OpenGL font at the current <tt>glRasterPos</tt>. - -<h3>void gl_draw(const char *, int x, int y)<br> -void gl_draw(const char *, int n, int x, int y)<br> -void gl_draw(const char *, float x, float y)<br> -void gl_draw(const char *, int n, float x, float y)</h3> - -Draw a nul-terminated string or an array of <tt>n</tt> characters in -the current OpenGL font at the given position. - -<h3>void gl_draw(const char *, int x, int y, int w, int h, Fl_Align)</h3> - -Draw a string formatted into a box, with newlines and tabs expanded, -other control characters changed to ^X, and aligned with the edges or -center. Exactly the same output as <a href="#fl_draw"><tt>fl_draw()</tt></a>. - -<h2>Using OpenGL Optimizer with FLTK</h2> - -<a href="http://www.sgi.com/software/optimizer">OpenGL Optimizer</a> is -a scene graph toolkit for OpenGL available from Silicon Graphics for -IRIX and Microsoft Windows. Versions are in the works for Solaris and -HP-UX. It allows you to view large scenes without writing a lot of -OpenGL code. - -<h3>OptimizerWindow Class Definition</h3> - -To use OpenGL Optimizer with FLTK you'll need to create a subclass of -<tt>Fl_Gl_Widget</tt> that includes several state variables: - -<ul><pre> +</PRE> +</UL> +<A name=gl_start><TT>gl_start()</TT></A> and <A name=gl_finish><TT> +gl_finish()</TT></A> set up an OpenGL context with an orthographic +projection so that 0,0 is the lower-left corner of the window and each +pixel is one unit. The current clipping is reproduced with OpenGL <TT> +glScissor()</TT> commands. These also synchronize the OpenGL graphics +stream with the drawing done by other X, WIN32, or FLTK functions. +<P>The same context is reused each time. If your code changes the +projection transformation or anything else you should use <TT> +glPushMatrix()</TT> and <TT>glPopMatrix()</TT> functions to put the +state back before calling <TT>gl_finish()</TT>. </P> +<P>You may want to use <TT>Fl_Window::current()->h()</TT> to get the +drawable height so you can flip the Y coordinates. </P> +<P>Unfortunately, there are a bunch of limitations you must adhere to +for maximum portability: </P> +<UL> +<LI>You must choose a default visual with <A href=functions.html#gl_visual> +<TT>Fl::gl_visual()</TT></A>. </LI> +<LI>You cannot pass <TT>FL_DOUBLE</TT> to <TT>Fl::gl_visual()</TT>. </LI> +<LI>You cannot use <TT>Fl_Double_Window</TT> or <TT>Fl_Overlay_Window</TT> +. </LI> +</UL> + Do <I>not</I> call <TT>gl_start()</TT> or <TT>gl_finish()</TT> when +drawing into an <TT>Fl_Gl_Window</TT>! +<H2>OpenGL drawing functions</H2> + FLTK provides some useful OpenGL drawing functions. They can be +freely mixed with any OpenGL calls, and are defined by including <TT> +<FL/gl.H></TT> (which you should include instead of the OpenGL header <TT> +<GL/gl.h></TT>). +<H3>void gl_color(Fl_Color)</H3> + Set the current color to a FLTK color index. <I>For color-index modes +it will use <TT>fl_xpixel(c)</TT>, which is only right if this window +uses the default colormap!</I> +<H3>void gl_rect(int x, int y, int w, int h) +<BR> void gl_rectf(int x, int y, int w, int h)</H3> + Outline or fill a rectangle with the current color. If <TT>ortho()</TT> + has been called, then the rectangle will exactly fill the pixel +rectangle passed. +<H3>void gl_font(Fl_Font fontid, int size)</H3> + Set the "current OpenGL font" to the same font you get by calling <A href=drawing.html#fl_font> +<TT>fl_font()</TT></A>. +<H3>int gl_height() +<BR> int gl_descent() +<BR> float gl_width(const char *) +<BR> float gl_width(const char *, int n) +<BR> float gl_width(uchar)</H3> + Return information about the current OpenGL font. +<H3>void gl_draw(const char *) +<BR> void gl_draw(const char *, int n)</H3> + Draw a nul-terminated string or an array of <TT>n</TT> characters in +the current OpenGL font at the current <TT>glRasterPos</TT>. +<H3>void gl_draw(const char *, int x, int y) +<BR> void gl_draw(const char *, int n, int x, int y) +<BR> void gl_draw(const char *, float x, float y) +<BR> void gl_draw(const char *, int n, float x, float y)</H3> + Draw a nul-terminated string or an array of <TT>n</TT> characters in +the current OpenGL font at the given position. +<H3>void gl_draw(const char *, int x, int y, int w, int h, Fl_Align)</H3> + Draw a string formatted into a box, with newlines and tabs expanded, +other control characters changed to ^X, and aligned with the edges or +center. Exactly the same output as <A href=#fl_draw><TT>fl_draw()</TT></A> +. +<H2>Using OpenGL Optimizer with FLTK</H2> +<A href=http://www.sgi.com/software/optimizer>OpenGL Optimizer</A> is a +scene graph toolkit for OpenGL available from Silicon Graphics for IRIX +and Microsoft Windows. Versions are in the works for Solaris and +HP-UX. It allows you to view large scenes without writing a lot of +OpenGL code. +<H3>OptimizerWindow Class Definition</H3> + To use OpenGL Optimizer with FLTK you'll need to create a subclass of <TT> +Fl_Gl_Widget</TT> that includes several state variables: +<UL> +<PRE> class OptimizerWindow : public Fl_Gl_Window { csContext *context_; // Initialized to 0 and set by draw()... csDrawAction *draw_action_; // Draw action... @@ -291,33 +236,34 @@ public: void camera(csCamera *c) { camera_ = c; if (context_) { - draw_action_->setCamera(camera_); - camera_->draw(draw_action_); + draw_action_->setCamera(camera_); + camera_->draw(draw_action_); redraw(); } } }; -</ul><pre> +</PRE> +</UL> +<PRE> +</PRE> <H3>The camera() Method</H3> - -The <tt>camera()</tt> method sets the camera (projection and viewpoint) -to use when drawing the scene. The scene is redrawn after this call. - -<h3>The draw() Method</h3> - -The <tt>draw()</tt> method performs the needed initialization -and does the actual drawing: - -<ul><pre> + The <TT>camera()</TT> method sets the camera (projection and +viewpoint) to use when drawing the scene. The scene is redrawn after +this call. +<H3>The draw() Method</H3> + The <TT>draw()</TT> method performs the needed initialization and does +the actual drawing: +<UL> +<PRE> void OptimizerWindow::draw() { if (!context_) { // This is the first time we've been asked to draw; create the // Optimizer context for the scene... context_ = new csContext(fl_display, fl_visual); - context_->ref(); - context_->makeCurrent(fl_display, fl_window); + context_->ref(); + context_->makeCurrent(fl_display, fl_window); ... perform other context setup as desired ... @@ -325,19 +271,19 @@ void OptimizerWindow::draw() { draw_action_ = new csDrawAction; if (camera_) { - draw_action_->setCamera(camera_); - camera_->draw(draw_action_); + draw_action_->setCamera(camera_); + camera_->draw(draw_action_); } } if (!valid()) { // Update the viewport for this context... - context_->setViewport(0, 0, w(), h()); + context_->setViewport(0, 0, w(), h()); } // Clear the window... - context_->clear(csContext::COLOR_CLEAR | csContext::DEPTH_CLEAR, + context_->clear(csContext::COLOR_CLEAR | csContext::DEPTH_CLEAR, 0.0f, // Red 0.0f, // Green 0.0f, // Blue @@ -346,15 +292,11 @@ void OptimizerWindow::draw() { // Then draw the scene (if any)... if (scene_) - draw_action_->apply(scene_); + draw_action_->apply(scene_); } -</pre></ul> - +</PRE> +</UL> <H3>The scene() Method</H3> - -The <tt>scene()</tt> method sets the scene to be drawn. The scene is -a collection of 3D objects in a <tt>csGroup</tt>. The scene is redrawn -after this call. - -</BODY> -</HTML> + The <TT>scene()</TT> method sets the scene to be drawn. The scene is +a collection of 3D objects in a <TT>csGroup</TT>. The scene is redrawn +after this call. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/osissues.html b/documentation/osissues.html index 572d8952c..83f6d6897 100644 --- a/documentation/osissues.html +++ b/documentation/osissues.html @@ -1,271 +1,216 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="osissues">F - Operating System Issues</A></H1> - -This appendix describes the X and WIN32 specific interfaces in FLTK. - -<h2>X-Specific Interface</h2> - -<ul><pre> -#include <FL/x.H> -</pre></ul> - -On X you can include this file to access FLTK's X-specific functions. -Be warned that some of the structures and calls in it are subject to -change in future version of FLTK. Try to avoid doing this so your code -is portable. - -<h3>Handling Other X Events</h3> - -<h4><a name="add_handler">void Fl::add_handler(int (*f)(int))</a></h4> - -Installs a function to parse unrecognized events. If FLTK cannot figure -out what to do with an event, it calls each of these functions (most -recent first) until one of them returns non-zero. If none of them -returns non-zero then the event is ignored. - -<p>FLTK calls this for any X events it does not recognize, or X events -with a window id that FLTK does not recognize. You can look at the X -event with the <a href="#fl_xevent"><tt>fl_xevent</tt></a> variable. - -<p>The argument is zero for unrecognized X events. These handlers are -also called for global shortcuts and some other events that the widget -they were passed to did not handle. In this case the argument is -non-zero (for example <tt>FL_SHORTCUT</tt>). - -<h4><a name="fl_xevent">extern XEvent *fl_xvent</a></h4> - -The most recent X event. - -<h4><a name="fl_event_time">extern ulong fl_event_time</a></h4> - -This is the time stamp from the most recent X event that reported it -(not all do). Many X calls (like cut and paste) need this value. - -<h4><a name="fl_xid">Window fl_xid(const Fl_Window *)</a></h4> - -Returns the XID for a window, or zero if not <tt>shown()</tt>. - -<h4><a name="fl_find">Fl_Window *fl_find(ulong xid)</a></h4> - -Returns the <tt>Fl_Window</tt> that corresponds to the given XID, or -<tt>NULL</tt> if not found. This uses a cache so it is slightly faster -than iterating through the windows yourself. - -<h4><a name="fl_handle">int fl_handle(const XEvent &)</a></h4> - -This call allows you to supply the X events to FLTK, which may allow -FLTK to cooperate with another toolkit or library. The return value -is true if FLTK understood the event (if the window does not belong to -FLTK and the <tt>add_handler()</tt> functions all ignore it this returns -false). - -<p>Besides feeding events your code should call <a -href="#flush"><tt>Fl::flush()</tt></a> periodically so that FLTK -redraws its windows. - -<p>This function will call the callback functions. It will not return -until they complete. In particular if a callback pops up a modal -window (by calling <a href="#fl_ask"><tt>fl_ask()</tt></a>, for -instance) it will not return until the modal function returns. - -<h3>Drawing using Xlib</h3> - -The following global variables are set before -<tt>Fl_Widget::draw()</tt> is called, or by <a -href="#Fl_Window.make_current"><tt>Fl_Window::make_current()</tt></a>: - -<ul><pre> +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=osissues>F - Operating System Issues</A></H1> + This appendix describes the X and WIN32 specific interfaces in FLTK. +<H2>X-Specific Interface</H2> +<UL> +<PRE> +#include <FL/x.H> +</PRE> +</UL> + On X you can include this file to access FLTK's X-specific functions. + Be warned that some of the structures and calls in it are subject to +change in future version of FLTK. Try to avoid doing this so your code +is portable. +<H3>Handling Other X Events</H3> +<H4><A name=add_handler>void Fl::add_handler(int (*f)(int))</A></H4> + Installs a function to parse unrecognized events. If FLTK cannot +figure out what to do with an event, it calls each of these functions +(most recent first) until one of them returns non-zero. If none of +them returns non-zero then the event is ignored. +<P>FLTK calls this for any X events it does not recognize, or X events +with a window id that FLTK does not recognize. You can look at the X +event with the <A href=#fl_xevent><TT>fl_xevent</TT></A> variable. </P> +<P>The argument is zero for unrecognized X events. These handlers are +also called for global shortcuts and some other events that the widget +they were passed to did not handle. In this case the argument is +non-zero (for example <TT>FL_SHORTCUT</TT>). </P> +<H4><A name=fl_xevent>extern XEvent *fl_xvent</A></H4> + The most recent X event. +<H4><A name=fl_event_time>extern ulong fl_event_time</A></H4> + This is the time stamp from the most recent X event that reported it +(not all do). Many X calls (like cut and paste) need this value. +<H4><A name=fl_xid>Window fl_xid(const Fl_Window *)</A></H4> + Returns the XID for a window, or zero if not <TT>shown()</TT>. +<H4><A name=fl_find>Fl_Window *fl_find(ulong xid)</A></H4> + Returns the <TT>Fl_Window</TT> that corresponds to the given XID, or <TT> +NULL</TT> if not found. This uses a cache so it is slightly faster +than iterating through the windows yourself. +<H4><A name=fl_handle>int fl_handle(const XEvent &)</A></H4> + This call allows you to supply the X events to FLTK, which may allow +FLTK to cooperate with another toolkit or library. The return value is +true if FLTK understood the event (if the window does not belong to +FLTK and the <TT>add_handler()</TT> functions all ignore it this +returns false). +<P>Besides feeding events your code should call <A href=functions.html#flush> +<TT>Fl::flush()</TT></A> periodically so that FLTK redraws its windows. </P> +<P>This function will call the callback functions. It will not return +until they complete. In particular if a callback pops up a modal +window (by calling <A href=functions.html#fl_ask><TT>fl_ask()</TT></A>, +for instance) it will not return until the modal function returns. </P> +<H3>Drawing using Xlib</H3> + The following global variables are set before <TT>Fl_Widget::draw()</TT> + is called, or by <A href=Fl_Window.html#Fl_Window.make_current><TT> +Fl_Window::make_current()</TT></A>: +<UL> +<PRE> extern Display *fl_display; extern Window fl_window; extern GC fl_gc; extern int fl_screen; extern XVisualInfo *fl_visual; extern Colormap fl_colormap; -</pre></ul> - -You must use them to produce Xlib calls. Don't attempt to change -them. A typical X drawing call is written like this: - -<ul><pre> +</PRE> +</UL> + You must use them to produce Xlib calls. Don't attempt to change +them. A typical X drawing call is written like this: +<UL> +<PRE> XDrawSomething(fl_display, fl_window, fl_gc, ...); -</pre></ul> - -Other information such as the position or size of the X window can be -found by looking at <a -href="#Fl_Window.make_current"><tt>Fl_Window::current()</tt></a>, which -returns a pointer to the <tt>Fl_Window</tt> being drawn. - -<h4><a name="fl_xpixel">unsigned long fl_xpixel(Fl_Color i)<br> -unsigned long fl_xpixel(uchar r, uchar g, uchar b)</a></h4> - -Returns the X pixel number used to draw the given FLTK color index or -RGB color. This is the X pixel that <a -href="#fl_color"><tt>fl_color()</tt></a> would use. - -<h4><a name="fl_xfont">extern XFontStruct *fl_xfont</a></h4> - -Points at the font selected by the most recent <a -href="#fl_font"><tt>fl_font()</tt></a>. This is not necessarily the -current font of <tt>fl_gc</tt>, which is not set until <a -href="#fl_draw"><tt>fl_draw()</tt></a> is called. - -<h3>Changing the Display, Screen, or X Visual</h3> - -FLTK uses only a single display, screen, X visual, and X colormap. This -greatly simplifies its internal structure and makes it much smaller and -faster. You can change which it uses by setting global variables -<i>before the first <tt>Fl_Window::show()</tt> is called</i>. You may -also want to call <a href="#visual">Fl::visual()</a>, which is a -portable interface to get a full color and/or double buffered visual. - -<h4><a name="display">int Fl::display(const char *)</a></h4> - -Set which X display to use. This actually does -<tt>putenv("DISPLAY=...")</tt> so that child programs will display on -the same screen if called with <tt>exec()</tt>. This must be done -before the display is opened. This call is provided under WIN32 but -it has no effect. - -<h4><a name="fl_display">extern Display *fl_display</a></h4> - -The open X display. This is needed as an argument to most Xlib calls. -Don't attempt to change it! This is <tt>NULL</tt> before the display is opened. - -<h4><a name="fl_open_display">void fl_open_display()</a></h4> - -Opens the display. Does nothing if it is already open. This will make -sure <tt>fl_display</tt> is non-zero. You should call this if you -wish to do X calls and there is a chance that your code will be called -before the first <tt>show()</tt> of a window. - -<p>This may call <tt>Fl::abort()</tt> if there is an error opening the display. - -<h4><a name="fl_close_display">void fl_close_display()</a></h4> - -This closes the X connection. You do <i>not</i> need to call this to -exit, and in fact it is faster to not do so! It may be useful to call -this if you want your program to continue without the X connection. -You cannot open the display again, and probably cannot call any FLTK -functions. - -<h4><a name="fl_screen">extern int fl_screen</a></h4> - -Which screen number to use. This is set by <tt>fl_open_display()</tt> -to the default screen. You can change it by setting this to a -different value immediately afterwards. It can also be set by changing -the last number in the <tt>Fl::display()</tt> string to "host:0,#". - -<h4><a name="fl_visual">extern XVisualInfo *fl_visual</a><br> -<a name="fl_colormap">extern Colormap fl_colormap</a></h4> - -The visual and colormap that FLTK will use for all windows. These -are set by <tt>fl_open_display()</tt> to the default visual and colormap. You -can change them before calling <tt>show()</tt> on the first window. Typical -code for changing the default visual is: - -<ul><pre> +</PRE> +</UL> + Other information such as the position or size of the X window can be +found by looking at <A href=Fl_Window.html#Fl_Window.make_current><TT> +Fl_Window::current()</TT></A>, which returns a pointer to the <TT> +Fl_Window</TT> being drawn. +<H4><A name=fl_xpixel>unsigned long fl_xpixel(Fl_Color i) +<BR> unsigned long fl_xpixel(uchar r, uchar g, uchar b)</A></H4> + Returns the X pixel number used to draw the given FLTK color index or +RGB color. This is the X pixel that <A href=#fl_color><TT>fl_color()</TT> +</A> would use. +<H4><A name=fl_xfont>extern XFontStruct *fl_xfont</A></H4> + Points at the font selected by the most recent <A href=drawing.html#fl_font> +<TT>fl_font()</TT></A>. This is not necessarily the current font of <TT> +fl_gc</TT>, which is not set until <A href=#fl_draw><TT>fl_draw()</TT></A> + is called. +<H3>Changing the Display, Screen, or X Visual</H3> + FLTK uses only a single display, screen, X visual, and X colormap. +This greatly simplifies its internal structure and makes it much +smaller and faster. You can change which it uses by setting global +variables <I>before the first <TT>Fl_Window::show()</TT> is called</I>. +You may also want to call <A href=functions.html#visual>Fl::visual()</A> +, which is a portable interface to get a full color and/or double +buffered visual. +<H4><A name=display>int Fl::display(const char *)</A></H4> + Set which X display to use. This actually does <TT> +putenv("DISPLAY=...")</TT> so that child programs will display on the +same screen if called with <TT>exec()</TT>. This must be done before +the display is opened. This call is provided under WIN32 but it has no +effect. +<H4><A name=fl_display>extern Display *fl_display</A></H4> + The open X display. This is needed as an argument to most Xlib calls. +Don't attempt to change it! This is <TT>NULL</TT> before the display +is opened. +<H4><A name=fl_open_display>void fl_open_display()</A></H4> + Opens the display. Does nothing if it is already open. This will +make sure <TT>fl_display</TT> is non-zero. You should call this if you +wish to do X calls and there is a chance that your code will be called +before the first <TT>show()</TT> of a window. +<P>This may call <TT>Fl::abort()</TT> if there is an error opening the +display. </P> +<H4><A name=fl_close_display>void fl_close_display()</A></H4> + This closes the X connection. You do <I>not</I> need to call this to +exit, and in fact it is faster to not do so! It may be useful to call +this if you want your program to continue without the X connection. You +cannot open the display again, and probably cannot call any FLTK +functions. +<H4><A name=fl_screen>extern int fl_screen</A></H4> + Which screen number to use. This is set by <TT>fl_open_display()</TT> + to the default screen. You can change it by setting this to a +different value immediately afterwards. It can also be set by changing +the last number in the <TT>Fl::display()</TT> string to "host:0,#". +<H4><A name=fl_visual>extern XVisualInfo *fl_visual</A> +<BR><A name=fl_colormap>extern Colormap fl_colormap</A></H4> + The visual and colormap that FLTK will use for all windows. These are +set by <TT>fl_open_display()</TT> to the default visual and colormap. + You can change them before calling <TT>show()</TT> on the first +window. Typical code for changing the default visual is: +<UL> +<PRE> Fl::args(argc, argv); // do this first so $DISPLAY is set fl_open_display(); fl_visual = find_a_good_visual(fl_display, fl_screen); -if (!fl_visual) Fl::abort("No good visual"); -fl_colormap = make_a_colormap(fl_display, fl_visual->visual, fl_visual->depth); +if (!fl_visual) Fl::abort("No good visual"); +fl_colormap = make_a_colormap(fl_display, fl_visual->visual, fl_visual->depth); // it is now ok to show() windows: -window->show(argc, argv); -</pre></ul> - -<h3>Using a Subclass of Fl_Window for Special X Stuff</h3> - -FLTK can manage an X window on a different screen, visual and/or -colormap, you just can't use FLTK's drawing routines to draw into it. -But you can write your own <tt>draw()</tt> method that uses Xlib -(and/or OpenGL) calls only. - -<p>FLTK can also manage XID's provided by other libraries or programs, -and call those libraries when the window needs to be redrawn. - -<p>To do this, you need to make a subclass of <a -href="#Fl_Window"><tt>Fl_Window</tt></a> and override some of these virtual -functions: - -<h4>virtual void Fl_Window::show()</h4> - -If the window is already <tt>shown()</tt> this must cause it to be raised, -this can usually be done by calling <tt>Fl_Window::show()</tt>. If not <tt>shown()</tt> -your implementation must call either <tt>Fl_X::set_xid()</tt> or -<tt>Fl_X::make_xid()</tt>. - -<p>An example: - -<ul><pre> +window->show(argc, argv); +</PRE> +</UL> +<H3>Using a Subclass of Fl_Window for Special X Stuff</H3> + FLTK can manage an X window on a different screen, visual and/or +colormap, you just can't use FLTK's drawing routines to draw into it. +But you can write your own <TT>draw()</TT> method that uses Xlib +(and/or OpenGL) calls only. +<P>FLTK can also manage XID's provided by other libraries or programs, +and call those libraries when the window needs to be redrawn. </P> +<P>To do this, you need to make a subclass of <A href=Fl_Window.html#Fl_Window> +<TT>Fl_Window</TT></A> and override some of these virtual functions: </P> +<H4>virtual void Fl_Window::show()</H4> + If the window is already <TT>shown()</TT> this must cause it to be +raised, this can usually be done by calling <TT>Fl_Window::show()</TT>. + If not <TT>shown()</TT> your implementation must call either <TT> +Fl_X::set_xid()</TT> or <TT>Fl_X::make_xid()</TT>. +<P>An example: </P> +<UL> +<PRE> void MyWindow::show() { if (shown()) {Fl_Window::show(); return;} // you must do this! fl_open_display(); // necessary if this is first window - // we only calcualte the necessary visual & colormap once: + // we only calcualte the necessary visual colormap once: static XVisualInfo *visual; static Colormap colormap; if (!visual) { visual = figure_out_visual(); colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen), - vis->visual, AllocNone); + vis->visual, AllocNone); } Fl_X::make_xid(this, visual, colormap); } -</pre></ul> - -<h4>Fl_X *Fl_X::set_xid(Fl_Window *, Window xid)</h4> - -Allocate a hidden structure called an <tt>Fl_X</tt>, put the XID into it, and -set a pointer to it from the <tt>Fl_Window</tt>. This causes -<tt>Fl_Window::shown()</tt> to return true. - -<h4>void Fl_X::make_xid(Fl_Window *, XVisualInfo *= fl_visual, Colormap = fl_colormap)</h4> - -This static method does the most onerous parts of creating an X window, -including setting the label, resize limitations, etc. It then does -<tt>Fl_X::set_xid()</tt> with this new window and maps the window. - -<h4>virtual void Fl_Window::flush()</h4> - -This virtual function is called by <tt>Fl::flush()</tt> to update the -window. For FLTK's own windows it does this by setting the global -variables <tt>fl_window</tt> and <tt>fl_gc</tt> and then calling the -<tt>draw()</tt> method. For your own windows you might just want to -put all the drawing code in here. - -<p>The X region that is a combination of all <tt>damage()</tt> calls -done so far is in <tt>Fl_X::i(this)->region</tt>. If <tt>NULL</tt> -then you should redraw the entire window. The undocumented function -<tt>fl_clip_region(XRegion)</tt> will initialize the FLTK clip stack -with a region or <tt>NULL</tt> for no clipping. You must set region to -<tt>NULL</tt> afterwards as <tt>fl_clip_region()</tt> now owns it and -will delete it when done. - -<p>If <tt>damage() & FL_DAMAGE_EXPOSE</tt> then only X expose events -have happened. This may be useful if you have an undamaged image (such -as a backing buffer) around. - -<p>Here is a sample where an undamaged image is kept somewhere: - -<ul><pre> +</PRE> +</UL> +<H4>Fl_X *Fl_X::set_xid(Fl_Window *, Window xid)</H4> + Allocate a hidden structure called an <TT>Fl_X</TT>, put the XID into +it, and set a pointer to it from the <TT>Fl_Window</TT>. This causes <TT> +Fl_Window::shown()</TT> to return true. +<H4>void Fl_X::make_xid(Fl_Window *, XVisualInfo *= fl_visual, Colormap += fl_colormap)</H4> + This static method does the most onerous parts of creating an X +window, including setting the label, resize limitations, etc. It then +does <TT>Fl_X::set_xid()</TT> with this new window and maps the window. +<H4>virtual void Fl_Window::flush()</H4> + This virtual function is called by <TT>Fl::flush()</TT> to update the +window. For FLTK's own windows it does this by setting the global +variables <TT>fl_window</TT> and <TT>fl_gc</TT> and then calling the <TT> +draw()</TT> method. For your own windows you might just want to put +all the drawing code in here. +<P>The X region that is a combination of all <TT>damage()</TT> calls +done so far is in <TT>Fl_X::i(this)->region</TT>. If <TT>NULL</TT> + then you should redraw the entire window. The undocumented function <TT> +fl_clip_region(XRegion)</TT> will initialize the FLTK clip stack with a +region or <TT>NULL</TT> for no clipping. You must set region to <TT> +NULL</TT> afterwards as <TT>fl_clip_region()</TT> now owns it and will +delete it when done. </P> +<P>If <TT>damage() FL_DAMAGE_EXPOSE</TT> then only X expose events have +happened. This may be useful if you have an undamaged image (such as a +backing buffer) around. </P> +<P>Here is a sample where an undamaged image is kept somewhere: </P> +<UL> +<PRE> void MyWindow::flush() { - fl_clip_region(Fl_X::i(this)->region); - Fl_X::i(this)->region = 0; + fl_clip_region(Fl_X::i(this)->region); + Fl_X::i(this)->region = 0; if (damage() != 2) {... draw things into backing store ...} ... copy backing store to window ... } -</pre></ul> - -<h4>virtual void Fl_Window::hide()</h4> - -Destroy the window server copy of the window. Usually you will destroy -contexts, pixmaps, or other resources used by the window, and then call -<tt>Fl_Window::hide()</tt> to get rid of the main window identified by -<tt>xid()</tt>. If you override this, you must also override the -destructor as shown: - -<ul><pre> +</PRE> +</UL> +<H4>virtual void Fl_Window::hide()</H4> + Destroy the window server copy of the window. Usually you will +destroy contexts, pixmaps, or other resources used by the window, and +then call <TT>Fl_Window::hide()</TT> to get rid of the main window +identified by <TT>xid()</TT>. If you override this, you must also +override the destructor as shown: +<UL> +<PRE> void MyWindow::hide() { if (mypixmap) { XFreePixmap(fl_display,mypixmap); @@ -273,179 +218,146 @@ void MyWindow::hide() { } Fl_Window::hide(); // you must call this } -</pre></ul> - -<h4>virtual void Fl_Window::~Fl_Window()</h4> - -Because of the way C++ works, if you override <tt>hide()</tt> you <i>must</i> -override the destructor as well (otherwise only the base class <tt>hide()</tt> -is called): - -<ul><pre> +</PRE> +</UL> +<H4>virtual void Fl_Window::~Fl_Window()</H4> + Because of the way C++ works, if you override <TT>hide()</TT> you <I> +must</I> override the destructor as well (otherwise only the base class <TT> +hide()</TT> is called): +<UL> +<PRE> MyWindow::~MyWindow() { hide(); } -</pre></ul> - -<h3>Setting the Icon of a Window</h3> - -FLTK currently supports setting a window's icon *before* it is shown using -the <tt>Fl_Window::icon()</tt> method. - -<h4>void Fl_Window::icon(char *)</h4> - -Sets the icon for the window to the passed pointer. You will need to -cast the icon <tt>Pixmap</tt> to a <tt>char *</tt> when calling this -method. To set the icon using a bitmap compiled with your application -use: - -<ul><pre> -#include "icon.xbm" +</PRE> +</UL> +<H3>Setting the Icon of a Window</H3> + FLTK currently supports setting a window's icon *before* it is shown +using the <TT>Fl_Window::icon()</TT> method. +<H4>void Fl_Window::icon(char *)</H4> + Sets the icon for the window to the passed pointer. You will need to +cast the icon <TT>Pixmap</TT> to a <TT>char *</TT> when calling this +method. To set the icon using a bitmap compiled with your application +use: +<UL> +<PRE> +#include "icon.xbm" Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), icon_bits, icon_width, icon_height); -window->icon((char *)p); -</ul></pre> - -<h2>WIN32-Specific Interface</h2> - -<ul><pre> -#include <FL/x.H> -</pre></ul> - -The <tt><FL/x.H></tt> header file defines the interface to FLTK's -WIN32-specific functions. Be warned that some of the structures -and calls in it are subject to change in future version of FLTK. Try -to avoid doing this so your code is portable. - -<h3>Handling Other WIN32 Messages</h3> - -By default a single WNDCLASSEX called "FLTK" is created. All -<tt>Fl_Windows</tt> are of this class unless you use -<tt>Fl_Window::xclass()</tt>. The window class is created the first -time <tt>Fl_Window::show()</tt> is called. - -<p>You can probably combine FLTK with other libraries that make their -own WIN32 window classes. The easiest way is to call <tt>Fl::wait()</tt>, it -will call <tt>DispatchMessage</tt> for all messages to the other windows. If -necessary you can let the other library take over (as long as it calls -<tt>DispatchMessage()</tt>), but you will have to arrange for the function -<tt>Fl::flush()</tt> to be called regularily so that widgets are updated, -timeouts are handled, and the idle functions are called. - -<h4><a name="fl_msg">extern MSG fl_msg</a></h4> - -The most recent message read by <tt>GetMessage</tt> (which is called by -<a href="#wait"><tt>Fl::wait()</tt></a>. This may not be the most -recent message sent to an FLTK window, because silly WIN32 calls the -handle procedures directly for some events (sigh). - -<h4><a name="WIN32.add_handler">void Fl::add_handler(int (*f)(int))</a></h4> - -Install a function to parse unrecognized messages sent to FLTK -windows. If FLTK cannot figure out what to do with a message, it -calls each of these functions (most recent first) until one of them -returns non-zero. The argument passed to the fuctions is zero. If -all the handlers return zero then FLTK calls <tt>DefWindowProc()</tt>. - -<h4><a name="WIN32.fl_xid">HWND fl_xid(const Fl_Window *)</a></h4> - -Returns the window handle for a <tt>Fl_Window</tt>, or zero if not -<tt>shown()</tt>. - -<h4><a name="WIN32.fl_find">Fl_Window *fl_find(HWND xid)</a></h4> - -Return the <tt>Fl_Window</tt> that corresponds to the given window -handle, or <tt>NULL</tt> if not found. This uses a cache so it is -slightly faster than iterating through the windows yourself. - -<h3>Drawing Things Using the WIN32 GDI</h3> - -When the virtual function <tt>Fl_Widget::draw()</tt> is called, FLTK has -stashed in some global variables all the silly extra arguments you -need to make a proper GDI call. These are: - -<ul><pre> +window->icon((char *)p); +</PRE> +</UL> +<H2>WIN32-Specific Interface</H2> +<UL> +<PRE> +#include <FL/x.H> +</PRE> +</UL> + The <TT><FL/x.H></TT> header file defines the interface to FLTK's +WIN32-specific functions. Be warned that some of the structures and +calls in it are subject to change in future version of FLTK. Try to +avoid doing this so your code is portable. +<H3>Handling Other WIN32 Messages</H3> + By default a single WNDCLASSEX called "FLTK" is created. All <TT> +Fl_Windows</TT> are of this class unless you use <TT>Fl_Window::xclass()</TT> +. The window class is created the first time <TT>Fl_Window::show()</TT> + is called. +<P>You can probably combine FLTK with other libraries that make their +own WIN32 window classes. The easiest way is to call <TT>Fl::wait()</TT> +, it will call <TT>DispatchMessage</TT> for all messages to the other +windows. If necessary you can let the other library take over (as long +as it calls <TT>DispatchMessage()</TT>), but you will have to arrange +for the function <TT>Fl::flush()</TT> to be called regularily so that +widgets are updated, timeouts are handled, and the idle functions are +called. </P> +<H4><A name=fl_msg>extern MSG fl_msg</A></H4> + The most recent message read by <TT>GetMessage</TT> (which is called +by <A href=functions.html#wait><TT>Fl::wait()</TT></A>. This may not +be the most recent message sent to an FLTK window, because silly WIN32 +calls the handle procedures directly for some events (sigh). +<H4><A name=WIN32.add_handler>void Fl::add_handler(int (*f)(int))</A></H4> + Install a function to parse unrecognized messages sent to FLTK +windows. If FLTK cannot figure out what to do with a message, it calls +each of these functions (most recent first) until one of them returns +non-zero. The argument passed to the fuctions is zero. If all the +handlers return zero then FLTK calls <TT>DefWindowProc()</TT>. +<H4><A name=WIN32.fl_xid>HWND fl_xid(const Fl_Window *)</A></H4> + Returns the window handle for a <TT>Fl_Window</TT>, or zero if not <TT> +shown()</TT>. +<H4><A name=WIN32.fl_find>Fl_Window *fl_find(HWND xid)</A></H4> + Return the <TT>Fl_Window</TT> that corresponds to the given window +handle, or <TT>NULL</TT> if not found. This uses a cache so it is +slightly faster than iterating through the windows yourself. +<H3>Drawing Things Using the WIN32 GDI</H3> + When the virtual function <TT>Fl_Widget::draw()</TT> is called, FLTK +has stashed in some global variables all the silly extra arguments you +need to make a proper GDI call. These are: +<UL> +<PRE> extern HINSTANCE fl_display; extern HWND fl_window; extern HDC fl_gc; COLORREF fl_RGB(); HPEN fl_pen(); HBRUSH fl_brush(); -</pre></ul> - -These global variables are set before <tt>draw()</tt> is called, or by <a -href="#Fl_Window.make_current"><tt>Fl_Window::make_current()</tt></a>. You can -refer to them when needed to produce GDI calls. Don't attempt to -change them. The functions return GDI objects for the current color -set by <tt>fl_color()</tt> and are created as needed and cached. A typical -GDI drawing call is written like this: - -<ul><pre> +</PRE> +</UL> + These global variables are set before <TT>draw()</TT> is called, or by <A +href=Fl_Window.html#Fl_Window.make_current><TT>Fl_Window::make_current()</TT> +</A>. You can refer to them when needed to produce GDI calls. Don't +attempt to change them. The functions return GDI objects for the +current color set by <TT>fl_color()</TT> and are created as needed and +cached. A typical GDI drawing call is written like this: +<UL> +<PRE> DrawSomething(fl_gc, ..., fl_brush()); -</pre></ul> - -It may also be useful to refer to <a -href="#Fl_Window.make_current"><tt>Fl_Window::current()</tt></a> to get -the window's size or position. - -<h3>Setting the Icon of a Window</h3> - -FLTK currently supports setting a window's icon *before* it is shown using -the <tt>Fl_Window::icon()</tt> method. - -<h4>void Fl_Window::icon(char *)</h4> - -Sets the icon for the window to the passed pointer. You will need to -cast the <tt>HICON</tt> handle to a <tt>char *</tt> when calling this -method. To set the icon using an icon resource compiled with your -application use: - -<ul><pre> -window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON))); -</ul></pre> - -<h3>How to Not Get a MSDOS Console Window</h3> - -WIN32 has a really stupid mode switch stored in the executables that -controls whether or not to make a console window. - -<p>To always get a console window you simply create a console -application (the "/SUBSYSTEM:CONSOLE" option for the linker). For a -GUI-only application create a WIN32 application (the -"/SUBSYSTEM:WINDOWS" option for the linker). - -<p>FLTK includes a <tt>WinMain()</tt> function that calls the ANSI -standard <tt>main()</tt> entry point for you. <i>This function creates -a console window when you use the debug version of the library.</i> - -<p>WIN32 applications without a console cannot write to <tt>stdout</tt> or -<tt>stderr</tt>, even if they are run from a console window. Any output -is silently thrown away. - -<h3>Known Bugs</h3> - -If a program is deactivated, <tt>Fl::wait()</tt> does not return until -it is activated again, even though many events are delivered to the -program. This can cause idle background processes to stop -unexpectedly. This also happens while the user is dragging or resizing -windows or otherwise holding the mouse down. I was forced to remove -most of the efficiency FLTK uses for redrawing in order to get windows -to update while being moved. This is a design error in WIN32 and -probably impossible to get around. - -<p><tt>Fl_Gl_Window::can_do_overlay()</tt> returns true until the first -time it attempts to draw an overlay, and then correctly returns whether -or not there is overlay hardware. - -<p>Cut text contains ^J rather than ^M^J to break lines. This is a -feature, not a bug. - -<p><tt>SetCapture</tt> (used by <tt>Fl::grab()</tt>) doesn't work, and -the main window title bar turns gray while menus are popped up. - -<p>FLUID does not support BMP files yet. - -</BODY> -</HTML> +</PRE> +</UL> + It may also be useful to refer to <A href=Fl_Window.html#Fl_Window.make_current> +<TT>Fl_Window::current()</TT></A> to get the window's size or position. +<H3>Setting the Icon of a Window</H3> + FLTK currently supports setting a window's icon *before* it is shown +using the <TT>Fl_Window::icon()</TT> method. +<H4>void Fl_Window::icon(char *)</H4> + Sets the icon for the window to the passed pointer. You will need to +cast the <TT>HICON</TT> handle to a <TT>char *</TT> when calling this +method. To set the icon using an icon resource compiled with your +application use: +<UL> +<PRE> +window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON))); +</PRE> +</UL> +<H3>How to Not Get a MSDOS Console Window</H3> + WIN32 has a really stupid mode switch stored in the executables that +controls whether or not to make a console window. +<P>To always get a console window you simply create a console +application (the "/SUBSYSTEM:CONSOLE" option for the linker). For a +GUI-only application create a WIN32 application (the +"/SUBSYSTEM:WINDOWS" option for the linker). </P> +<P>FLTK includes a <TT>WinMain()</TT> function that calls the ANSI +standard <TT>main()</TT> entry point for you. <I>This function creates +a console window when you use the debug version of the library.</I></P> +<P>WIN32 applications without a console cannot write to <TT>stdout</TT> + or <TT>stderr</TT>, even if they are run from a console window. Any +output is silently thrown away. </P> +<H3>Known Bugs</H3> + If a program is deactivated, <TT>Fl::wait()</TT> does not return until +it is activated again, even though many events are delivered to the +program. This can cause idle background processes to stop unexpectedly. + This also happens while the user is dragging or resizing windows or +otherwise holding the mouse down. I was forced to remove most of the +efficiency FLTK uses for redrawing in order to get windows to update +while being moved. This is a design error in WIN32 and probably +impossible to get around. +<P><TT>Fl_Gl_Window::can_do_overlay()</TT> returns true until the first +time it attempts to draw an overlay, and then correctly returns whether +or not there is overlay hardware. </P> +<P>Cut text contains ^J rather than ^M^J to break lines. This is a +feature, not a bug. </P> +<P><TT>SetCapture</TT> (used by <TT>Fl::grab()</TT>) doesn't work, and +the main window title bar turns gray while menus are popped up. </P> +<P>FLUID does not support BMP files yet. </P> +</BODY></HTML>
\ No newline at end of file diff --git a/documentation/preface.html b/documentation/preface.html index 11df6181d..63781160d 100644 --- a/documentation/preface.html +++ b/documentation/preface.html @@ -1,78 +1,62 @@ <HTML> -<HEAD> - <META NAME="Author" CONTENT="Michael Sweet"> - <META NAME="Copyright" CONTENT="Copyright 1998-1999 by Bill Spitzak and Others."> - <META NAME="DocNumber" CONTENT="Revision 0"> - <TITLE>FLTK 1.0 Programming Manual</TITLE> +<HEAD><META CONTENT="Michael Sweet" NAME=Author><META CONTENT="Copyright 1998-1999 by Bill Spitzak and Others." +NAME=Copyright><META CONTENT="Revision 1" NAME=DocNumber> +<TITLE>FLTK 1.0 Programming Manual</TITLE> </HEAD> <BODY> - <H1 ALIGN=RIGHT><A NAME=preface>Preface</A></H1> - -This manual describes the Fast Light Tool Kit ("FLTK") version 1.0, a C++ Graphical User Interface ("GUI") toolkit for UNIX and Microsoft Windows. Each of the chapters -in this manual is designed as a tutorial for using FLTK, while the appendices provide -a convenient reference for all FLTK widgets, functions, and operating system -interfaces. - + This manual describes the Fast Light Tool Kit ("FLTK") version 1.0, a +C++ Graphical User Interface ("GUI") toolkit for UNIX and Microsoft +Windows. Each of the chapters in this manual is designed as a tutorial +for using FLTK, while the appendices provide a convenient reference for +all FLTK widgets, functions, and operating system interfaces. <H2>Organization</H2> - -This manual is organized into the following chapters and appendices: - + This manual is organized into the following chapters and appendices: <UL> - <LI><A HREF="#intro">Chapter 1 - Introduction to FLTK</A> - <LI><A HREF="#basics">Chapter 2 - FLTK Basics</A> - <LI><A HREF="#common">Chapter 3 - Common Widgets and Attributes</A> - <LI><A HREF="#editor">Chapter 4 - Designing a Simple Text Editor</A> - <LI><A HREF="#drawing">Chapter 5 - Drawing Things in FLTK</A> - <LI><A HREF="#events">Chapter 6 - Handling Events</A> - <LI><A HREF="#subclassing">Chapter 7 - Extending and Adding Widgets</A> - <LI><A HREF="#fluid">Chapter 8 - Programming With FLUID</A> - <LI><A HREF="#opengl">Chapter 9 - Using OpenGL</A> - <LI><A HREF="#widgets">Appendix A - Widget Reference</A> - <LI><A HREF="#functions">Appendix B - Function Reference</A> - <LI><A HREF="#enumerations">Appendix C - Enumeration Reference</A> - <LI><A HREF="#glut">Appendix D - GLUT Compatibility</A> - <LI><A HREF="#forms">Appendix E - Forms Compatibility</A> - <LI><A HREF="#license">Appendix F - Operating System Issues</A> - <LI><A HREF="#license">Appendix G - Software License</A> +<LI><A HREF=intro.html#intro>Chapter 1 - Introduction to FLTK</A></LI> +<LI><A HREF=basics.html#basics>Chapter 2 - FLTK Basics</A></LI> +<LI><A HREF=common.html#common>Chapter 3 - Common Widgets and Attributes</A> +</LI> +<LI><A HREF=editor.html#editor>Chapter 4 - Designing a Simple Text +Editor</A></LI> +<LI><A HREF=drawing.html#drawing>Chapter 5 - Drawing Things in FLTK</A></LI> +<LI><A HREF=events.html#events>Chapter 6 - Handling Events</A></LI> +<LI><A HREF=subclassing.html#subclassing>Chapter 7 - Extending and +Adding Widgets</A></LI> +<LI><A HREF=fluid.html#fluid>Chapter 8 - Programming With FLUID</A></LI> +<LI><A HREF=opengl.html#opengl>Chapter 9 - Using OpenGL</A></LI> +<LI><A HREF=widgets.html#widgets>Appendix A - Widget Reference</A></LI> +<LI><A HREF=functions.html#functions>Appendix B - Function Reference</A></LI> +<LI><A HREF=enumerations.html#enumerations>Appendix C - Enumeration +Reference</A></LI> +<LI><A HREF=glut.html#glut>Appendix D - GLUT Compatibility</A></LI> +<LI><A HREF=forms.html#forms>Appendix E - Forms Compatibility</A></LI> +<LI><A HREF=license.html#license>Appendix F - Operating System Issues</A> +</LI> +<LI><A HREF=license.html#license>Appendix G - Software License</A></LI> </UL> - <H2>Conventions</H2> - -The following typeface conventions are used in this manual: - + The following typeface conventions are used in this manual: <UL> - - <LI>Function and constant names are shown in <B><TT>bold courier type</TT></B> - - <LI>Code samples and commands are shown in <TT>regular courier type</TT> - +<LI>Function and constant names are shown in <B><TT>bold courier type</TT> +</B></LI> +<LI>Code samples and commands are shown in <TT>regular courier type</TT></LI> </UL> - <H2>Abbreviations</H2> - -The following abbreviations are used in this manual: - + The following abbreviations are used in this manual: <DL> - <DT>X11</DT> - <DD>The X Window System version 11.</DD> - - <DT>Xlib</DT> - <DD>The X Window System interface library.</DD> - - <DT>WIN32</DT> - <DD>The Microsoft Windows 32-bit Application Programmer's Interface.</DD> +<DT>X11</DT> +<DD>The X Window System version 11.</DD> +<DT>Xlib</DT> +<DD>The X Window System interface library.</DD> +<DT>WIN32</DT> +<DD>The Microsoft Windows 32-bit Application Programmer's Interface.</DD> </DL> - <H2>Copyrights and Trademarks</H2> - -FLTK is Copyright 1998-1999 by Bill Spitzak and others. Use and distribution of FLTK is -governed by the GNU Library General Public License, located in -<A HREF=#license>Appendix D</A>. - -<P>UNIX is a registered trademark of the X Open Group, Inc. Microsoft and Windows are -registered trademarks of Microsoft Corporation. OpenGL is a registered trademark -of Silicon Graphics, Inc. - -</BODY> -</HTML> + FLTK is Copyright 1998-1999 by Bill Spitzak and others. Use and +distribution of FLTK is governed by the GNU Library General Public +License, located in <A HREF=license.html#license>Appendix D</A>. +<P>UNIX is a registered trademark of the X Open Group, Inc. Microsoft +and Windows are registered trademarks of Microsoft Corporation. OpenGL +is a registered trademark of Silicon Graphics, Inc. </P> +</BODY></HTML> diff --git a/documentation/subclassing.html b/documentation/subclassing.html index 7ed03ed7a..d15f691e2 100644 --- a/documentation/subclassing.html +++ b/documentation/subclassing.html @@ -1,63 +1,51 @@ -<HTML> -<BODY> - -<H1 ALIGN=RIGHT><A NAME="subclassing">7 - Adding and Extending Widgets</A></H1> - -This chapter describes how to add your own widgets or extend existing -widgets in FLTK. - +<HTML><BODY> +<H1 ALIGN=RIGHT><A NAME=subclassing>7 - Adding and Extending Widgets</A></H1> + This chapter describes how to add your own widgets or extend existing +widgets in FLTK. <H2>Subclassing</H2> - -New widgets are created by <i>subclassing</i> an existing FLTK widget, -typically <tt>Fl_Widget</tt> for controls and <tt>Fl_Group</tt> for -containers. - -<p>A control widget typically interacts with the user to receive and/or -display a value of some sort. - -<p>A container widget holds a list of child widgets and handles moving, -sizing, showing, or hiding them as needed. <tt>Fl_Group</tt> is the -main container widget class in FLTK, and all of the other containers -(<tt>Fl_Pack</tt>, <tt>Fl_Scroll</tt>, <tt>Fl_Tabs</tt>, <tt>Fl_Tile</tt>, -and <tt>Fl_Window</tt>) are subclasses of it. - -<p>You can also subclass other existing widgets to provide a different look -or user-interface. For example, the button widgets are all subclasses of -<tt>Fl_Button</tt> since they all interact with the user via a mouse button -click. The only difference is the code that draws the face of the button. - + New widgets are created by <I>subclassing</I> an existing FLTK widget, +typically <TT>Fl_Widget</TT> for controls and <TT>Fl_Group</TT> for +containers. +<P>A control widget typically interacts with the user to receive and/or +display a value of some sort. </P> +<P>A container widget holds a list of child widgets and handles moving, +sizing, showing, or hiding them as needed. <TT>Fl_Group</TT> is the +main container widget class in FLTK, and all of the other containers (<TT> +Fl_Pack</TT>, <TT>Fl_Scroll</TT>, <TT>Fl_Tabs</TT>, <TT>Fl_Tile</TT>, +and <TT>Fl_Window</TT>) are subclasses of it. </P> +<P>You can also subclass other existing widgets to provide a different +look or user-interface. For example, the button widgets are all +subclasses of <TT>Fl_Button</TT> since they all interact with the user +via a mouse button click. The only difference is the code that draws +the face of the button. </P> <H2>Making a Subclass of Fl_Widget</H2> - -Your subclasses can directly descend from <tt>Fl_Widget</tt> or any -subclass of <tt>Fl_Widget</tt>. <tt>Fl_Widget</tt> has only four -virtual methods, and overriding some or all of these may be necessary. - + Your subclasses can directly descend from <TT>Fl_Widget</TT> or any +subclass of <TT>Fl_Widget</TT>. <TT>Fl_Widget</TT> has only four +virtual methods, and overriding some or all of these may be necessary. <H2>The Constructor</H2> - -The constructor should access the following arguments: - -<ul><pre> + The constructor should access the following arguments: +<UL> +<PRE> MyClass(int x, int y, int w, int h, const char *label = 0); -</pre></ul> - -This will allow the class to be used in <a href="#fluid">Fluid</a> without -problems. - -<p>The constructor must call the constructor for the base class and -pass the same arguments: - -<ul><pre> +</PRE> +</UL> + This will allow the class to be used in <A href=fluid.html#fluid>Fluid</A> + without problems. +<P>The constructor must call the constructor for the base class and +pass the same arguments: </P> +<UL> +<PRE> MyClass::MyClass(int x, int y, int w, int h, const char *label) : Fl_Widget(x, y, w, h, label) { // do initialization stuff... } -</pre></ul> - -<tt>Fl_Widget</tt>'s protected constructor sets <tt>x()</tt>, -<tt>y()</tt>, <tt>w()</tt>, <tt>h()</tt>, and <tt>label()</tt> to the -passed values and initializes the other instance variables to: - -<ul><pre> +</PRE> +</UL> +<TT>Fl_Widget</TT>'s protected constructor sets <TT>x()</TT>, <TT>y()</TT> +, <TT>w()</TT>, <TT>h()</TT>, and <TT>label()</TT> to the passed values +and initializes the other instance variables to: +<UL> +<PRE> type(0); box(FL_NO_BOX); color(FL_GRAY); @@ -69,151 +57,118 @@ labelcolor(FL_BLACK); align(FL_ALIGN_CENTER); callback(default_callback,0); flags(ACTIVE|VISIBLE); -</pre></ul> - +</PRE> +</UL> <H2>Protected Methods of Fl_Widget</H2> - -The following methods are provided for subclasses to use: - -<ul> - <li><a name="#clear_visible">clear_visible</a> - <li><a name="#damage">damage</a> - <li><a name="#draw_box">draw_box</a> - <li><a name="#draw_label">draw_label</a> - <li><a name="#set_flag">set_flag</a> - <li><a name="#set_visible">set_visible</a> - <li><a name="#test_shortcut">test_shortcut</a> - <li><a name="#type">type</a> -</ul> - -<H3><a name="damage">void Fl_Widget::damage(uchar mask)<br> -void Fl_Widget::damage(uchar mask, int x, int y, int w, int h)<br> -uchar Fl_Widget::damage()</a></H3> - -The first form indicates that a partial update of the object is -needed. The bits in mask are OR'd into <tt>damage()</tt>. Your -<tt>draw()</tt> routine can examine these bits to limit what it is -drawing. The public method <tt>Fl_Widget::redraw()</tt> simply does -<tt>Fl_Widget::damage(FL_DAMAGE_ALL)</tt>. - -<p>The second form indicates that a region is damaged. If only these -calls are done in a window (no calls to <tt>damage(n)</tt>) then FLTK + The following methods are provided for subclasses to use: +<UL> +<LI><A name=#clear_visible>clear_visible</A></LI> +<LI><A name=#damage>damage</A></LI> +<LI><A name=#draw_box>draw_box</A></LI> +<LI><A name=#draw_label>draw_label</A></LI> +<LI><A name=#set_flag>set_flag</A></LI> +<LI><A name=#set_visible>set_visible</A></LI> +<LI><A name=#test_shortcut>test_shortcut</A></LI> +<LI><A name=#type>type</A></LI> +</UL> +<H3><A name=damage>void Fl_Widget::damage(uchar mask) +<BR> void Fl_Widget::damage(uchar mask, int x, int y, int w, int h) +<BR> uchar Fl_Widget::damage()</A></H3> + The first form indicates that a partial update of the object is +needed. The bits in mask are OR'd into <TT>damage()</TT>. Your <TT> +draw()</TT> routine can examine these bits to limit what it is drawing. + The public method <TT>Fl_Widget::redraw()</TT> simply does <TT> +Fl_Widget::damage(FL_DAMAGE_ALL)</TT>. +<P>The second form indicates that a region is damaged. If only these +calls are done in a window (no calls to <TT>damage(n)</TT>) then FLTK will clip to the union of all these calls before drawing anything. -This can greatly speed up incremental displays. The mask bits are or'd -into <tt>damage()</tt> unless this is a <tt>Fl_Window</tt> widget. - -<p>The third form returns the bitwise-OR of all <tt>damage(n)</tt> -calls done since the last <tt>draw()</tt>. The public method -<tt>redraw()</tt> does <tt>damage(FL_DAMAGE_ALL)</tt>, but the -implementation of your widget can call the private <tt>damage(n)</tt>. - -<H3><a name="draw_box">void Fl_Widget::draw_box() const<br> -</a>void Fl_Widget::draw_box(Fl_Boxtype b, ulong c) const</H3> - -The first form draws this widget's <tt>box()</tt>, using the dimensions -of the widget. - -The second form uses <tt>b</tt> as the box type and <tt>c</tt> as the -color for the box. - -<H3><a name="draw_label">void Fl_Widget::draw_label() const<br> -void Fl_Widget::draw_label(int x, int y, int w, int h) const<br> -void Fl_Widget::draw_label(int x, int y, int w, int h, Fl_Align align) const</a></H3> - -This is the usual function for a <tt>draw()</tt> method to call to draw -the widget's label. It does not draw the label if it is supposed to be -outside the box (on the assumption that the enclosing group will draw -those labels). - -<p>The second form uses the passed bounding box instead of the widget's -bounding box. This is useful so "centered" labels are aligned with some -feature, such as a moving slider. - -<p>The third form draws the label anywhere. It acts as though -<tt>FL_ALIGN_INSIDE</tt> has been forced on, the label will appear -inside the passed bounding box. This is designed for parent groups to -draw labels with. - -<H3><a name="set_flag">void Fl_Widget::set_flag(SHORTCUT_LABEL)</a></H3> - -If your constructor calls this it modifies <tt>draw_label()</tt> so -that '&' characters cause an underscore to be printed under the next -letter. - -<H3><a name="set_visible">void Fl_Widget::set_visible()</a><br> -<a name="clear_visible">void Fl_Widget::clear_visible()</a></H3> - -Fast inline versions of <tt>Fl_Widget::hide()</tt> and -<tt>Fl_Widget::show()</tt>. These do not send the <tt>FL_HIDE</tt> and -<tt>FL_SHOW</tt> events to the widget. - -<H3><a name="test_shortcut">int Fl_Widget::test_shortcut() const<br> -static int Fl_Widget::test_shortcut(const char *s)</a></H3> - -The first version tests <tt>Fl_Widget::label()</tt> against the current -event (which should be a <tt>FL_SHORTCUT</tt> event). If the label -contains a '&' character and the character after it matches the key -press, this returns true. This returns false if the -<tt>SHORTCUT_LABEL</tt> flag is off, if the label is <tt>NULL</tt> or -does not have a '&' character in it, or if the keypress does not match -the character. - -<p>The second version lets you do this test against an arbitrary string. - -<H3><a name="type">uchar Fl_Widget::type() const<br> -void Fl_Widget::type(uchar t)</a></H3> - -The property <tt>Fl_Widget::type()</tt> can return an arbitrary 8-bit -identifier, and can be set with the protected method <tt>type(uchar t)</tt>. -This value had to be provided for Forms compatibility, but you can use -it for any purpose you want. Try to keep the value less than 100 to -not interfere with reserved values. - -<p>FLTK does not use RTTI (Run Time Typing Infomation), to enhance -portability. But this may change in the near future if RTTI becomes -standard everywhere. - -<p>If you don't have RTTI you can use the clumsy FLTK mechanisim, by -having <tt>type()</tt> have a unique value. These unique values must -be greater than the symbol <tt>FL_RESERVED_TYPE</tt> (which is 100). -Look through the header files for <tt>FL_RESERVED_TYPE</tt> to find an -unused number. If you make a subclass of <tt>Fl_Group</tt> you must -use <tt>FL_GROUP + n</tt>, and if you make a subclass of -<tt>Fl_Window<tt> you must use <tt>FL_WINDOW + n</tt> (in both cases -<tt>n is in the range 1 to 7). - + This can greatly speed up incremental displays. The mask bits are +or'd into <TT>damage()</TT> unless this is a <TT>Fl_Window</TT> widget. </P> +<P>The third form returns the bitwise-OR of all <TT>damage(n)</TT> + calls done since the last <TT>draw()</TT>. The public method <TT> +redraw()</TT> does <TT>damage(FL_DAMAGE_ALL)</TT>, but the +implementation of your widget can call the private <TT>damage(n)</TT>. </P> +<H3><A name=draw_box>void Fl_Widget::draw_box() const +<BR></A>void Fl_Widget::draw_box(Fl_Boxtype b, ulong c) const</H3> + The first form draws this widget's <TT>box()</TT>, using the +dimensions of the widget. The second form uses <TT>b</TT> as the box +type and <TT>c</TT> as the color for the box. +<H3><A name=draw_label>void Fl_Widget::draw_label() const +<BR> void Fl_Widget::draw_label(int x, int y, int w, int h) const +<BR> void Fl_Widget::draw_label(int x, int y, int w, int h, Fl_Align +align) const</A></H3> + This is the usual function for a <TT>draw()</TT> method to call to +draw the widget's label. It does not draw the label if it is supposed +to be outside the box (on the assumption that the enclosing group will +draw those labels). +<P>The second form uses the passed bounding box instead of the widget's +bounding box. This is useful so "centered" labels are aligned with some +feature, such as a moving slider. </P> +<P>The third form draws the label anywhere. It acts as though <TT> +FL_ALIGN_INSIDE</TT> has been forced on, the label will appear inside +the passed bounding box. This is designed for parent groups to draw +labels with. </P> +<H3><A name=set_flag>void Fl_Widget::set_flag(SHORTCUT_LABEL)</A></H3> + If your constructor calls this it modifies <TT>draw_label()</TT> so +that ''characters cause an underscore to be printed under the next +letter. +<H3><A name=set_visible>void Fl_Widget::set_visible()</A> +<BR><A name=clear_visible>void Fl_Widget::clear_visible()</A></H3> + Fast inline versions of <TT>Fl_Widget::hide()</TT> and <TT> +Fl_Widget::show()</TT>. These do not send the <TT>FL_HIDE</TT> and <TT> +FL_SHOW</TT> events to the widget. +<H3><A name=test_shortcut>int Fl_Widget::test_shortcut() const +<BR> static int Fl_Widget::test_shortcut(const char *s)</A></H3> + The first version tests <TT>Fl_Widget::label()</TT> against the +current event (which should be a <TT>FL_SHORTCUT</TT> event). If the +label contains a ''character and the character after it matches the key +press, this returns true. This returns false if the <TT>SHORTCUT_LABEL</TT> + flag is off, if the label is <TT>NULL</TT> or does not have a +''character in it, or if the keypress does not match the character. +<P>The second version lets you do this test against an arbitrary +string. </P> +<H3><A name=type>uchar Fl_Widget::type() const +<BR> void Fl_Widget::type(uchar t)</A></H3> + The property <TT>Fl_Widget::type()</TT> can return an arbitrary 8-bit +identifier, and can be set with the protected method <TT>type(uchar t)</TT> +. This value had to be provided for Forms compatibility, but you can +use it for any purpose you want. Try to keep the value less than 100 +to not interfere with reserved values. +<P>FLTK does not use RTTI (Run Time Typing Infomation), to enhance +portability. But this may change in the near future if RTTI becomes +standard everywhere. </P> +<P>If you don't have RTTI you can use the clumsy FLTK mechanisim, by +having <TT>type()</TT> have a unique value. These unique values must +be greater than the symbol <TT>FL_RESERVED_TYPE</TT> (which is 100). + Look through the header files for <TT>FL_RESERVED_TYPE</TT> to find an +unused number. If you make a subclass of <TT>Fl_Group</TT> you must +use <TT>FL_GROUP + n</TT>, and if you make a subclass of <TT>Fl_Window<TT> +you must use <TT>FL_WINDOW + n</TT> (in both cases <TT>n is in the +range 1 to 7). </TT></TT></TT></P> <H2>Handling Events</H2> - -The virtual method <tt>int Fl_Widget::handle(int event)</tt> is called -to handle each event passed to the widget. It can: - -<ul> - <li>Change the state of the widget. - - <li>Call <a href="#Fl_Widget.redraw"><tt>Fl_Widget::redraw()</tt></a> - if the widget needs to be redisplayed. - - <li>Call <a - href="#Fl_Widget.damage"><tt>Fl_Widget::damage(n)</tt></a> if - the widget needs a partial-update (assumming you provide - support for this in your <tt>Fl_Widget::draw()</tt> method). - - <li>Call <a - href="#Fl_Widget.do_callback"><tt>Fl_Widget::do_callback()</tt></a> - if a callback should be generated. - - <li>Call <tt>Fl_Widget::handle()</tt> on child widgets. -</ul> - -Events are identified by the integer argument. Other information about -the most recent event is stored in static locations and aquired by -calling the <a href="#events"><tt>Fl::event_*()</tt></a> functions. -This information remains valid until another event is handled. - -<p>Here is a sample <tt>handle()</tt> method for a widget that acts as a -pushbutton and also accepts the keystroke 'x' to cause the callback: - -<ul><pre> + The virtual method <TT>int Fl_Widget::handle(int event)</TT> is called +to handle each event passed to the widget. It can: +<UL> +<LI>Change the state of the widget. </LI> +<LI>Call <A href=Fl_Widget.html#Fl_Widget.redraw><TT>Fl_Widget::redraw()</TT> +</A> if the widget needs to be redisplayed. </LI> +<LI>Call <A href=Fl_Widget.html#Fl_Widget.damage><TT> +Fl_Widget::damage(n)</TT></A> if the widget needs a partial-update +(assumming you provide support for this in your <TT>Fl_Widget::draw()</TT> + method). </LI> +<LI>Call <A href=Fl_Widget.html#Fl_Widget.do_callback><TT> +Fl_Widget::do_callback()</TT></A> if a callback should be generated. </LI> +<LI>Call <TT>Fl_Widget::handle()</TT> on child widgets. </LI> +</UL> + Events are identified by the integer argument. Other information +about the most recent event is stored in static locations and aquired +by calling the <A href=events.html#events><TT>Fl::event_*()</TT></A> + functions. This information remains valid until another event is +handled. +<P>Here is a sample <TT>handle()</TT> method for a widget that acts as +a pushbutton and also accepts the keystroke 'x' to cause the callback: </P> +<UL> +<PRE> int MyClass::handle(int event) { switch(event) { case FL_PUSH: @@ -247,75 +202,63 @@ int MyClass::handle(int event) { return 0; } } -</pre></ul> - -You must return non-zero if your <tt>handle()</tt> method uses the -event. If you return zero it indicates to the parent widget that it can -try sending the event to another widget. - +</PRE> +</UL> + You must return non-zero if your <TT>handle()</TT> method uses the +event. If you return zero it indicates to the parent widget that it can +try sending the event to another widget. <H2>Drawing the Widget</H2> - -The <tt>draw()</tt> virtual method is called when FLTK wants you to -redraw your widget. It will be called if and only if <tt>damage()</tt> -is non-zero, and <tt>damage()</tt> will be cleared to zero after it -returns. <tt>draw()</tt> should be declared protected, so that it can't -be called from non-drawing code. - -<p><tt>damage()</tt> contains the bitwise-OR of all the <tt>damage(n)</tt> calls to this -widget since it was last drawn. This can be used for minimal update, -by only redrawing the parts whose bits are set. FLTK will turn -<i>all</i> the bits on if it thinks the entire widget must be redrawn -(for instance due to an expose event). - -<p>Expose events (and the above <tt>damage(b,x,y,w,h)</tt>) will cause -<tt>draw()</tt> to be called with FLTK's <a -href="#clipping">clipping</a> turned on. You can greatly speed up -redrawing in some cases by testing <tt>fl_clipped</tt> and -<tt>fl_current_clip</tt> and skipping invisible parts. - -<p>Besides the protected methods described above, FLTK provide a large -number of basic drawing functions, which are described <a -href=#drawing>below</a>. - + The <TT>draw()</TT> virtual method is called when FLTK wants you to +redraw your widget. It will be called if and only if <TT>damage()</TT> + is non-zero, and <TT>damage()</TT> will be cleared to zero after it +returns. <TT>draw()</TT> should be declared protected, so that it can't +be called from non-drawing code. +<P><TT>damage()</TT> contains the bitwise-OR of all the <TT>damage(n)</TT> + calls to this widget since it was last drawn. This can be used for +minimal update, by only redrawing the parts whose bits are set. FLTK +will turn <I>all</I> the bits on if it thinks the entire widget must be +redrawn (for instance due to an expose event). </P> +<P>Expose events (and the above <TT>damage(b,x,y,w,h)</TT>) will cause <TT> +draw()</TT> to be called with FLTK's <A href=drawing.html#clipping> +clipping</A> turned on. You can greatly speed up redrawing in some +cases by testing <TT>fl_clipped</TT> and <TT>fl_current_clip</TT> and +skipping invisible parts. </P> +<P>Besides the protected methods described above, FLTK provide a large +number of basic drawing functions, which are described <A href=drawing.html#drawing> +below</A>. </P> <H2>Resizing the Widget</H2> - -The <tt>resize(int x, int y, int w, int h)</tt> method is called when -the widget is being resized or moved. The arguments are the new -position, width, and height. <tt>x()</tt>, <tt>y()</tt>, <tt>w()</tt>, -and <tt>h()</tt> still remain the old size. You must call -<tt>resize()</tt> on your base class with the same arguments to get the -widget size to actually change. - -<p>This should <i>not</i> call <tt>redraw()</tt>, at least if only the -<tt>x()</tt> and <tt>y()</tt> change. This is because group objects -like <a href="#Fl_Scroll"><tt>Fl_Scroll</tt></a> may have a more -efficient way of drawing the new position. - + The <TT>resize(int x, int y, int w, int h)</TT> method is called when +the widget is being resized or moved. The arguments are the new +position, width, and height. <TT>x()</TT>, <TT>y()</TT>, <TT>w()</TT>, +and <TT>h()</TT> still remain the old size. You must call <TT>resize()</TT> + on your base class with the same arguments to get the widget size to +actually change. +<P>This should <I>not</I> call <TT>redraw()</TT>, at least if only the <TT> +x()</TT> and <TT>y()</TT> change. This is because group objects like <A href=Fl_Scroll.html#Fl_Scroll> +<TT>Fl_Scroll</TT></A> may have a more efficient way of drawing the new +position. </P> <H2>Making a Composite/Group Widget</H2> - -A "composite" widget contains one or more "child" widgets. To do this -you should subclass <a href="#Fl_Group"><tt>Fl_Group</tt></a>. It is -possible to make a composite object that is not a subclass of -<tt>Fl_Group</tt>, but you'll have to duplicate the code in <tt>Fl_Group</tt> -anyways. - -<p>Instances of the child widgets may be included in the parent: - -<ul><pre> + A "composite" widget contains one or more "child" widgets. To do this +you should subclass <A href=Fl_Group.html#Fl_Group><TT>Fl_Group</TT></A> +. It is possible to make a composite object that is not a subclass of <TT> +Fl_Group</TT>, but you'll have to duplicate the code in <TT>Fl_Group</TT> + anyways. +<P>Instances of the child widgets may be included in the parent: </P> +<UL> +<PRE> class MyClass : public Fl_Group { Fl_Button the_button; Fl_Slider the_slider; ... }; -</pre></ul> - -The constructor has to initialize these instances. They are -automatically <tt>add()</tt>ed to the group, since the -<tt>Fl_Group</tt> constructor does <tt>begin()</tt>. <i>Don't forget -to call <tt>end()</tt> or use the <a href="#Fl_End"><tt>Fl_End</tt></a> -pseudo-class:</i> - -<ul><pre> +</PRE> +</UL> + The constructor has to initialize these instances. They are +automatically <TT>add()</TT>ed to the group, since the <TT>Fl_Group</TT> + constructor does <TT>begin()</TT>. <I>Don't forget to call <TT>end()</TT> + or use the <A href=Fl_End.html#Fl_End><TT>Fl_End</TT></A> pseudo-class:</I> +<UL> +<PRE> MyClass::MyClass(int x, int y, int w, int h) : Fl_Group(x, y, w, h), the_button(x + 5, y + 5, 100, 20), @@ -324,41 +267,41 @@ MyClass::MyClass(int x, int y, int w, int h) : ...(you could add dynamically created child widgets here)... end(); // don't forget to do this! } -</pre></ul> - -The child widgets need callbacks. These will be called with a pointer -to the children, but the widget itself may be found in the -<tt>parent()</tt> pointer of the child. Usually these callbacks can be -static private methods, with a matching private method: - -<ul><pre> +</PRE> +</UL> + The child widgets need callbacks. These will be called with a pointer +to the children, but the widget itself may be found in the <TT>parent()</TT> + pointer of the child. Usually these callbacks can be static private +methods, with a matching private method: +<UL> +<PRE> void MyClass::slider_cb(Fl_Widget* v, void *) { // static method - ((MyClass*)(v->parent())->slider_cb(); + ((MyClass*)(v->parent())->slider_cb(); } void MyClass::slider_cb() { // normal method - use(the_slider->value()); + use(the_slider->value()); } -</pre></ul> - -If you make the <tt>handle()</tt> method, you can quickly pass all the -events to the children using the <tt>Fl_Group::handle()</tt> method. -Note that you don't need to override <tt>handle()</tt> if your -composite widget does nothing other than pass events to the children: - -<ul><pre> +</PRE> +</UL> + If you make the <TT>handle()</TT> method, you can quickly pass all the +events to the children using the <TT>Fl_Group::handle()</TT> method. +Note that you don't need to override <TT>handle()</TT> if your +composite widget does nothing other than pass events to the children: +<UL> +<PRE> int MyClass::handle(int event) { if (Fl_Group::handle(event)) return 1; ... handle events that children don't want ... } -</pre></ul> - -If you override <tt>draw()</tt> you need to draw all the children. If -<tt>redraw()</tt> or <tt>damage()</tt> is called on a child, -<tt>damage(FL_DAMAGE_CHILD)</tt> is done to the group, so this bit of -<tt>damage()</tt> can be used to indicate that a child needs to be -drawn. It is fastest if you avoid drawing anything else in this case: - -<ul><pre> +</PRE> +</UL> + If you override <TT>draw()</TT> you need to draw all the children. If <TT> +redraw()</TT> or <TT>damage()</TT> is called on a child, <TT> +damage(FL_DAMAGE_CHILD)</TT> is done to the group, so this bit of <TT> +damage()</TT> can be used to indicate that a child needs to be drawn. + It is fastest if you avoid drawing anything else in this case: +<UL> +<PRE> int MyClass::draw() { Fl_Widget *const*a = array(); if (damage() == FL_DAMAGE_CHILD) { // only redraw some children @@ -372,86 +315,62 @@ int MyClass::draw() { } } } -</pre></ul> - -<tt>Fl_Group</tt> provides some protected methods to make drawing easier: - -<ul> - <li><a href="#draw_child">draw_child</a> - <li><a href="#draw_outside_label">draw_outside_label</a> - <li><a href="#update_child">update_child</a> -</ul> - -<H3><a name="draw_child">void Fl_Group::draw_child(Fl_Widget&)</a></H3> - -This will force the child's <tt>damage()</tt> bits all to one and call -<tt>draw()</tt> on it, then clear the <tt>damage()</tt>. You should -call this on all children if a total redraw of your widget is -requested, or if you draw something (like a background box) that -damages the child. Nothing is done if the child is not -<tt>visible()</tt> or if it is clipped. - -<H3><a name="draw_outside_label">void Fl_Group::draw_outside_label(Fl_Widget&) const</a></H3> - -Draw the labels that are <i>not</i> drawn by -<a href="#draw_label"><tt>draw_label()</tt></a>. If you want more control -over the label positions you might want to call -<tt>child->draw_label(x,y,w,h,a)</tt>. - -<H3><a name="update_child">void Fl_Group::update_child(Fl_Widget&)</a></H3> - -Draws the child only if it's <tt>damage()</tt> is non-zero. You should -call this on all the children if your own damage is equal to -FL_DAMAGE_CHILD. Nothing is done if the child is not -<tt>visible()</tt> or if it is clipped. - +</PRE> +</UL> +<TT>Fl_Group</TT> provides some protected methods to make drawing +easier: +<UL> +<LI><A href=#draw_child>draw_child</A></LI> +<LI><A href=#draw_outside_label>draw_outside_label</A></LI> +<LI><A href=#update_child>update_child</A></LI> +</UL> +<H3><A name=draw_child>void Fl_Group::draw_child(Fl_Widget&)</A></H3> + This will force the child's <TT>damage()</TT> bits all to one and call <TT> +draw()</TT> on it, then clear the <TT>damage()</TT>. You should call +this on all children if a total redraw of your widget is requested, or +if you draw something (like a background box) that damages the child. + Nothing is done if the child is not <TT>visible()</TT> or if it is +clipped. +<H3><A name=draw_outside_label>void +Fl_Group::draw_outside_label(Fl_Widget&) const</A></H3> + Draw the labels that are <I>not</I> drawn by <A href=#draw_label><TT> +draw_label()</TT></A>. If you want more control over the label +positions you might want to call <TT>child->draw_label(x,y,w,h,a)</TT>. +<H3><A name=update_child>void Fl_Group::update_child(Fl_Widget&)</A></H3> + Draws the child only if it's <TT>damage()</TT> is non-zero. You +should call this on all the children if your own damage is equal to +FL_DAMAGE_CHILD. Nothing is done if the child is not <TT>visible()</TT> + or if it is clipped. <H2>Cut and Paste Support</H2> - -FLTK provides routines to cut and paste ASCII text (in the future this -may be UTF-8) between applications: - -<ul> - <li><a href="#paste">Fl::paste</a> - <li><a href="#selection">Fl::selection</a> - <li><a href="#selection_length">Fl::selection_length</a> - <li><a href="#selection_owner">Fl::selection_owner</a> -</ul> - - -It may be possible to cut/paste non-ASCII data by using <a -href="#add_handler"><tt>Fl::add_handler()</tt></a>. - + FLTK provides routines to cut and paste ASCII text (in the future this +may be UTF-8) between applications: +<UL> +<LI><A href=functions.html#paste>Fl::paste</A></LI> +<LI><A href=functions.html#selection>Fl::selection</A></LI> +<LI><A href=#selection_length>Fl::selection_length</A></LI> +<LI><A href=functions.html#selection_owner>Fl::selection_owner</A></LI> +</UL> + It may be possible to cut/paste non-ASCII data by using <A href=osissues.html#add_handler> +<TT>Fl::add_handler()</TT></A>. <H2>Making a subclass of Fl_Window</H2> - -You may want your widget to be a subclass of <tt>Fl_Window</tt>. This -can be useful if your widget wants to occupy an entire window, and can -also be used to take advantage of system-provided clipping, or to work -with a library that expects a system window id to indicate where to -draw. - -<p>Subclassing <tt>Fl_Window</tt> is almost exactly like subclassing -<tt>Fl_Widget</tt>, in fact you can easily switch a subclass back and -forth. Watch out for the following differences: - -<ol> - - <li><tt>Fl_Window</tt> is a subclass of <tt>Fl_Group</tt> so - <i>make sure your constructor calls <tt>end()</tt></i> (unless - you actually want children added to your window). - - <li>When handling events and drawing, the upper-left corner is - at 0,0, not <tt>x(),y()</tt> as in other <tt>Fl_Widget</tt>s. - For instance, to draw a box around the widget, call - <tt>draw_box(0, 0, w(), h())</tt>, rather than - <tt>draw_box( x(), y(), w(), h())</tt>. - -</ol> - -You may also want to subclass <tt>Fl_Window</tt> in order to get access to -different visuals or to change other attributes of the windows. See -<a href="#osissues">Appendix F - Operating System Issues</a> for more -information. - -</BODY> -</HTML> - + You may want your widget to be a subclass of <TT>Fl_Window</TT>. This +can be useful if your widget wants to occupy an entire window, and can +also be used to take advantage of system-provided clipping, or to work +with a library that expects a system window id to indicate where to +draw. +<P>Subclassing <TT>Fl_Window</TT> is almost exactly like subclassing <TT> +Fl_Widget</TT>, in fact you can easily switch a subclass back and +forth. Watch out for the following differences: </P> +<OL> +<LI><TT>Fl_Window</TT> is a subclass of <TT>Fl_Group</TT> so <I>make +sure your constructor calls <TT>end()</TT></I> (unless you actually +want children added to your window). </LI> +<LI>When handling events and drawing, the upper-left corner is at 0,0, +not <TT>x(),y()</TT> as in other <TT>Fl_Widget</TT>s. For instance, to +draw a box around the widget, call <TT>draw_box(0, 0, w(), h())</TT>, +rather than <TT>draw_box( x(), y(), w(), h())</TT>. </LI> +</OL> + You may also want to subclass <TT>Fl_Window</TT> in order to get +access to different visuals or to change other attributes of the +windows. See <A href=osissues.html#osissues>Appendix F - Operating +System Issues</A> for more information. </BODY></HTML>
\ No newline at end of file diff --git a/documentation/widgets.html b/documentation/widgets.html index 84fc7de1d..ccebf0e97 100644 --- a/documentation/widgets.html +++ b/documentation/widgets.html @@ -1,11 +1,76 @@ -<HTML> -<BODY> +<HTML><BODY> <H1 ALIGN=RIGHT><A NAME=widgets>A - Widget Reference</A></H1> -This appendix describes all of the widget classes in FLTK. For a -description of the <tt>fl_</tt> functions and <tt>Fl::</tt> methods, -see <a href="#functions">Appendix B</a>. +This appendix describes all of the widget classes in FLTK. For a +description of the <TT>fl_</TT> functions and <TT>Fl::</TT> methods, +see <A href=functions.html#functions>Appendix B</A>. -</BODY> -</HTML> +<H2>List of Classes</H2> +<CENTER><TABLE WIDTH=80%> +<TR ALIGN=LEFT VALIGN=TOP> +<TD> +<UL> +<A HREF=Fl_Adjuster.html#Fl_Adjuster>Fl_Adjuster</A><BR> +<A HREF=Fl_Box.html#Fl_Box>Fl_Box</A><BR> +<A HREF=Fl_Browser.html#Fl_Browser>Fl_Browser</A><BR> +<A HREF=Fl_Browser_.html#Fl_Browser_>Fl_Browser_</A><BR> +<A HREF=Fl_Button.html#Fl_Button>Fl_Button</A><BR> +<A HREF=Fl_Chart.html#Fl_Chart>Fl_Chart</A><BR> +<A HREF=Fl_Check_Button.html#Fl_Check_Button>Fl_Check_Button</A><BR> +<A HREF=functions.html#Fl_Choice>Fl_Choice</A><BR> +<A HREF=Fl_Clock.html#Fl_Clock>Fl_Clock</A><BR> +<A HREF=Fl_Color_Chooser.html#Fl_Color_Chooser>Fl_Color_Chooser</A><BR> +<A HREF=Fl_Counter.html#Fl_Counter>Fl_Counter</A><BR> +<A HREF=Fl_Dial.html#Fl_Dial>Fl_Dial</A><BR> +<A HREF=Fl_Double_Window.html#Fl_Double_Window>Fl_Double_Window</A><BR> +<A HREF=Fl_End.html#Fl_End>Fl_End</A><BR> +<A HREF=Fl_Float_Input.html#Fl_Float_Input>Fl_Float_Input</A><BR> +<A HREF=Fl_Free.html#Fl_Free>Fl_Free</A><BR> +<A HREF=Fl_Gl_Window.html#Fl_Gl_Window>Fl_Gl_Window</A><BR> +<A HREF=Fl_Group.html#Fl_Group>Fl_Group</A><BR> +</TD> +<TD> +<A HREF=Fl_Hold_Browser.html#Fl_Hold_Browser>Fl_Hold_Browser</A><BR> +<A HREF=functions.html#Fl_Input>Fl_Input</A><BR> +<A HREF=Fl_Input_.html#Fl_Input_>Fl_Input_</A><BR> +<A HREF=Fl_Int_Input.html#Fl_Int_Input>Fl_Int_Input</A><BR> +<A HREF=Fl_Light_Button.html#Fl_Light_Button>Fl_Light_Button</A><BR> +<A HREF=Fl_Menu_.html#Fl_Menu_>Fl_Menu_</A><BR> +<A HREF=Fl_Menu_Bar.html#Fl_Menu_Bar>Fl_Menu_Bar</A><BR> +<A HREF=Fl_Menu_Button.html#Fl_Menu_Button>Fl_Menu_Button</A><BR> +<A HREF=Fl_Menu_Item.html#Fl_Menu_Item>Fl_Menu_Item</A><BR> +<A HREF=Fl_Menu_Window.html#Fl_Menu_Window>Fl_Menu_Window</A><BR> +<A HREF=Fl_Multi_Browser.html#Fl_Multi_Browser>Fl_Multi_Browser</A><BR> +<A HREF=Fl_Multiline_Input.html#Fl_Multiline_Input>Fl_Multiline_Input</A><BR> +<A HREF=Fl_Multiline_Output.html#Fl_Multiline_Output>Fl_Multiline_Output</A><BR> +<A HREF=Fl_Output.html#Fl_Output>Fl_Output</A><BR> +<A HREF=Fl_Overlay_Window.html#Fl_Overlay_Window>Fl_Overlay_Window</A><BR> +<A HREF=Fl_Pack.html#Fl_Pack>Fl_Pack</A><BR> +<A HREF=Fl_Positioner.html#Fl_Positioner>Fl_Positioner</A><BR> +<A HREF=Fl_Repeat_Button.html#Fl_Repeat_Button>Fl_Repeat_Button</A><BR> +</TD> +<TD> +<A HREF=Fl_Return_Button.html#Fl_Return_Button>Fl_Return_Button</A><BR> +<A HREF=Fl_Roller.html#Fl_Roller>Fl_Roller</A><BR> +<A HREF=Fl_Round_Button.html#Fl_Round_Button>Fl_Round_Button</A><BR> +<A HREF=Fl_Scroll.html#Fl_Scroll>Fl_Scroll</A><BR> +<A HREF=Fl_Scrollbar.html#Fl_Scrollbar>Fl_Scrollbar</A><BR> +<A HREF=Fl_Secret_Input.html#Fl_Secret_Input>Fl_Secret_Input</A><BR> +<A HREF=Fl_Select_Browser.html#Fl_Select_Browser>Fl_Select_Browser</A><BR> +<A HREF=Fl_Single_Window.html#Fl_Single_Window>Fl_Single_Window</A><BR> +<A HREF=Fl_Slider.html#Fl_Slider>Fl_Slider</A><BR> +<A HREF=Fl_Tabs.html#Fl_Tabs>Fl_Tabs</A><BR> +<A HREF=Fl_Tile.html#Fl_Tile>Fl_Tile</A><BR> +<A HREF=Fl_Timer.html#Fl_Timer>Fl_Timer</A><BR> +<A HREF=Fl_Valuator.html#Fl_Valuator>Fl_Valuator</A><BR> +<A HREF=Fl_Value_Input.html#Fl_Value_Input>Fl_Value_Input</A><BR> +<A HREF=Fl_Value_Output.html#Fl_Value_Output>Fl_Value_Output</A><BR> +<A HREF=Fl_Value_Slider.html#Fl_Value_Slider>Fl_Value_Slider</A><BR> +<A HREF=Fl_Widget.html#Fl_Widget>Fl_Widget</A><BR> +<A HREF=Fl_Window.html#Fl_Window>Fl_Window</A><BR> +</TD> +</TR> +</TABLE></CENTER> + +</BODY></HTML> |
