Updated all links so they work between files.

Revision 1.


git-svn-id: file:///fltk/svn/fltk/trunk@219 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 1999-01-13 19:28:54 +00:00
parent 30fa233681
commit d7b88a3bcc
71 changed files with 9261 additions and 12222 deletions

View File

@ -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 &lt;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>
+----<B>Fl_Adjuster</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Adjuster.H&gt;
</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
<H4><A name=Fl_Adjuster.soft>uchar Fl_Adjuster::soft() const
<BR> void Fl_Adjuster::soft(uchar)</A></H4>
If &quot;soft&quot; 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>
grab again and continue to drag, they can get to any value. Default is
one. </BODY></HTML>

View File

@ -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 &lt;FL/Fl_Box.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Box</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Box.H&gt;
</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
<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.
<h4><a name="Fl_Box.~Fl_Box">Fl_Box::~Fl_Box(void)</a></h4>
The destructor removes the box.
</body>
</html>
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>

View File

@ -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 &lt;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 &lt;= <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>
+----<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 &lt;FL/Fl_Browser.H&gt;
</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 &quot;no line&quot; 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 &lt;= <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>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>
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>
<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>
<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>
<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
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 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
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>
<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(&quot;@C%d@.%s&quot;, 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> &gt; <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
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>
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
<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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Browser_.H>
</pre></ul>
<h3>Description</h3>
+----<A href=Fl_Browser.html#Fl_Browser>Fl_Browser</A>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Browser_.H&gt;
</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
<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 &quot;height&quot; 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>
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>
<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>
<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>
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>
<h4><a name="Fl_Browser_.textfont">Fl_Font Fl_Browser_::textfont() const<br>
void Fl_Browser_::textfont(Fl_Font font)</a></h4>
<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>
<h4><a name="Fl_Browser_.textsize">uchar Fl_Browser_::textsize() const<br>
void Fl_Browser_::textsize(uchar size)</a></h4>
<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>
</body>
</html>
<P>The second form sets the default text size to <TT>size</TT></P>
</BODY></HTML>

View File

@ -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 &lt;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>
+----<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 &lt;FL/Fl_Button.H&gt;
</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>.
<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>
<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>
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,
<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 &quot;don't care&quot;
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><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>
<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><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
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).
</ul>
</body>
</html>
the mouse is dragged around in and out of the button). </LI>
</UL>
</BODY></HTML>

View File

@ -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 &lt;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
+----<B>Fl_Chart</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Chart.H&gt;
</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>.
<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:
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>
<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>
<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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Check_Button.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Check_Button</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Check_Button.H&gt;
</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
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 &quot;on&quot; 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>
&quot;light&quot; 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>

View File

@ -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 &lt;FL/Fl_Choice.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Choice</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Choice.H&gt;
</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
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>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 <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>
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>

View File

@ -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 &lt;FL/Fl_Clock.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Clock</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Clock.H&gt;
</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
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>
<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>
<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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Color_Chooser.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Color_Chooser</tt> widget provides a standard RGB color
+----<B>Fl_Color_Chooser</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Color_Chooser.H&gt;
</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
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
<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>
<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 &lt;= hue &lt; 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>
<H4><A name=Fl_Color_Chooser.hue>double Fl_Color_Chooser::hue() const</A>
</H4>
Return the current hue. 0 &lt;= hue &lt; 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 &lt;= saturation &lt;= 1.
<h4><a name="Fl_Color_Chooser.value">double Fl_Color_Chooser::value() const</a></h4>
<H4><A name=Fl_Color_Chooser.value>double Fl_Color_Chooser::value()
const</A></H4>
Returns the value/brightness. 0 &lt;= value &lt;= 1.
<h4><a name="Fl_Color_Chooser.r">double Fl_Color_Chooser::r() const</a></h4>
<H4><A name=Fl_Color_Chooser.r>double Fl_Color_Chooser::r() const</A></H4>
Returns the current red value. 0 &lt;= r &lt;= 1.
<h4><a name="Fl_Color_Chooser.g">double Fl_Color_Chooser::g() const</a></h4>
<H4><A name=Fl_Color_Chooser.g>double Fl_Color_Chooser::g() const</A></H4>
Returns the current green value. 0 &lt;= g &lt;= 1.
<h4><a name="Fl_Color_Chooser.b">double Fl_Color_Chooser::b() const</a></h4>
<H4><A name=Fl_Color_Chooser.b>double Fl_Color_Chooser::b() const</A></H4>
Returns the current blue value. 0 &lt;= b &lt;= 1.
<h4><a name="Fl_Color_Chooser.rgb">int Fl_Color_Chooser::rgb(double, double,
double)</a></h4>
<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>
<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&amp;, double&amp;, double&amp;)</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&amp;,
double&amp;, double&amp;)</a></h4>
This <i>static</i> method converts RGB colors to HSV colorspace.
</body>
</html>
<H4><A name=Fl_Color_Chooser.hsv2rgb>static void
Fl_Color_Chooser::hsv2rgb(double, double, double, double&amp;, double&amp;,
double&amp;)</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&amp;, double&amp;,
double&amp;)</A></H4>
This <I>static</I> method converts RGB colors to HSV colorspace. </BODY>
</HTML>

View File

@ -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 &lt;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>
+----<B>Fl_Counter</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Counter.H&gt;
</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>
<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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Dial.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Dial</tt> widget provides a circular dial to control a
+----<B>Fl_Dial</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Dial.H&gt;
</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>
<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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Double_Window.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Double_Window</tt> class provides a double-buffered window.
+----<B>Fl_Double_Window</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Double_Window.H&gt;
</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>
<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>

View File

@ -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 &lt;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 &lt;FL/Fl_Group.H&gt;
</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()-&gt;end()</TT>. </BODY></HTML>

View File

@ -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 &lt;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 &lt;FL/Fl_Input.H&gt;
</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>

View File

@ -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 &lt;FL/Fl_Free.H>
</pre></ul>
<h3>Description</h3>
Emulation of the Forms "free" widget. This emulation allows the free
+----<B>Fl_Free</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Free.H&gt;
</PRE>
</UL>
<H3>Description</H3>
Emulation of the Forms &quot;free&quot; 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>
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>

View File

@ -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 &lt;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
+----<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 &lt;FL/Fl_Gl_Window.H&gt;
</PRE>
</UL>
<H3>Description</H3>
The <TT>Fl_Gl_Window</TT> widget sets things up so OpenGL works, and
also keeps an OpenGL &quot;context&quot; 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.
<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 &lt;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>
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 &lt;FL/fl_draw.H&gt;, 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><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>
<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 &quot;on&quot; 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>
</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>
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>
<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>
<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.
<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>
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
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
<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>
be the same or different between the overlay and main window. </P>
</BODY></HTML>

View File

@ -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 &lt;FL/Fl_Group.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Group</tt> class is the FLTK container widget. It maintains
+----<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 &lt;FL/Fl_Group.H&gt;
</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
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 &amp;w)<BR>
void Fl_Group::add(Fl_Widget *w)</a></h4>
<H4><A name=Fl_Group.add>void Fl_Group::add(Fl_Widget &amp;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 &amp;Fl_Group::add_resizable(Fl_Widget &amp;box)</a></h4>
<H4><A name=Fl_Group.add_resizable>Fl_Group
&amp;Fl_Group::add_resizable(Fl_Widget &amp;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>
<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 &amp;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 &amp;w, int n)<BR>
void Fl_Group::insert(Fl_Widget &amp;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 &amp;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 &amp;box)<BR>
Fl_Widget *Fl_Group::resizable() const</a></h4>
<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-&gt;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 &amp;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 &amp;w, int n)
<BR> void Fl_Group::insert(Fl_Widget &amp;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 &amp;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 &amp;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>&nbsp;&nbsp;
<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>
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>&nbsp;&nbsp; <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>

View File

@ -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 &lt;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>
+----<B>Fl_Hold_Browser</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Hold_Browser.H&gt;
</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>
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>
selected, so be aware that this can happen in a callback. </BODY></HTML>

View File

@ -1,31 +1,25 @@
<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 &lt;FL/Fl_Input.H>
</pre></ul>
<h3>Description</h3>
+----<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 &lt;FL/Fl_Input.H&gt;
</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
@ -33,224 +27,153 @@ 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>
<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 &quot;real&quot;
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 &quot;quote&quot; 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 &quot;undo&quot;. 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>
<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>
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 &quot;&quot;. 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
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
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>
<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>
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>
<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>
<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>
<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>

View File

@ -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 &lt;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 &lt;FL/Fl_Input_.H&gt;
</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>
</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
<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
<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
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
<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
<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
&quot;position&quot; is where the cursor is. The &quot;mark&quot; 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
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><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
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>
<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>
clipboard. This is used to make ^K work. </BODY></HTML>

View File

@ -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 &lt;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 &lt;FL/Fl_Input.H&gt;
</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>

View File

@ -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 &lt;FL/Fl_Light_Button.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Light_Button</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Light_Button.H&gt;
</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
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 &quot;on&quot; 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>
&quot;light&quot; 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>

View File

@ -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 &lt;FL/Fl_Menu_.H>
</pre></ul>
<h3>Description</h3>
+----<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 &lt;FL/Fl_Menu_.H&gt;
</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>
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
<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>
<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.
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()-&gt;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 &quot;foo/bar/baz&quot;, this example will result
in a submenu called &quot;foo&quot; and one in that called &quot;bar&quot; and and entry
called &quot;baz&quot;. 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>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>
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>
<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>
<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>
<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>
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>

View File

@ -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 &lt;FL/Fl_Menu_Bar.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Menu_Bar</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Menu_Bar.H&gt;
</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>
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.
submenu, then it acts like a &quot;button&quot; 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>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>
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 &quot;button&quot; 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>

View File

@ -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 &lt;FL/Fl_Menu_Button.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Menu_Button</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Menu_Button.H&gt;
</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
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.
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.
<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>
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
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>
widget can be stretched to cover all your other widgets by putting it
last in the hierarchy so it is &quot;on top&quot;. 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>

View File

@ -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 &lt;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>&lt;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 &lt;FL/Fl_Menu_Item.H&gt;
</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>
&lt;FL/Fl_Menu_Item.H&gt;</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>
</PRE>
</UL>
Typically menu items are statically defined; for example:
<table>
<tr valign=top>
<td><img align=left src=menu.gif></td>
<td><pre>
<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"},
{&quot;, FL_ALT+'a', the_cb, (void*)1},
{&quot;, FL_ALT+'b', the_cb, (void*)2},
{&quot;gamma&quot;, FL_ALT+'c', the_cb, (void*)3, FL_MENU_DIVIDER},
{&quot;, 0, strange_cb},
{&quot;, 0, charm_cb},
{&quot;, 0, truth_cb},
{&quot;b, 0, beauty_cb},
{&quot;sub, 0, 0, 0, FL_SUBMENU},
{&quot;one&quot;},
{&quot;two&quot;},
{&quot;three&quot;},
{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},
{&quot;inactive&quot;, FL_ALT+'i', 0, 0, FL_MENU_INACTIVE|FL_MENU_DIVIDER},
{&quot;invisible&quot;,FL_ALT+'i', 0, 0, FL_MENU_INVISIBLE},
{&quot;check&quot;, FL_ALT+'i', 0, 0, FL_MENU_TOGGLE|FL_MENU_VALUE},
{&quot;box&quot;, 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
</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
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 &quot;shortcut&quot; 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>
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
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>
<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>
<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>
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)-&gt;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>
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 &quot;don't care&quot;
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>
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>
selected all &quot;adjacent&quot; 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>
<H4><A name=Fl_Menu_Item.set>void Fl_Menu_Item::set()</A></H4>
Turns the check or radio item &quot;on&quot; 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 &quot;on&quot; 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 &quot;off&quot; 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>
<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>
<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>
<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>
<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>
<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
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>
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>

View File

@ -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 &lt;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
+----<B>Fl_Menu_Window</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Menu_Window.H&gt;
</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>
<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>
<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>

View File

@ -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 &lt;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>
+----<B>Fl_Multi_Browser</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Multi_Browser.H&gt;
</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>
<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>
if no line has been toggled, so be aware that this can happen in a
callback. </BODY></HTML>

View File

@ -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 &lt;FL/Fl_Input.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Multiline_Input</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Input.H&gt;
</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
<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>
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>

View File

@ -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 &lt;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 &lt;FL/Fl_Multiline_Output.H&gt;
</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>

View File

@ -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 &lt;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
+----<A href=Fl_Multiline_Output.html#Fl_Multiline_Output>Fl_Multiline_Output</A>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Output.H&gt;
</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.
<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>
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>
<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>
<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 &quot;&quot;. 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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Overlay_Window.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Overlay_Window</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Overlay_Window.H&gt;
</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
&quot;overlay&quot; 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>
&quot;erased&quot; 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">&lt;FL/fl_draw.H></a>.
<h4><a name="Fl_Overlay_Window.">void Fl_Overlay_Window::redraw_overlay()</a></h4>
<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 &quot;cleared&quot; when this is called. You
can use any of the routines described in <A href=drawing.html#Drawing>
&lt;FL/fl_draw.H&gt;</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>
calling <TT>show()</TT>. </BODY></HTML>

View File

@ -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 &lt;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
+----<B>Fl_Pack</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Pack.H&gt;
</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>
<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>

View File

@ -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 &lt;FL/Fl_Positioner.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Positioner</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Positioner.H&gt;
</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>
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>
<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>
<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>
<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>
<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>
<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>
<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>

View File

@ -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 &lt;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
+----<B>Fl_Repeat_Button</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>#include &lt;FL/Fl_Repeat_Button.H&gt;</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>
<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>

View File

@ -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 &lt;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
+----<B>Fl_Return_Button</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>#include &lt;FL/Fl_Return_Button.H&gt;</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>
<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>

View File

@ -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 &lt;FL/Fl_Roller.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Roller</tt> widget is a "dolly" control commonly used to
+----<B>Fl_Roller</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Roller.H&gt;
</PRE>
</UL>
<H3>Description</H3>
The <TT>Fl_Roller</TT> widget is a &quot;dolly&quot; 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>
<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>

View File

@ -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 &lt;FL/Fl_Round_Button.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Round_Button</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Round_Button.H&gt;
</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
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 &quot;on&quot; 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>
&quot;light&quot; 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>

View File

@ -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 &lt;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
+----<B>Fl_Scroll</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Scroll.H&gt;
</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
&quot;canvas&quot;. 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>
<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
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>
<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>
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>
<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>
<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>
<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>

View File

@ -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 &lt;FL/Fl_Scrollbar.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Scrollbar</tt> widget displays a slider with arrow buttons
+----<B>Fl_Scrollbar</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Scrollbar.H&gt;
</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
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
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>
<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>
<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>
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>
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>

View File

@ -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 &lt;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 &lt;FL/Fl_Input.H&gt;
</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 &quot;secret&quot; 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>

View File

@ -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 &lt;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>
+----<B>Fl_Select_Browser</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Select_Browser.H&gt;
</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>
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>
that this is going to be zero except <I>during</I> a callback! </BODY></HTML>

View File

@ -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 &lt;FL/Fl_Single_Window.H>
</pre></ul>
<h3>Description</h3>
This is the same as <tt>Fl_Window<tt>. However, it is possible that
+----<B>Fl_Single_Window</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Single_Window.H&gt;
</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>
<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>

View File

@ -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 &lt;FL/Fl_Slider.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Slider</tt> widget contains a sliding knob inside a box. It
+----<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 &lt;FL/Fl_Slider.H&gt;
</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>
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.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>
<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>
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>
<P>For the &quot;fill&quot; 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>

View File

@ -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 &lt;FL/Fl_Tab.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Tabs</tt> widget is the "file card tabs" interface that
+----<B>Fl_Tabs</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Tab.H&gt;
</PRE>
</UL>
<H3>Description</H3>
The <TT>Fl_Tabs</TT> widget is the &quot;file card tabs&quot; 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
<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.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
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
of the <TT>Fl_Tabs</TT>), and the tabs may be placed &quot;inverted&quot; 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
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.
<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
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>
<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>

View File

@ -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 &lt;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
+----<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 &lt;FL/Fl_Tile.H&gt;
</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>The "borders" are part of the children, an <tt>Fl_Tile<tt> does not
want. </P>
<P>The &quot;borders&quot; 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
children have <TT>FL_DOWN_BOX</TT> types, and the &quot;ridges&quot; 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>.
<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>
<H4><A name=Fl_Tile.resizeable>void Fl_Tile::resizable(Fl_Widget The
&quot;resizable&quot; 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>

View File

@ -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 &lt;FL/Fl_Timer.H>
</pre></ul>
<h3>Description</h3>
+----<B>Fl_Timer</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Timer.H&gt;
</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>
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 &quot;Timer&quot; 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>
<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>
<H4><A name=Fl_Timer.value>float value() const
<BR> void value(float)</A></H4>
Gets or sets the current timer value. </BODY></HTML>

View File

@ -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 &lt;FL/Fl_Valuator.H>
</pre></ul>
<h3>Description</h3>
The <tt>Fl_Valuator</tt> class controls a single floating-point value
+----<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 &lt;FL/Fl_Valuator.H&gt;
</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>
<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 &quot;0&quot; 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>
<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>
<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>
<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
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
<P>The minimum may be greater than the maximum. This has the effect of
&quot;reversing&quot; 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>
filled. </P>
<P>Some widgets consider this a &quot;soft&quot; 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.
<h4><a name="Fl_Valuator.format">int Fl_Valuator::format(char*, double)</a></h4>
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>
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>
<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
<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>
<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>

View File

@ -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 &lt;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>
+----<B>Fl_Value_Input</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Value_Input.H&gt;
</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>
<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
<H4><A name=Fl_Value_Input.soft>uchar Fl_Value_Input::soft() const
<BR> void Fl_Value_Input::soft(uchar)</A></H4>
If &quot;soft&quot; 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>
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>
<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>
<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>

View File

@ -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 &lt;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>
+----<B>Fl_Value_Output</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Value_Output.H&gt;
</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
<H4><A name=Fl_Value_Output.soft>uchar Fl_Value_Output::soft() const
<BR> void Fl_Value_Output::soft(uchar)</A></H4>
If &quot;soft&quot; 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>
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>
<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>
<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>

View File

@ -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 &lt;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>
+----<B>Fl_Value_Slider</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/Fl_Value_Slider.H&gt;
</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>
<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>
<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>
<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>

View File

@ -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 &lt;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>
+----<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 &lt;FL/Fl_Widget.H&gt;
</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 &quot;property&quot; 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>
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>
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>
<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
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>
<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>
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">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>
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>
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
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
<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
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>
<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>
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">enumeration list</a> for predefined typefaces. The
default value uses a Helvetica typeface (Arial for Microsoft&reg;
Windows&reg;). 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>
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&reg; Windows&reg;). 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>
<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>
<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>
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>
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
<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>
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 &quot;OK&quot; 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 &quot;OK&quot; 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>
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
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() &amp;&amp; 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
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() &amp;&amp; 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="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
<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>
accepted the focus. </BODY></HTML>

View File

@ -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 &lt;FL/Fl_Window.H>
</pre></ul>
<h3>Description</h3>
+----<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 &lt;FL/Fl_Window.H&gt;
</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>
window, with a border and title and all the window management controls,
or a &quot;subwindow&quot; 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-&gt;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
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
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>
<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
<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.
</ul>
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>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>
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.
<h4><a name="Fl_Window.hide">virtual void Fl_Window::hide()</a></h4>
<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
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-&gt;shown()
&amp;!w-&gt;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
<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"><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
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
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>
<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
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
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 &quot;modal&quot; 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
the &quot;transient for&quot; 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>
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>
<H4><A name=Fl_Window.set_non_modal>void Fl_Window::set_non_modal()</A></H4>
A &quot;non-modal&quot; 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>
<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>
<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>&lt;FL/fl_draw.H></tt></a> will go into this
<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 &quot;foo&quot; turns into &quot;foo, Foo&quot;,
and &quot;xprog.1&quot; turns into &quot;xprog, XProg&quot;.</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>&lt;FL/fl_draw.H&gt;</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>
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>

View File

@ -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.
<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>&lt;FL/...></tt>.
</ul>
<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>&lt;FL/...&gt;</TT>. </LI>
</UL>
<H2>Header Files</H2>
The proper way to include FLTK header files is:
<ul><pre>
#include &lt;FL/Fl_xyz.H>
</pre></ul>
<b>Microsoft Windows developers please note:</b> case *is* significant
<UL>
<PRE>
#include &lt;FL/Fl_xyz.H&gt;
</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>
slash (/) to separate directories. The following <TT>#include</TT>
directives are *not* recommended for portability reasons:
<ul><pre>
#include &lt;fl\fl_xyz.h>
#include &lt;fl/fl_xyz.h>
#include &lt;FL\Fl_xyz.H>
</pre></ul>
<UL>
<PRE>
#include &lt;fl\fl_xyz.h&gt;
#include &lt;fl/fl_xyz.h&gt;
#include &lt;FL\Fl_xyz.H&gt;
</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 &quot;Settings&quot; from the
&quot;Project&quot; menu and then changing the &quot;Preprocessor&quot; settings under the
&quot;C/C++&quot; tab. Similarly, you will need to add the FLTK library to the
&quot;Link&quot; 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 &quot;Favor Small Code&quot;
optimization setting.</I></P>
<H2>Writing Your First FLTK Program</H2>
All programs must include the file <tt>&lt;FL/Fl.H&gt</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>&nbsp;
<pre>
#include &lt;FL/Fl.H>
#include &lt;FL/Fl_Window.H>
#include &lt;FL/Fl_Box.H>
All programs must include the file <TT>&lt;FL/Fl.H In addition the
program must include a header file for each FLTK class it uses.
Listing 1 shows a simple &quot;Hello, World!&quot; program that uses FLTK to
display the window.
<UL><I>Listing 1 - &quot;hello.cxx&quot;</I>
<BR>&nbsp;
<PRE>
#include &lt;FL/Fl.H&gt;
#include &lt;FL/Fl_Window.H&gt;
#include &lt;FL/Fl_Box.H&gt;
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,&quot;Hello, World!&quot;);
box-&gt;labelsize(36);
box-&gt;labelfont(FL_BOLD+FL_ITALIC);
box-&gt;labeltype(FL_SHADOW_LABEL);
window-&gt;end();
window-&gt;show(argc, argv);
return Fl::run();
}
</pre></ul>
</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>
<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 &quot;Hello, World!&quot; 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,&quot;Hello, World!&quot;);
</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>
<UL>
<PRE>
box-&gt;<A href=Fl_Widget.html#Fl_Widget.labelsize>labelsize</A>(36);
box-&gt;<A href=Fl_Widget.html#Fl_Widget.labelfont>labelfont</A>(FL_BOLD+FL_ITALIC);
box-&gt;<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.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>
<UL>
<PRE>
window-&gt;<A href=Fl_Group.html#Fl_Group.end>end</A>();
window-&gt;<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
</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 &quot;Hello, World!&quot; 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.
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>.
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>

View File

@ -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>&lt;FL/Fl_xyz_Button.H></tt> header file. The constructor takes the
<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>
&lt;FL/Fl_xyz_Button.H&gt;</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");
<UL>
<PRE>
Fl_Button *button = new Fl_Button(x, y, width, height, &quot;label&quot;);
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, &quot;label&quot;);
</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-&gt;type(0);
lbutton-&gt;type(FL_TOGGLE_BUTTON);
rbutton-&gt;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>
<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, &quot;label&quot;);
input-&gt;value(&quot;Now is the time for all good men...&quot;);
</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
&quot;container&quot; 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
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-&gt;position(x, y);
group-&gt;resize(x, y, width, height);
window-&gt;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 &quot;standard&quot; 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>&ltFL/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
<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-&gt;color(FL_RED);
</PRE>
</UL>
Similarly, the label color can be set using the <TT>labelcolor()</TT>
method:
<UL>
<PRE>
button-&gt;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&gt;</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 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
</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.
<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 &quot;@xyz&quot; labels, see &quot;<A href=#symbols>
Symbol Labels</A>&quot; </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.
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
The <TT>Fl::set_labeltype</TT> method creates a label type using your
draw and measure functions:
<ul><pre>
<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
</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>
<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:
<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>
<CENTER><IMG src=./symbols.gif></CENTER>
The @ sign may be followed by the following optional &quot;formatting&quot;
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>
button-&gt;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.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>
changes. You can change this using the <A href=Fl_Widget.html#Fl_Widget.when>
<TT>when()</TT></A> method:
<UL>
<PRE>
button-&gt;when(FL_WHEN_NEVER);
button-&gt;when(FL_WHEN_CHANGED);
button-&gt;when(FL_WHEN_RELEASE);
button-&gt;when(FL_WHEN_RELEASE_ALWAYS);
button-&gt;when(FL_WHEN_ENTER_KEY);
button-&gt;when(FL_WHEN_ENTER_KEY_ALWAYS);
button-&gt;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>
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-&gt;shortcut(FL_Enter);
button-&gt;shortcut(FL_SHIFT + 'b');
button-&gt;shortcut(FL_CTRL + 'b');
button-&gt;shortcut(FL_ALT + 'b');
button-&gt;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>
the special keys like <TT>FL_Enter</TT>) combined with any modifiers
(like shift, alt, and control). </BODY></HTML>

File diff suppressed because it is too large Load Diff

View File

@ -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, &quot;Text Editor&quot;);
</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] = &quot;&quot;;
char search[256] = &quot;&quot;;
</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[] = {
{ "&amp;File", 0, 0, 0, FL_SUBMENU },
{ "&amp;New", FL_ALT + 'n', new_cb },
{ "&amp;Open...", FL_ALT + 'o', open_cb, 0, FL_MENU_DIVIDER },
{ "&amp;Save", FL_ALT + 's', save_cb },
{ "Save &amp;As...", FL_ALT + FL_SHIFT + 's', saveas_cb, 0, FL_MENU_DIVIDER },
{ "&amp;Quit", FL_ALT + 'q', quit_cb },
{ &quot;&amp;File&quot;, 0, 0, 0, FL_SUBMENU },
{ &quot;&amp;New&quot;, FL_ALT + 'n', new_cb },
{ &quot;&amp;Open...&quot;, FL_ALT + 'o', open_cb, 0, FL_MENU_DIVIDER },
{ &quot;&amp;Save&quot;, FL_ALT + 's', save_cb },
{ &quot;Save &amp;As...&quot;, FL_ALT + FL_SHIFT + 's', saveas_cb, 0, FL_MENU_DIVIDER },
{ &quot;&amp;Quit&quot;, FL_ALT + 'q', quit_cb },
{ 0 },
{ "&amp;Edit", 0, 0, 0, FL_SUBMENU },
{ "&amp;Undo", FL_ALT + 'z', undo_cb, 0, FL_MENU_DIVIDER },
{ "Cu&amp;t", FL_ALT + 'x', cut_cb },
{ "&amp;Copy", FL_ALT + 'c', copy_cb },
{ "&amp;Paste", FL_ALT + 'v', paste_cb },
{ "&amp;Delete", 0, delete_cb },
{ &quot;&amp;Edit&quot;, 0, 0, 0, FL_SUBMENU },
{ &quot;&amp;Undo&quot;, FL_ALT + 'z', undo_cb, 0, FL_MENU_DIVIDER },
{ &quot;Cu&amp;t&quot;, FL_ALT + 'x', cut_cb },
{ &quot;&amp;Copy&quot;, FL_ALT + 'c', copy_cb },
{ &quot;&amp;Paste&quot;, FL_ALT + 'v', paste_cb },
{ &quot;&amp;Delete&quot;, 0, delete_cb },
{ 0 },
{ "&amp;Search", 0, 0, 0, FL_SUBMENU },
{ "&amp;Find...", FL_ALT + 'f', find_cb },
{ "F&amp;ind Again", FL_ALT + 'g', find2_cb },
{ "&amp;Replace...", FL_ALT + 'r', replace_cb },
{ "Re&amp;place Again", FL_ALT + 't', replace2_cb },
{ &quot;&amp;Search&quot;, 0, 0, 0, FL_SUBMENU },
{ &quot;&amp;Find...&quot;, FL_ALT + 'f', find_cb },
{ &quot;F&amp;ind Again&quot;, FL_ALT + 'g', find2_cb },
{ &quot;&amp;Replace...&quot;, FL_ALT + 'r', replace_cb },
{ &quot;Re&amp;place Again&quot;, 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>
menubar-&gt;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 &quot;changed&quot; callback:
<UL>
<PRE>
input-&gt;callback(changed_cb);
input-&gt;when(FL_WHEN_CHANGED);
</PRE>
</UL>
Finally, we want to use a mono-spaced font like <TT>FL_COURIER</TT>:
<UL>
<PRE>
input-&gt;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>
keep things simple we will have a &quot;find&quot; string, a &quot;replace&quot; string,
and &quot;replace all&quot;, &quot;replace next&quot;, and &quot;cancel&quot; buttons. The strings
are just <TT>Fl_Input</TT> widgets, the &quot;replace all&quot; and &quot;cancel&quot;
buttons are <TT>Fl_Button</TT> widgets, and the &quot;replace next &quot; 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, &quot;Replace&quot;);
Fl_Input *replace_find = new Fl_Input(70, 10, 200, 25, &quot;Find:&quot;);
Fl_Input *replace_with = new Fl_Input(70, 40, 200, 25, &quot;Replace:&quot;);
Fl_Button *replace_all = new Fl_Button(10, 70, 90, 25, &quot;Replace All&quot;);
Fl_Button *replace_next = new Fl_Button(105, 70, 120, 25, &quot;Replace Next&quot;);
Fl_Button *replace_cancel = new Fl_Button(230, 70, 60, 25, &quot;Cancel&quot;);
</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
This callback function will call <A href=#Fl_Input.copy><TT>
input-&gt;copy()</TT></A> to copy the currently selected text to the
clipboard:
<ul><pre>
<UL>
<PRE>
void copy_cb(void) {
input->copy();
input-&gt;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-&gt;copy()</TT></A> to copy the currently selected text to the
clipboard and then <A href=Fl_Input_.html#Fl_Input_.cut><TT>input-&gt;cut()</TT>
</A> to delete it:
<UL>
<PRE>
void cut_cb(void) {
input->copy();
input->cut();
input-&gt;copy();
input-&gt;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-&gt;cut()</TT></A> to delete the selected text:
<UL>
<PRE>
void delete_cb(void) {
input->cut();
input-&gt;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(&quot;Search String:&quot;, 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-&gt;value() + input-&gt;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-&gt;mark() + found - val;
input-&gt;position(pos, pos + strlen(search));
}
else fl_alert("No occurrences of \'%s\' found!", search);
else fl_alert(&quot;No occurrences of \'%s\' found!&quot;, 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-&gt;value(&quot;&quot;);
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
calls the <TT>check_save()</TT> function to give the user the
opportunity to save the current file first as needed:
<ul><pre>
<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(&quot;Open File?&quot;, &quot;*&quot;, 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-&gt;hide();
}
</pre></ul>
</PRE>
</UL>
<H3>replace_cb()</H3>
The replace callback just shows the replace dialog:
<ul><pre>
<UL>
<PRE>
void replace_cb(void) {
replace_dlg->show();
replace_dlg-&gt;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-&gt;value();
if (find[0] == '\0') {
// Search string is blank; get a new one...
replace_dlg->show();
replace_dlg-&gt;show();
return;
}
val = input->value() + input->position();
val = input-&gt;value() + input-&gt;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-&gt;position() + found - val;
input-&gt;replace(pos, pos + strlen(find), replace_with-&gt;value());
input-&gt;position(pos + strlen(replace_with-&gt;value()));
}
else fl_alert("No occurrences of \'%s\' found!", find);
else fl_alert(&quot;No occurrences of \'%s\' found!&quot;, 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-&gt;value();
if (find[0] == '\0') {
// Search string is blank; get a new one...
replace_dlg->show();
replace_dlg-&gt;show();
return;
}
input->position(0);
input-&gt;position(0);
times = 0;
// Loop through the whole string
do {
val = input->value() + input->position();
val = input-&gt;value() + input-&gt;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-&gt;position() + found - val;
input-&gt;replace(pos, pos + strlen(find), replace_with-&gt;value());
input-&gt;position(pos + strlen(replace_with-&gt;value()));
}
} while (found != NULL);
if (times > 0) fl_message("Replaced %d occurrences.", times);
else fl_alert("No occurrences of \'%s\' found!", find);
if (times &gt; 0) fl_message(&quot;Replaced %d occurrences.&quot;, times);
else fl_alert(&quot;No occurrences of \'%s\' found!&quot;, find);
}
</pre></ul>
</PRE>
</UL>
<H3>replcan_cb()</H3>
This callback just hides the replace dialog:
<ul><pre>
<UL>
<PRE>
void replcan_cb() {
replace_dlg->hide();
replace_dlg-&gt;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 &quot;save as&quot; 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>
<UL>
<PRE>
void saveas_cb(void) {
char *newfile;
newfile = fl_file_chooser("Save File As?", "*", filename);
newfile = fl_file_chooser(&quot;Save File As?&quot;, &quot;*&quot;, 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-&gt;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>
<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(&quot;The current file has not been saved.\n&quot;
&quot;Would you like to save it now?&quot;)) {
// 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-&gt;value(&quot;&quot;);
fp = fopen(newfile, "r");
fp = fopen(newfile, &quot;r&quot;);
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)) &gt; 0) {
input-&gt;replace(pos, pos, buffer, nbytes);
pos += nbytes;
}
fclose(fp);
input->position(0);
input-&gt;position(0);
set_changed(0);
} else {
// Couldn't open file - say so...
fl_alert("Unable to open \'%s\' for reading!");
fl_alert(&quot;Unable to open \'%s\' for reading!&quot;);
}
}
</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
</PRE>
</UL>
When loading the file we use the <A href=Fl_Input_.html#Fl_Input_.replace>
<TT>input-&gt;replace()</TT></A> method to &quot;replace&quot; 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>
<UL>
<PRE>
void save_file(char *newfile) {
FILE *fp;
fp = fopen(newfile, "w");
fp = fopen(newfile, &quot;w&quot;);
if (fp != NULL) {
// Was able to create file; let's write to it...
strcpy(filename, newfile);
if (fwrite(input->value(), 1, input->size(), fp) &lt; 1) {
fl_alert("Unable to write file!");
if (fwrite(input-&gt;value(), 1, input-&gt;size(), fp) &lt; 1) {
fl_alert(&quot;Unable to write file!&quot;);
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(&quot;Unable to create \'%s\' for writing!&quot;);
}
}
</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, &quot;Untitled&quot;);
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, &quot; (modified)&quot;);
window->label(title);
window-&gt;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++
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>
<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>
<CENTER><IMG src=./editor.gif></CENTER>
</BODY></HTML>

View File

@ -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>&lt;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>
&lt;FL/Enumerations.H&gt;</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
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>
<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 &quot;When&quot; 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>
<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>
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>
<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>
<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>
<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 &quot;When&quot; 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>
<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>

View File

@ -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>
<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>
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 &quot;wants&quot; 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>
<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>
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.
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>
<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="#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
<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="#event_key"><tt>Fl::event_key()</tt></a> to figure out why it moved. For
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.
<h3>FL_UNFOCUS</h3>
Sent to the previous <a href="#focus"><tt>Fl::focus()</tt></a> when
another widget gets the focus.
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,
<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="#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>You can also make &quot;global&quot; 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>
<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:
<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
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 &quot;interests&quot; (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>
<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>

File diff suppressed because it is too large Load Diff

View File

@ -1,271 +1,200 @@
<HTML>
<BODY>
<H1 ALIGN=RIGHT><A NAME="forms">E - Forms Compatibility</A></H1>
<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
<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
<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>&lt;FL/forms.H></tt>.
have more immediate luck with the forms compatibility header, <TT>
&lt;FL/forms.H&gt;</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
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
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 &quot;pure&quot; 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>
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><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
features (such as the &quot;canvas&quot; 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 &quot;free&quot; 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 &quot;-&gt;x&quot; with &quot;-&gt;x()&quot;, etc. Replace
&quot;boxtype&quot; with &quot;box()&quot;. </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"><tt>Fl_Output</tt></a> widget.
<p>The default fonts and sizes are matched to the older GL version of
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>fdesign outputs a setting of a "fdui" instance variable to the main
does. </P>
<P>fdesign outputs a setting of a &quot;fdui&quot; 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>
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 &quot;-&gt;fdui&quot; and edit to use &quot;-&gt;user_data()&quot; 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>
<H3>Does Not Run In Background</H3>
The IRISGL library always forked when you created the first window,
unless &quot;foreground()&quot; was called. FLTK acts like &quot;foreground()&quot; is
called all the time. If you really want the fork behavior do &quot;if
(fork()) exit(0)&quot; 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
<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>.
<h3>You Must Use OpenGL to Draw Everything</h3>
<p>The file <tt>&lt;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
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>&lt;FL/gl.h&gt;</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>If your subclass draws into the overlay you are in trouble and will
have to rewrite things a lot.
<h3>You Cannot Use &lt;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
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 &quot;understood&quot; the event.
<P>An attempt has been made to emulate the &quot;free&quot; widget. This appears
to work quite well. It may be quicker to modify your subclass into a
&quot;free&quot; widget, since the &quot;handle&quot; 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 &lt;device.h&gt;</H3>
If you have written your own &quot;free&quot; widgets you will probably get a
lot of errors about &quot;getvaluator&quot;. 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 &quot;style&quot; 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>
<UL>
<PRE>
fl_font_name(3,&quot;*courier-medium-r-no*&quot;);
fl_font_name(4,&quot;*courier-bold-r-no*&quot;);
fl_font_name(5,&quot;*courier-medium-o-no*&quot;);
fl_font_name(6,&quot;*times-medium-r-no*&quot;);
fl_font_name(7,&quot;*times-bold-r-no*&quot;);
fl_font_name(8,&quot;*times-medium-i-no*&quot;);
fl_font_name(9,&quot;*bookman-light-r-no*&quot;);
fl_font_name(10,&quot;*bookman-demi-r-no*&quot;);
fl_font_name(11,&quot;*bookman-light-i-no*&quot;);
</PRE>
</UL>
</BODY></HTML>

File diff suppressed because it is too large Load Diff

View File

@ -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>&lt;FL/glut.H></tt> instead of <tt>&lt;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
You should be able to compile existing GLUT source code by including <TT>
&lt;FL/glut.H&gt;</TT> instead of <TT>&lt;GL/glut.h&gt;</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><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
<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><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>
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 &quot;-di&quot; for &quot;-display&quot;). </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-&gt;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-&gt;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 &lt;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>
+----<B>Fl_Glut_Window</B>
</PRE>
</UL>
<H3>Include Files</H3>
<UL>
<PRE>
#include &lt;FL/glut.H&gt;
</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-&gt;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>
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>

View File

@ -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&reg;), OpenGL&reg;, and
Microsoft&reg; Windows&reg; 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
<HTML><BODY>
<H1 ALIGN=RIGHT><A NAME=intro>1 - Introduction to FLTK</A></H1>
The Fast Light Tool Kit (&quot;FLTK&quot;, pronounced &quot;fulltick&quot;) is a LGPL'd
C++ graphical user interface toolkit for X (UNIX&reg;), OpenGL&reg;, and
Microsoft&reg; Windows&reg; 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 &quot;views&quot;. 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
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
better and cleaner windowing system, and he reimplemented &quot;views&quot; 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
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 &quot;window manager&quot;, 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
window around. </P>
<P>At Digital Domain Bill discovered another toolkit, &quot;Forms&quot;. 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>Bill received permission to release it for free on the Internet,
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>Digital Domain has since withdrawn support for FLTK. While Bill is
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.
<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 &amp; 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 &amp; 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 &amp;
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>
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 &quot;core&quot; (the &quot;hello&quot; program compiled &amp; 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 &amp; 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 &amp; 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
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 &quot;FLTK&quot; 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 &quot;fl_&quot;. 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 &quot;FL&quot; 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
&quot;FLTK&quot;, and even a bogus excuse that it stands for &quot;The Fast Light Tool
Kit&quot;.
<H2>Building and Installing FLTK Under UNIX</H2>
In most cases you can just type &quot;make&quot;. 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 &lt;options>", where options are:
<dl>
<dt>--enable-debug</dt>
<dd>Enable debugging code &amp; 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.
<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
&quot;./configure &lt;options&gt;&quot;, where options are: </P>
<DL>
<DT>--enable-debug</DT>
<DD>Enable debugging code &amp; 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 &quot;make&quot; 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>
<P>To install the library, become root and type &quot;make install&quot;. This
will copy the &quot;fluid&quot; executable to &quot;bindir&quot;, the header files to
&quot;includedir&quot;, and the library files to &quot;libdir&quot;. </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:
<ul><pre>
cp makefiles/makeinclude.&lt;env> makeinclude
cp makefiles/config.&lt;env> config.h
is to use the Visual C++ 5.0 project files under the &quot;visualc&quot;
directory. Just open (or double-click on) the &quot;fltk.dsw&quot; file to get
the whole shebang.
<P>The second method is to use a GNU-based development tool with the
files in the &quot;makefiles&quot; 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.&lt;env&gt; makeinclude
cp makefiles/config.&lt;env&gt; config.h
make
</pre></ul>
<h2>Building FLTK Under OS/2</h2>
</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>
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>
</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
<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 (&quot;fltk@easysw.com&quot;) 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 &amp; 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>
<P>To join the FLTK mailing list, send a message to
&quot;majordomo@easysw.com&quot; with &quot;subscribe fltk&quot; in the message body. A
digest of this list is available by subscribing to the &quot;fltk-digest&quot;
mailing list. </P>
<H2>Reporting Bugs</H2>
To report a bug in FLTK, send an email to &quot;fltk-bugs@easysw.com&quot;.
Please include the FLTK version, operating system &amp; 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 &quot;fltk@easysw.com&quot;. </P>
</BODY></HTML>

View File

@ -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.
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.
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.
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.
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.
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.
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.
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>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.
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.
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
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.
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
&quot;work based on the libary&quot; and a &quot;work that uses the library&quot;. The
former contains code derived from the library, while the latter only
works together with the library.
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.
<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
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 &quot;this License&quot;). Each
licensee is addressed as &quot;you&quot;.
<P>A &quot;library&quot; 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
(which use some of those functions and data) to form executables. </P>
<P>The &quot;Library&quot;, below, refers to any such software library or work
which has been distributed under these terms. A &quot;work based on the
Library&quot; 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
included without limitation in the term &quot;modification&quot;.) </P>
<P>&quot;Source code&quot; 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.
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><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
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.
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><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.
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>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.
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><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
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 &quot;work that uses the
Library&quot;. 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 &quot;work that uses the Library&quot; 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
contains portions of the Library), rather than a &quot;work that uses the
library&quot;. The executable is therefore covered by this License. Section
6 states terms for distribution of such executables. </P>
<P>When a &quot;work that uses the Library&quot; 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.
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.)
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><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
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 &quot;work that uses the Library&quot; 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.
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><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
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
&quot;work that uses the Library&quot;, 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 &quot;work that
uses the Library&quot; 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.
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><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.
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>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
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 &quot;any later version&quot;, 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
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.
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
<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 &quot;AS IS&quot; 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.
DAMAGES. </P>
<H2 ALIGN=CENTER>END OF TERMS AND CONDITIONS</H2>
</BODY>
</HTML>
</BODY></HTML>

View File

@ -1,48 +1,33 @@
<HTML>
<BODY>
<H1 ALIGN=RIGHT><A NAME="opengl">9 - Using OpenGL</A></H1>
<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
<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>You must include FLTK's <tt>&lt;FL/gl.h></tt> header file. It will include
the file <tt>&lt;GL/gl.h></tt>, define some extra drawing functions
provided by FLTK, and include the <tt>&lt;windows.h></tt> header file needed
by WIN32 applications.
<h2>Making a Subclass of Fl_Gl_Window</h2>
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>&lt;FL/gl.h&gt;</TT> header file. It will
include the file <TT>&lt;GL/gl.h&gt;</TT>, define some extra drawing
functions provided by FLTK, and include the <TT>&lt;windows.h&gt;</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>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>
<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
</PRE>
</UL>
<H3>The handle() Method</H3>
The <TT>handle()</TT> method handles mouse and keyboard events for the
window:
<ul><pre>
<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
</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 &quot;class&quot; field with MyWindow.H.
This will make fluid produce constructors for your new class. </LI>
<LI>In the &quot;extra code&quot; put <TT>#include &quot;MyWindow.H&quot;</TT>, so that
the fluid output file will compile. </LI>
</OL>
You must put <TT>glwindow-&gt;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.mode"><tt>Fl_Gl_Window::mode()</tt></a> to describe
how you intend to use OpenGL:
<ul><pre>
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>&lt;FL/gl.H></tt> (which you should include instead of the OpenGL
header <tt>&lt;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>
</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()-&gt;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>
&lt;FL/gl.H&gt;</TT> (which you should include instead of the OpenGL header <TT>
&lt;GL/gl.h&gt;</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 &quot;current OpenGL font&quot; 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
<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>
<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
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>
<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_-&gt;setCamera(camera_);
camera_-&gt;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_-&gt;ref();
context_-&gt;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_-&gt;setCamera(camera_);
camera_-&gt;draw(draw_action_);
}
}
if (!valid()) {
// Update the viewport for this context...
context_->setViewport(0, 0, w(), h());
context_-&gt;setViewport(0, 0, w(), h());
}
// Clear the window...
context_->clear(csContext::COLOR_CLEAR | csContext::DEPTH_CLEAR,
context_-&gt;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_-&gt;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>

View File

@ -1,271 +1,216 @@
<HTML>
<BODY>
<H1 ALIGN=RIGHT><A NAME="osissues">F - Operating System Issues</A></H1>
<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 &lt;FL/x.H>
</pre></ul>
<H2>X-Specific Interface</H2>
<UL>
<PRE>
#include &lt;FL/x.H&gt;
</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
<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
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>).
<h4><a name="fl_xevent">extern XEvent *fl_xvent</a></h4>
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>
<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
<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 &amp;)</a></h4>
<H4><A name=fl_handle>int fl_handle(const XEvent &amp;)</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
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="#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>
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>
</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>
<UL>
<PRE>
XDrawSomething(fl_display, fl_window, fl_gc, ...);
</pre></ul>
</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>
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="#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>
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(&quot;DISPLAY=...&quot;)</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
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
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
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>
<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>
the last number in the <TT>Fl::display()</TT> string to &quot;host:0,#&quot;.
<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(&quot;No good visual&quot;);
fl_colormap = make_a_colormap(fl_display, fl_visual-&gt;visual, fl_visual-&gt;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>
window-&gt;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
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>
<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-&gt;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
</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>
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)-&gt;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)-&gt;region);
Fl_X::i(this)-&gt;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>
</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
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"
<UL>
<PRE>
#include &quot;icon.xbm&quot;
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 &lt;FL/x.H>
</pre></ul>
The <tt>&lt;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>
window-&gt;icon((char *)p);
</PRE>
</UL>
<H2>WIN32-Specific Interface</H2>
<UL>
<PRE>
#include &lt;FL/x.H&gt;
</PRE>
</UL>
The <TT>&lt;FL/x.H&gt;</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 &quot;FLTK&quot; 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
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
<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>
<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>
</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
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>
<UL>
<PRE>
window-&gt;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
<P>To always get a console window you simply create a console
application (the &quot;/SUBSYSTEM:CONSOLE&quot; 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
&quot;/SUBSYSTEM:WINDOWS&quot; 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
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>
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>

View File

@ -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">
<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 (&quot;FLTK&quot;) version 1.0, a
C++ Graphical User Interface (&quot;GUI&quot;) 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:
<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:
<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:
<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>
</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>

View File

@ -1,63 +1,51 @@
<HTML>
<BODY>
<H1 ALIGN=RIGHT><A NAME="subclassing">7 - Adding and Extending Widgets</A></H1>
<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
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.
<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
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>
<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>
<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
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
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 &quot;centered&quot; 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.
<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
<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>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).
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
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>
<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
</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
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>.
<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 <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.
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>
A &quot;composite&quot; widget contains one or more &quot;child&quot; 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:
<ul><pre>
<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>
</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>
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>
</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>
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-&gt;parent())-&gt;slider_cb();
}
void MyClass::slider_cb() { // normal method
use(the_slider->value());
use(the_slider-&gt;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
</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>
<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&amp;)</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&amp;) 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&amp;)</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&amp;)</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&amp;) 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-&gt;draw_label(x,y,w,h,a)</TT>.
<H3><A name=update_child>void Fl_Group::update_child(Fl_Widget&amp;)</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>.
<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
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>
<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>

View File

@ -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>.
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>