Doco updates.

Remove unneeded files from the makefiles directory.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1735 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2001-11-26 21:40:14 +00:00
parent c93c134710
commit ecd2c821be
13 changed files with 835 additions and 1261 deletions

View File

@ -78,6 +78,7 @@ CHANGES IN FLTK 1.1.0b6
old FL_PATH_MAX size. old FL_PATH_MAX size.
- fl_file_chooser() and fl_dir_chooser() now return a - fl_file_chooser() and fl_dir_chooser() now return a
relative path. relative path.
- Fl_Help_View now supports all ampersand escapes.
CHANGES IN FLTK 1.1.0b5 CHANGES IN FLTK 1.1.0b5

View File

@ -1,5 +1,5 @@
// //
// "$Id: Fl_Button.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // "$Id: Fl_Button.H,v 1.5.2.3.2.2 2001/11/26 21:40:14 easysw Exp $"
// //
// Button header file for the Fast Light Tool Kit (FLTK). // Button header file for the Fast Light Tool Kit (FLTK).
// //
@ -31,6 +31,7 @@
#endif #endif
// values for type() // values for type()
#define FL_NORMAL_BUTTON 0
#define FL_TOGGLE_BUTTON 1 #define FL_TOGGLE_BUTTON 1
#define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2) #define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2)
#define FL_HIDDEN_BUTTON 3 // for Forms compatability #define FL_HIDDEN_BUTTON 3 // for Forms compatability
@ -71,5 +72,5 @@ public:
#endif #endif
// //
// End of "$Id: Fl_Button.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // End of "$Id: Fl_Button.H,v 1.5.2.3.2.2 2001/11/26 21:40:14 easysw Exp $".
// //

View File

@ -1,70 +1,18 @@
<HTML><BODY> <HTML>
<BODY>
<H1 ALIGN=RIGHT><A NAME=basics>2 - FLTK Basics</A></H1> <H1 ALIGN=RIGHT><A NAME=basics>2 - FLTK Basics</A></H1>
This chapter will teach you the basics of compiling programs that use
FLTK. <P>This chapter teaches you the basics of compiling programs
<H2>Naming</H2> that use FLTK.</P>
All public symbols in FLTK start with the characters 'F' and 'L':
<UL>
<LI>Functions are either <TT>Fl::foo()</TT> or <TT>fl_foo()</TT>. </LI>
<LI>Class and type names are capitalized: <TT>Fl_Foo</TT>. </LI>
<LI><A href=enumerations.html#Enumerations>Constants and enumerations</A>
are uppercase: <TT>FL_FOO</TT>. </LI>
<LI>All header files start with <TT>&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&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. <i>Do not do any of the following:</i>
<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>
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>
CC ... -L/usr/local/lib -lfltk -lXext -lX11 -lm
gcc ... -L/usr/local/lib -lfltk -lXext -lX11 -lm
</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 &quot;Settings&quot; from the
&quot;Project&quot; menu and then changing the &quot;Preprocessor&quot; settings under the
&quot;C/C++&quot; tab. You will also need to add the FLTK and WinSock (WSOCK32.LIB)
libraries 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++ 5.0 optimizer is known to cause problems with
many programs. We only recommend using the &quot;Favor Small Code&quot;
optimization setting.</I> The Visual C++ 6.0 optimizer seems to be much
better and can be used with the "optimized for speed" setting.</P>
<H2>Writing Your First FLTK Program</H2> <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. <P>All programs must include the file <TT>&lt;FL/Fl.H&gt;</TT>.
Listing 1 shows a simple &quot;Hello, World!&quot; program that uses FLTK to In addition the program must include a header file for each
display the window. FLTK class it uses. Listing 1 shows a simple &quot;Hello,
World!&quot; program that uses FLTK to display the window.</P>
<UL> <UL>
<P><I>Listing 1 - &quot;hello.cxx&quot;</I> <P><I>Listing 1 - &quot;hello.cxx&quot;</I>
<PRE> <PRE>
@ -83,111 +31,256 @@ int main(int argc, char **argv) {
window-&gt;show(argc, argv); window-&gt;show(argc, argv);
return Fl::run(); return Fl::run();
} }
</PRE> </PRE></UL>
</UL>
After including the required header files, the program then creates a <P>After including the required header files, the program then creates a
window: window:</P>
<UL>
<PRE> <UL><PRE>
Fl_Window *window = new <A href=Fl_Window.html#Fl_Window>Fl_Window</A>(300,180); Fl_Window *window = new <A href=Fl_Window.html#Fl_Window>Fl_Window</A>(300,180);
</PRE> </PRE></UL>
</UL>
and a box with the &quot;Hello, World!&quot; string in it: <P>and a box with the &quot;Hello, World!&quot; string in it:</P>
<UL>
<PRE> <UL><PRE>
Fl_Box *box = new <A href=Fl_Box.html#Fl_Box>Fl_Box</A>(20,40,260,100,&quot;Hello, World!&quot;); Fl_Box *box = new <A href=Fl_Box.html#Fl_Box>Fl_Box</A>(20,40,260,100,&quot;Hello, World!&quot;);
</PRE> </PRE></UL>
</UL>
Next, we set the type of box and the size, font, and style of the label: <P>Next, we set the type of box and the size, font, and style of the label:</P>
<UL>
<PRE> <UL><PRE>
box-&gt;box(FL_UP_BOX); box-&gt;box(FL_UP_BOX);
box-&gt;<A href=Fl_Widget.html#Fl_Widget.labelsize>labelsize</A>(36); 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.labelfont>labelfont</A>(FL_BOLD+FL_ITALIC);
box-&gt;<A href=Fl_Widget.html#Fl_Widget.labeltype>labeltype</A>(FL_SHADOW_LABEL); box-&gt;<A href=Fl_Widget.html#Fl_Widget.labeltype>labeltype</A>(FL_SHADOW_LABEL);
</PRE> </PRE></UL>
</UL>
Finally, we show the window and enter the FLTK event loop: <P>Finally, we show the window and enter the FLTK event loop:</P>
<UL>
<PRE> <UL><PRE>
window-&gt;<A href=Fl_Group.html#Fl_Group.end>end</A>(); 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); window-&gt;<A href=Fl_Window.html#Fl_Window.show>show</A>(argc, argv);
return <A href=functions.html#run>Fl::run</A>(); return <A href=functions.html#run>Fl::run</A>();
</PRE> </PRE></UL>
</UL>
The resulting program will display the window below. You can quit the <P>The resulting program will display the window in Figure 2-1.
program by closing the window or pressing the ESCape key. You can quit the program by closing the window or pressing the
<P ALIGN=CENTER><IMG src="hello.C.gif" alt="Hello, World! Window"></P> <KBD>ESC</KBD>ape key.</P>
<P ALIGN="CENTER"><IMG src="hello.C.gif" alt="Hello, World! Window"><BR>
<I>Figure 2-1: The Hello, World! Window</I></P>
<H3>Creating the Widgets</H3> <H3>Creating the Widgets</H3>
The widgets are created using the C++ <TT>new</TT> operator. For
most widgets the arguments to the constructor are: <P>The widgets are created using the C++ <TT>new</TT> operator. For
<UL> most widgets the arguments to the constructor are:</P>
<PRE>
<UL><PRE>
Fl_Widget(x, y, width, height, label) Fl_Widget(x, y, width, height, label)
</PRE> </PRE></UL>
</UL>
<P>The <TT>x</TT> and <TT>y</TT> parameters determine where the widget <P>The <TT>x</TT> and <TT>y</TT> parameters determine where the
or window is placed on the screen. In FLTK the top left corner of the widget or window is placed on the screen. In FLTK the top left
window or screen is the origin (i.e. x = 0, y = 0) and the units are in corner of the window or screen is the origin (i.e. x = 0, y =
pixels. </P> 0) and the units are in pixels.</P>
<P>The <TT>width</TT> and <TT>height</TT> parameters determine the size
of the widget or window in pixels. The maximum widget size is <P>The <TT>width</TT> and <TT>height</TT> parameters determine
typically governed by the underlying window system or hardware. </P> the size of the widget or window in pixels. The maximum widget
<p><tt>label</tt> is a pointer to a character string to label the size is typically governed by the underlying window system or
widget with or <tt>NULL</tt>. If not specified the label defaults to hardware.</P>
<tt>NULL</tt>. The label string must be in static storage such as a
string constant because FLTK does not make a copy of it - it just uses <P><tt>label</tt> is a pointer to a character string to label
the pointer. the widget with or <tt>NULL</tt>. If not specified the label
defaults to <tt>NULL</tt>. The label string must be in static
storage such as a string constant because FLTK does not make a
copy of it - it just uses the pointer.</P>
<H3>Get/Set Methods</H3> <H3>Get/Set Methods</H3>
<tt>box-&gt;box(FL_UP_BOX)</tt> sets the type of box the
Fl_Box draws, changing it from the default of <tt>FL_NO_BOX</tt>, which means <P><tt>box-&gt;box(FL_UP_BOX)</tt> sets the type of box the
that no box is drawn. In our &quot;Hello, World!&quot; example we use <TT> Fl_Box draws, changing it from the default of
FL_UP_BOX</TT>, which means that a raised button border will be drawn <tt>FL_NO_BOX</tt>, which means that no box is drawn. In our
around the widget. You can learn more about boxtypes in <A href="common.html#boytypes"> &quot;Hello, World!&quot; example we use <TT>FL_UP_BOX</TT>,
Chapter 3</A>. which means that a raised button border will be drawn around
<p>You could examine the boxtype in by doing the widget. You can learn more about boxtypes in
<tt>box->box()</tt>. Fltk uses method name overloading to make <A href="common.html#boytypes">Chapter 3</A>.</P>
short names for get/set methods. A "set" method is always of the form
"void&nbsp;name(type)", and a "get" method is always of the form <P>You could examine the boxtype in by doing
"type&nbsp;name()&nbsp;const". <tt>box->box()</tt>. FLTK uses method name overloading to make
short names for get/set methods. A "set" method is always of
the form "void&nbsp;name(type)", and a "get" method is always
of the form "type&nbsp;name()&nbsp;const".</P>
<H3>Redrawing After Changing Attributes</H3> <H3>Redrawing After Changing Attributes</H3>
<p>Almost all of the set/get pairs are very fast, short inline
functions and thus very efficient. However, <i>the "set" methods do <P>Almost all of the set/get pairs are very fast, short inline
not call <TT>redraw()</TT></i> - you have to call it yourself. This greatly functions and thus very efficient. However, <i>the "set"
reduces code size and execution time. The only common exception is methods do not call <TT>redraw()</TT></i> - you have to call it
<tt>value()</tt> which calls <TT>redraw()</TT> if necessary. yourself. This greatly reduces code size and execution time.
The only common exception is <tt>value()</tt> which calls
<TT>redraw()</TT> if necessary.</P>
<H3>Labels</H3> <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.html#Fl_Widget.labelfont> <P>All widgets support labels. In the case of window widgets,
<TT>labelfont</TT></A>, <A href=Fl_Widget.html#Fl_Widget.labelsize><TT> the label is used for the label in the title bar. Our example
labelsize</TT></A>, and <A href=Fl_Widget.html#Fl_Widget.labeltype><TT> program calls the <A href=Fl_Widget.html#Fl_Widget.labelfont>
labeltype</TT></A> methods. <TT>labelfont</TT></A>,
<P>The <TT>labelfont</TT> method sets the typeface and style that is <A href=Fl_Widget.html#Fl_Widget.labelsize><TT> labelsize</TT></A>,
used for the label, which for this example we are using <TT>FL_BOLD</TT> and <A href=Fl_Widget.html#Fl_Widget.labeltype><TT>labeltype</TT></A>
and <TT>FL_ITALIC</TT>. You can also specify typefaces directly. </P> methods.</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 <P>The <TT>labelfont</TT> method sets the typeface and style
normal, embossed, shadowed, symbol, and image labels internally, and that is used for the label, which for this example we are using
more types can be added as desired. </P> <TT>FL_BOLD</TT> and <TT>FL_ITALIC</TT>. You can also specify
<P>A complete list of all label options can be found in <A href=common.html#labels> typefaces directly. </P> <P>The <TT>labelsize</TT> method sets
Chapter 3</A>. </P> the height of the font in pixels. </P> <P>The <TT>labeltype</TT>
method sets the type of label. FLTK supports normal, embossed,
and shadowed labels internally, and more types can be added as
desired.</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> <H3>Showing the Window</H3>
The <TT>show()</TT> method shows the widget or window. For windows
<P>The <TT>show()</TT> method shows the widget or window. For windows
you can also provide the command-line arguments to allow users to you can also provide the command-line arguments to allow users to
customize the appearance, size, and position of your windows. customize the appearance, size, and position of your windows.</P>
<H3>The Main Event Loop</H3> <H3>The Main Event Loop</H3>
FLTK provides the <A href=functions.html#run><TT>Fl:run()</TT></A>
method to enter a standard event processing loop. This is equivalent <P>All FLTK applications (and most GUI applications in general)
to the following code: are based on a simple event processing model. User actions such
<UL> as mouse movement, button clicks, and keyboard activity generate
<PRE> events that are sent to an application. The application may then
ignore the events or respond to the user, typically by redrawing
a button in the "down" position, adding the text to an input
field, and so forth.</P>
<P>FLTK also supports idle, timer, and file pseudo-events that
cause a function to be called when they occur. Idle functions
are called when no user input is present and no timers or files
need to be handled - in short, when the application is not doing
anything. Idle callbacks are often used to update a 3D display
or do other background processing.</P>
<P>Timer functions are called after a specific amount of time
has expired. They can be used to pop up a progress dialog after
a certain amount of time or do other things that need to happen
at more-or-less regular intervals. FLTK timers are not 100%
accurate, so they should not be used to measure time intervals,
for example.</P>
<P>File functions are called when data is ready to read or
write, or when an error condition occurs on a file. They are
most often used to monitor network connections (sockets) for
data-driven displays.</P>
<P>FLTK applications must periodically check
(<TT>Fl::check()</TT>) or wait (<TT>Fl::wait()</TT>) for events
or use the <A href="functions.html#run"><TT>Fl:run()</TT></A>
method to enter a standard event processing loop. Calling
<TT>Fl::run()</TT> is equivalent to the following code:</P>
<UL><PRE>
while (Fl::wait()); while (Fl::wait());
</PRE> </PRE></UL>
<P><TT>Fl::run()</TT> does not return until all of the windows
under FLTK control are closed by the user or your program.</P>
<H2>Compiling Programs with Standard Compilers</H2>
<P>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:</P>
<UL><PRE>
CC -I/usr/local/include ...
gcc -I/usr/local/include ...
</PRE></UL>
<P>The <TT>fltk-config</TT> script included with FLTK can be
used to get the options that are required by your compiler:</P>
<UL><PRE>
CC `fltk-config --cxxflags` ...
</PRE></UL>
<P>Similarly, when linking your application you will need to tell the
compiler to use the FLTK library:</P>
<UL><PRE>
CC ... -L/usr/local/lib -lfltk -lXext -lX11 -lm
gcc ... -L/usr/local/lib -lfltk -lXext -lX11 -lm
</PRE></UL>
<P>The <TT>fltk-config</TT> script included with FLTK can be
used to get the options that are required by your linker:</P>
<UL><PRE>
CC ... `fltk-config --ldflags`
</PRE></UL>
<H2>Compiling Programs with Microsoft Visual C++</H2>
<P>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. You will also need to add the FLTK and
WinSock (WSOCK32.LIB) libraries to the &quot;Link&quot;
settings.</P>
<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++ 5.0 optimizer is known to cause problems with
many programs. We only recommend using the &quot;Favor Small Code&quot;
optimization setting.</I> The Visual C++ 6.0 optimizer seems to be much
better and can be used with the "optimized for speed" setting.</P>
<H2>Naming</H2>
<P>All public symbols in FLTK start with the characters 'F' and 'L':</P>
<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">Constants and
enumerations</A> are uppercase: <TT>FL_FOO</TT>.</LI>
<LI>All header files start with <TT>&lt;FL/...&gt;</TT>.
</LI>
</UL> </UL>
<TT>Fl::run()</TT> does not return until all of the windows under FLTK
control are closed by the user or your program. <H2>Header Files</H2>
<P>The proper way to include FLTK header files is:</P>
<UL><PRE>
#include &lt;FL/Fl_xyz.H&gt;
</PRE></UL>
<P><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. <i>Do not
use any of the following include lines:</i></P>
<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>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -1,326 +1,515 @@
<HTML><BODY> <HTML>
<BODY>
<H1 ALIGN=RIGHT><A NAME=common>3 - Common Widgets and Attributes</A></H1> <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. <P>This chapter describes many of the widgets that are provided
with FLTK and covers how to query and set the standard
attributes.</P>
<H2>Buttons</H2> <H2>Buttons</H2>
FLTK provides many types of buttons:
<P>FLTK provides many types of buttons:</P>
<UL> <UL>
<LI><A HREF="Fl_Button.html"><TT>Fl_Button</TT></A> - A standard push button. </LI>
<LI><A HREF="Fl_Check_Button.html"><TT>Fl_Check_Button</TT></A> - A button with a check box. </LI> <LI><A HREF="Fl_Button.html"><TT>Fl_Button</TT></A> - A
<LI><A HREF="Fl_Light_Button.html"><TT>Fl_Light_Button</TT></A> - A push button with a light. </LI> standard push button.</LI>
<LI><A HREF="Fl_Repeat_Button.html"><TT>Fl_Repeat_Button</TT></A> - A push button that repeats when held. </LI>
<LI><A HREF="Fl_Return_Button.html"><TT>Fl_Return_Button</TT></A> - A push button that is activated by the <LI><A HREF="Fl_Check_Button.html"><TT>Fl_Check_Button</TT></A> -
Enter key. </LI> A button with a check box.</LI>
<LI><A HREF="Fl_Round_Button.html"><TT>Fl_Round_Button</TT></A> - A button with a check circle. </LI>
<LI><A HREF="Fl_Light_Button.html"><TT>Fl_Light_Button</TT></A> -
A push button with a light.</LI>
<LI><A HREF="Fl_Repeat_Button.html"><TT>Fl_Repeat_Button</TT></A> -
A push button that repeats when held.</LI>
<LI><A HREF="Fl_Return_Button.html"><TT>Fl_Return_Button</TT></A> -
A push button that is activated by the <KBD>Enter</KBD> key.</LI>
<LI><A HREF="Fl_Round_Button.html"><TT>Fl_Round_Button</TT></A> -
A button with a radio circle.</LI>
</UL> </UL>
<P ALIGN=CENTER><IMG SRC="buttons.gif" ALT="FLTK Buttons">
<P>For all of these buttons you just need to include the corresponding <TT> <P ALIGN="CENTER"><IMG SRC="buttons.gif" ALT="FLTK Buttons"><BR>
&lt;FL/Fl_xyz_Button.H&gt;</TT> header file. The constructor takes the Figure 3-1: FLTK Button Widgets</P>
bounding box of the button and optionally a label string:
<UL> <P>All of these buttons just need the corresponding
<PRE> <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:</P>
<UL><PRE>
Fl_Button *button = new Fl_Button(x, y, width, height, &quot;label&quot;); 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_Light_Button *lbutton = new Fl_Light_Button(x, y, width, height);
Fl_Round_Button *rbutton = new Fl_Round_Button(x, y, width, height, &quot;label&quot;); Fl_Round_Button *rbutton = new Fl_Round_Button(x, y, width, height, &quot;label&quot;);
</PRE> </PRE></UL>
</UL>
Each button has an associated <A href=Fl_Button.html#Fl_Button.type><TT> <P>Each button has an associated
type()</TT></A> which allows it to behave as a push button, toggle <A href="Fl_Button.html#Fl_Button.type"><TT>type()</TT></A>
button, or radio button: which allows it to behave as a push button, toggle button, or
<UL> radio button:</P>
<PRE>
button-&gt;type(0); <UL><PRE>
button-&gt;type(FL_NORMAL_BUTTON);
lbutton-&gt;type(FL_TOGGLE_BUTTON); lbutton-&gt;type(FL_TOGGLE_BUTTON);
rbutton-&gt;type(FL_RADIO_BUTTON); rbutton-&gt;type(FL_RADIO_BUTTON);
</PRE> </PRE></UL>
</UL>
For toggle and radio buttons, the <A href=Fl_Button.html#Fl_Button.value> <P>For toggle and radio buttons, the
<TT>value()</TT></A> method returns the current button state (0 = off, <A href="Fl_Button.html#Fl_Button.value"><TT>value()</TT></A>
1 = on). The <A href="Fl_Button.html#Fl_Button.set"><TT>set()</TT></A> and <A href="Fl_Button.html#Fl_Button.clear"> method returns the current button state (0 = off, 1 = on). The
<TT>clear()</TT></A> methods can be used on toggle buttons to turn a <A href="Fl_Button.html#Fl_Button.set"><TT>set()</TT></A> and
toggle button on or off, respectively. Radio buttons can be turned on <A href="Fl_Button.html#Fl_Button.clear"><TT>clear()</TT></A>
with the <A href="Fl_Button.html#Fl_Button.setonly"><TT>setonly()</TT></A> method; this methods can be used on toggle buttons to turn a toggle button
will also turn off other radio buttons in the same group. on or off, respectively. Radio buttons can be turned on with
the
<A href="Fl_Button.html#Fl_Button.setonly"><TT>setonly()</TT></A>
method; this will also turn off other radio buttons in the same
group.</P>
<H2>Text</H2> <H2>Text</H2>
FLTK provides several text widgets for displaying and receiving text:
<P>FLTK provides several text widgets for displaying and receiving text:</P>
<UL> <UL>
<LI><A HREF="Fl_Input.html"><TT>Fl_Input</TT></A> - A standard one-line text input field. </LI>
<LI><A HREF="Fl_Output.html"><TT>Fl_Output</TT></A> - A standard one-line text output field. </LI> <LI><A HREF="Fl_Input.html"><TT>Fl_Input</TT></A> - A
<LI><A HREF="Fl_Multiline_Input.html"><TT>Fl_Multiline_Input</TT></A> - A standard multi-line text input one-line text input field.</LI>
field. </LI>
<LI><A HREF="Fl_Multiline_Output.html"><TT>Fl_Multiline_Output</TT></A> - A standard multi-line text output <LI><A HREF="Fl_Output.html"><TT>Fl_Output</TT></A> - A
field. </LI> one-line text output field.</LI>
<LI><A HREF="Fl_Multiline_Input.html"><TT>Fl_Multiline_Input</TT></A>
- A multi-line text input field. </LI>
<LI><A HREF="Fl_Multiline_Output.html"><TT>Fl_Multiline_Output</TT></A>
- A multi-line text output field.</LI>
<LI><A HREF="Fl_Text_Display.html"><TT>Fl_Text_Display</TT></A>
- A multi-line text display widget.</LI>
<LI><A HREF="Fl_Text_Editor.html"><TT>Fl_Text_Editor</TT></A> -
A multi-line text editing widget. </LI>
<LI><A HREF="Fl_Help_View.html"><TT>Fl_Help_View</TT></A> - A
HTML text display widget.</LI>
</UL> </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 <TT>Fl_Output</TT> and <TT>Fl_Multiline_Output</TT>
<P>The <A href=Fl_Input.html#Fl_Input.value><TT>value()</TT></A> method widgets allow the user to copy text from the output field but
is used to get or set the string that is displayed: </P> not change it.</P>
<UL>
<PRE> <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;); 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;); input-&gt;value(&quot;Now is the time for all good men...&quot;);
</PRE> </PRE></UL>
</UL>
<p>The string is copied to the widget's own storage when you set the <P>The string is copied to the widget's own storage when you set
<tt>value()</tt> of the widget. the <tt>value()</tt> of the widget.</P>
<P>The <TT>Fl_Text_Display</TT> and <TT>Fl_Text_Editor</TT>
widgets use an associated <TT>Fl_Text_Buffer</TT> class for the
value, instead of a simple string.</P>
<H2>Valuators</H2> <H2>Valuators</H2>
Unlike text widgets, valuators keep track of numbers instead of
strings. FLTK provides the following valuators: <P>Unlike text widgets, valuators keep track of numbers instead of
strings. FLTK provides the following valuators:</P>
<UL> <UL>
<LI><A HREF="Fl_Counter.html"><TT>Fl_Counter</TT></A> - A widget with arrow buttons that shows the
<LI><A HREF="Fl_Counter.html"><TT>Fl_Counter</TT></A> - A widget with arrow buttons that shows the
current value. </LI> current value. </LI>
<LI><A HREF="Fl_Dial.html"><TT>Fl_Dial</TT></A> - A round knob. </LI>
<LI><A HREF="Fl_Roller.html"><TT>Fl_Roller</TT></A> - An SGI-like dolly widget. </LI> <LI><A HREF="Fl_Dial.html"><TT>Fl_Dial</TT></A> - A round knob. </LI>
<LI><A HREF="Fl_Scrollbar.html"><TT>Fl_Scrollbar</TT></A> - A standard scrollbar widget. </LI>
<LI><A HREF="Fl_Slider.html"><TT>Fl_Slider</TT></A> - A scrollbar with a knob. </LI> <LI><A HREF="Fl_Roller.html"><TT>Fl_Roller</TT></A> - An SGI-like dolly widget. </LI>
<LI><A HREF="Fl_Value_Slider.html"><TT>Fl_Value_Slider</TT></A> - A slider that shows the current value. </LI>
<LI><A HREF="Fl_Scrollbar.html"><TT>Fl_Scrollbar</TT></A> - A standard scrollbar widget. </LI>
<LI><A HREF="Fl_Slider.html"><TT>Fl_Slider</TT></A> - A scrollbar with a knob. </LI>
<LI><A HREF="Fl_Value_Slider.html"><TT>Fl_Value_Slider</TT></A> - A slider that shows the current value. </LI>
</UL> </UL>
<P ALIGN=CENTER><IMG SRC="valuators.gif" ALT="FLTK Valuators"></P>
The <A href=Fl_Valuator.html#Fl_Valuator.value><TT>value()</TT></A> <P ALIGN="CENTER"><IMG SRC="valuators.gif" ALT="FLTK Valuators"><BR>
method gets and sets the current value of the widget. The <A href=Fl_Valuator.html#Fl_Valuator.minimum> <I>Figure 3-2: FLTK valuator widgets</I></P>
<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 <P>The <A href="Fl_Valuator.html#Fl_Valuator.value"><TT>value()</TT></A>
the widget. 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.</P>
<H2>Groups</H2> <H2>Groups</H2>
The <TT>Fl_Group</TT> widget class is used as a general purpose
&quot;container&quot; widget. Besides grouping radio buttons, the groups are <P>The <TT>Fl_Group</TT> widget class is used as a general
used to encapsulate windows, tabs, and scrolled windows. The following purpose &quot;container&quot; widget. Besides grouping radio
group classes are available with FLTK: buttons, the groups are used to encapsulate windows, tabs, and
scrolled windows. The following group classes are available
with FLTK:</P>
<UL> <UL>
<LI><A HREF="Fl_Double_Window.html"><TT>Fl_Double_Window</TT></A> - A double-buffered window on the screen. </LI>
<LI><A HREF="Fl_Gl_Window.html"><TT>Fl_Gl_Window</TT></A> - An OpenGL window on the screen. </LI> <LI><A HREF="Fl_Double_Window.html"><TT>Fl_Double_Window</TT></A> - A double-buffered window on the screen. </LI>
<LI><A HREF="Fl_Group.html"><TT>Fl_Group</TT></A> - The base container class; can be used to group
any widgets together. </LI> <LI><A HREF="Fl_Gl_Window.html"><TT>Fl_Gl_Window</TT></A> - An OpenGL window on the screen. </LI>
<LI><A HREF="Fl_Scroll.html"><TT>Fl_Scroll</TT></A> - A scrolled window area. </LI>
<LI><A HREF="Fl_Tabs.html"><TT>Fl_Tabs</TT></A> - Displays child widgets as tabs. </LI> <LI><A HREF="Fl_Group.html"><TT>Fl_Group</TT></A> - The base container class; can be used to group
<LI><A HREF="Fl_Window.html"><TT>Fl_Window</TT></A> - A window on the screen. </LI> any widgets together. </LI>
<LI><A HREF="Fl_Packed.html"><TT>Fl_Pack</TT></A> - A collection of widgets that are packed into the group area.</LI>
<LI><A HREF="Fl_Scroll.html"><TT>Fl_Scroll</TT></A> - A scrolled window area. </LI>
<LI><A HREF="Fl_Tabs.html"><TT>Fl_Tabs</TT></A> - Displays child widgets as tabs. </LI>
<LI><A HREF="Fl_Tile.html"><TT>Fl_Tile</TT></A> - A tiled window area.</LI>
<LI><A HREF="Fl_Window.html"><TT>Fl_Window</TT></A> - A window on the screen. </LI>
</UL> </UL>
<H2>Setting the Size and Position of Widgets</H2> <H2>Setting the Size and Position of Widgets</H2>
The size and position of widgets is usually set when you create them.
You can access them with the <tt>x()</tt>, <tt>y()</tt>, <tt>w()</tt>, <P>The size and position of widgets is usually set when you
and <tt>h()</tt> methods. create them. You can access them with the <tt>x()</tt>,
<p>You can change the size and position by using the <TT>position()</TT>, <TT> <tt>y()</tt>, <tt>w()</tt>, and <tt>h()</tt> methods.</P>
resize()</TT>, and <TT>size()</TT> methods:
<UL> <P>You can change the size and position by using the
<PRE> <TT>position()</TT>, <TT> resize()</TT>, and <TT>size()</TT>
methods:</P>
<UL><PRE>
button-&gt;position(x, y); button-&gt;position(x, y);
group-&gt;resize(x, y, width, height); group-&gt;resize(x, y, width, height);
window-&gt;size(width, height); window-&gt;size(width, height);
</PRE> </PRE></UL>
</UL>
If you change a widget's size or position after it is displayed you <P>If you change a widget's size or position after it is
will have to call <tt>redraw()</tt> on the widget's parent. displayed you will have to call <tt>redraw()</tt> on the
<H2><A NAME=colors>Colors</A></H2> widget's parent.</P>
FLTK stores the colors of widgets as an 8-bit number that is an index
into a color palette of 256 colors. This is <i>not</i> the X or WIN32 <H2><A NAME="colors">Colors</A></H2>
colormap, but instead is an internal table with fixed contents.
<p>There are symbols for naming some of the more common colors: <P>FLTK stores the colors of widgets as an 32-bit unsigned
number that is either an index into a color palette of 256
colors or a 24-bit RGB color. The color palette is <i>not</i>
the X or WIN32 colormap, but instead is an internal table with
fixed contents.</P>
<P>There are symbols for naming some of the more common colors:</P>
<UL> <UL>
<LI><TT>FL_BLACK</TT> (this is the default label color)</LI> <LI><TT>FL_BLACK</TT> (this is the default label color)</LI>
<LI><TT>FL_RED</TT></LI>
<LI><TT>FL_GREEN</TT></LI> <LI><TT>FL_RED</TT></LI>
<LI><TT>FL_YELLOW</TT></LI>
<LI><TT>FL_BLUE</TT></LI> <LI><TT>FL_GREEN</TT></LI>
<LI><TT>FL_MAGENTA</TT></LI>
<LI><TT>FL_CYAN</TT></LI> <LI><TT>FL_YELLOW</TT></LI>
<LI><TT>FL_WHITE</TT> (this is the default background color of text widgets)</LI>
<LI><TT>FL_GRAY</TT> (this is the default background color of most widgets)</LI> <LI><TT>FL_BLUE</TT></LI>
<LI><TT>FL_MAGENTA</TT></LI>
<LI><TT>FL_CYAN</TT></LI>
<LI><TT>FL_WHITE</TT> (this is the default background color of text widgets)</LI>
<LI><TT>FL_GRAY</TT> (this is the default background color of most widgets)</LI>
</UL> </UL>
The widget color can be set using the <TT>color()</TT> method:
<UL> <P>RGB colors can be set using the <A HREF="drawing.html#fl_rgb_color"><TT>fl_rgb_color()</TT></A>
<PRE> function:</P>
<UL><PRE>
Fl_Color c = fl_rgb_color(85, 170, 255);
</PRE></UL>
<P>The widget color is set using the <TT>color()</TT> method:</P>
<UL><PRE>
button-&gt;color(FL_RED); button-&gt;color(FL_RED);
</PRE> </PRE></UL>
</UL>
Similarly, the label color can be set using the <TT>labelcolor()</TT> <P>Similarly, the label color is set using the <TT>labelcolor()</TT>
method: method:</P>
<UL>
<PRE> <UL><PRE>
button-&gt;labelcolor(FL_WHITE); button-&gt;labelcolor(FL_WHITE);
</PRE> </PRE></UL>
</UL>
<H2><A NAME=boxtypes>Box Types</A></H2> <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> <P>The type <TT>Fl_Boxtype</TT> stored and returned in
<TT>&lt;Enumerations.H&gt;</TT></A>: <A href="Fl_Widget.html#Fl_Widget.box"><TT>Fl_Widget::box()</TT></A>
<P ALIGN=CENTER><IMG src="boxtypes.gif" ALT="FLTK Box Types"></P> is an enumeration defined in <A href="enumerations.html#enumerations"><TT>&lt;Enumerations.H&gt;</TT></A>.
Figure 3-3 shows the standard box types included with FLTK.</P>
<P ALIGN="CENTER"><IMG src="boxtypes.gif" ALT="FLTK Box Types"><BR>
<I>Figure 3-3: FLTK box types</I></P>
<P><TT>FL_NO_BOX</TT> means nothing is drawn at all, so whatever is <P><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 already on the screen remains. The <TT>FL_..._FRAME</TT> types only
draw their edges, leaving the interior unchanged. In the above diagram draw their edges, leaving the interior unchanged. The blue color in
the blue color is the area that is not drawn by the box. </P> Figure 3-3 is the area that is not drawn by the frame types.</P>
<H3>Making your own Boxtypes</H3>
<i>Warning: this interface may change in future versions of fltk!</i> <H3>Making Your Own Boxtypes</H3>
<p>You can define your own boxtypes by making a small function that draws
the box and adding it to the table of boxtypes. <P>You can define your own boxtypes by making a small function that draws
the box and adding it to the table of boxtypes.</P>
<CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc">
<TR>
<TD><B>Note:</B>
<P>This interface has changed in FLTK 2.0!</P>
</TD>
</TR>
</TABLE></CENTER>
<H4>The Drawing Function</H4> <H4>The Drawing Function</H4>
The drawing function is passed the bounding box and background color
for the widget: <P>The drawing function is passed the bounding box and background color
<UL> for the widget:</P>
<PRE>
<UL><PRE>
void xyz_draw(int x, int y, int w, int h, Fl_Color c) { void xyz_draw(int x, int y, int w, int h, Fl_Color c) {
... ...
} }
</PRE> </PRE></UL>
</UL>
A simple drawing function might fill a rectangle with the given color <P>A simple drawing function might fill a rectangle with the
and then draw a black outline: given color and then draw a black outline:</P>
<UL>
<PRE> <UL><PRE>
void xyz_draw(int x, int y, int w, int h, Fl_Color c) { void xyz_draw(int x, int y, int w, int h, Fl_Color c) {
fl_color(c); fl_color(c);
fl_rectf(x, y, w, h); fl_rectf(x, y, w, h);
fl_color(FL_BLACK); fl_color(FL_BLACK);
fl_rect(x, y, w, h); fl_rect(x, y, w, h);
} }
</PRE> </PRE></UL>
</UL>
<H4>Adding Your Box Type</H4> <H4>Adding Your Box Type</H4>
The <TT>Fl::set_boxtype()</TT> method adds or replaces the specified
box type: <P>The <TT>Fl::set_boxtype()</TT> method adds or replaces the
<UL> specified box type:</P>
<PRE>
<UL><PRE>
#define XYZ_BOX FL_FREE_BOXTYPE #define XYZ_BOX FL_FREE_BOXTYPE
Fl::set_boxtype(XYZ_BOX, xyz_draw, 1, 1, 2, 2); Fl::set_boxtype(XYZ_BOX, xyz_draw, 1, 1, 2, 2);
</PRE> </PRE></UL>
</UL>
The last 4 arguments to <TT>Fl::set_boxtype()</TT> are the offsets for <P>The last 4 arguments to <TT>Fl::set_boxtype()</TT> are the
the bounding box that should be subtracted when drawing the label offsets for the x, y, width, and height values that should be
inside the box. subtracted when drawing the label inside the box.</P>
<H2><A NAME=labels>Labels and Label Types</A></H2>
The <TT>label()</TT>, <TT>align()</TT>, <TT>labelfont()</TT>, <TT> <H2><A NAME="labels">Labels and Label Types</A></H2>
labelsize()</TT>, and <TT>labeltype()</TT> methods control the labeling
of widgets. <P>The <TT>label()</TT>, <TT>align()</TT>, <TT>labelfont()</TT>,
<TT>labelsize()</TT>, <TT>labeltype()</TT>, <TT>image()</TT>, and
<TT>deimage()</TT> methods control the labeling of widgets.</P>
<H3>label()</H3> <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 <P>The <TT>label()</TT> method sets the string that is displayed
string contains the actual symbol or image data. for the label. Symbols can be included with the label string by
escaping them using the "@" symbol - "@@" displays a single at
sign. Figure 3-4 shows the available symbols.</P>
<P ALIGN="CENTER"><IMG src="symbols.gif" ALT="FLTK Symbols"><BR>
<I>Figure 3-4: FLTK label symbols</I></P>
<P>The @ sign may also 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>
<H3>align()</H3> <H3>align()</H3>
The <TT>align()</TT> method positions the label. The following
constants are defined (they may be OR'd together as needed): <P>The <TT>align()</TT> method positions the label. The following
constants are defined and may be OR'd together as needed:</P>
<UL> <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_CENTER</TT> - center the label in the widget.</LI>
<LI><TT>FL_ALIGN_BOTTOM</TT> - align the label at the bottom of the
widget. </LI> <LI><TT>FL_ALIGN_TOP</TT> - align the label at the top 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 <LI><TT>FL_ALIGN_BOTTOM</TT> - align the label at the bottom of the
widget. </LI> 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 <LI><TT>FL_ALIGN_LEFT</TT> - align the label to the left of the widget.</LI>
box. </LI>
<LI><TT>FL_ALIGN_WRAP</TT> - wrap the label text as needed. </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>
<LI><TT>FL_TEXT_OVER_IMAGE</TT> - show the label text over the image.</LI>
<LI><TT>FL_IMAGE_OVER_TEXT</TT> - show the label image over the text (default).</LI>
</UL> </UL>
<H3><A NAME="labeltypes">labeltype()</A></H3> <H3><A NAME="labeltypes">labeltype()</A></H3>
The <TT>labeltype()</TT> method sets the type of the label. The
following standard label types are included: <P>The <TT>labeltype()</TT> method sets the type of the label. The
following standard label types are included:</P>
<UL> <UL>
<LI><TT>FL_NORMAL_LABEL</TT> - draws the text. </LI>
<LI><TT>FL_NO_LABEL</TT> - does nothing </LI> <LI><TT>FL_NORMAL_LABEL</TT> - draws the text.</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_NO_LABEL</TT> - does nothing.</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 <LI><TT>FL_SHADOW_LABEL</TT> - draws a drop shadow under
engraved </LI> the text.</LI>
<LI><TT>FL_EMBOSSED_LABEL</TT> - draws edges as thought the text is
raised </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>
<LI><TT>FL_ICON_LABEL</TT> - draws the icon associated
with the text.</LI>
</UL> </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> <H3>image() and deimage()</H3>
</A> objects.
<P>The <TT>image()</TT> and <TT>deimage()</TT> methods set an image that
will be displayed with the widget. The <TT>deimage()</TT> method sets the
image that is shown when the widget is inactive, while the <TT>image()</TT>
method sets the image that is shown when the widget is active.</P>
<P>To make an image you use a subclass of
<A HREF="drawing.html#Fl_Image"><TT>Fl_Image</TT></A>.</P>
<H4>Making Your Own Label Types</H4> <H4>Making Your Own Label Types</H4>
<i>Warning: this interface is changing in FLTK 2.0!</i>
<p>Label types are actually indexes into a table of functions that draw <P>Label types are actually indexes into a table of functions
them. The primary purpose of this is to let you reuse the <TT>label()</TT> that draw them. The primary purpose of this is to use this to
pointer as a pointer to arbitrary data such as a bitmap or pixmap. You draw the labels in ways inaccessible through the
can also use this to draw the labels in ways inaccessible through the <TT> <TT>fl_font</TT> mechanisim (e.g. <TT>FL_ENGRAVED_LABEL</TT>) or
fl_font</TT> mechanisim (e.g. <TT>FL_ENGRAVED_LABEL</TT>) or with with program-generated letters or symbology.</P>
program-generated letters or symbology.
<CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc">
<TR>
<TD><B>Note:</B>
<P>This interface has changed in FLTK 2.0!</P>
</TD>
</TR>
</TABLE></CENTER>
<H5>Label Type Functions</H5> <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 <P>To setup your own label type you will need to write two
to a <TT>Fl_Label</TT> structure containing the functions: one to draw and one to measure the label. The draw
label information, the bounding box for the label, and the label function is called with a pointer to a <TT>Fl_Label</TT>
alignment: structure containing the label information, the bounding box for
<UL> the label, and the label alignment:</P>
<PRE>
<UL><PRE>
void xyz_draw(Fl_Label *label, int x, int y, int w, int h, Fl_Align align) { void xyz_draw(Fl_Label *label, int x, int y, int w, int h, Fl_Align align) {
... ...
} }
</PRE> </PRE></UL>
</UL>
The label should be drawn <I>inside</I> this bounding box, even if <TT> <P>The label should be drawn <I>inside</I> this bounding box,
FL_ALIGN_INSIDE</TT> is not enabled. The function is not called if the even if <TT>FL_ALIGN_INSIDE</TT> is not enabled. The function
label value is <TT>NULL</TT>. is not called if the label value is <TT>NULL</TT>.</P>
<P>The measure function is called with a pointer to a <TT>Fl_Label</TT>
structure and references to the width and height: </P> <P>The measure function is called with a pointer to a
<UL> <TT>Fl_Label</TT> structure and references to the width and
<PRE> height:</P>
<UL><PRE>
void xyz_measure(Fl_Label *label, int &amp;w, int &amp;h) { void xyz_measure(Fl_Label *label, int &amp;w, int &amp;h) {
... ...
} }
</PRE> </PRE></UL>
</UL>
It should measure the size of the label and set <TT>w</TT> and <TT>h</TT> <P>The function should measure the size of the label and set
to the size it will occupy. <TT>w</TT> and <TT>h</TT> to the size it will occupy.</P>
<H5>Adding Your Label Type</H5> <H5>Adding Your Label Type</H5>
The <TT>Fl::set_labeltype</TT> method creates a label type using your
draw and measure functions: <P>The <TT>Fl::set_labeltype</TT> method creates a label type
<UL> using your draw and measure functions:</P>
<PRE>
<UL><PRE>
#define XYZ_LABEL FL_FREE_LABELTYPE #define XYZ_LABEL FL_FREE_LABELTYPE
Fl::set_labeltype(XYZ_LABEL, xyz_draw, xyz_measure); Fl::set_labeltype(XYZ_LABEL, xyz_draw, xyz_measure);
</PRE> </PRE></UL>
</UL>
The label type number <TT>n</TT> can be any integer value starting at <P>The label type number <TT>n</TT> can be any integer value
the constant <TT>FL_FREE_LABELTYPE</TT>. Once you have added the label starting at the constant <TT>FL_FREE_LABELTYPE</TT>. Once you
type you can use the <TT>labeltype()</TT> method to select your label have added the label type you can use the <TT>labeltype()</TT>
type. method to select your label type.</P>
<P>The <TT>Fl::set_labeltype</TT> method can also be used to overload <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> 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" ALT="FLTK Symbols"></CENTER>
<P>The @ sign may be followed by the following optional &quot;formatting&quot;
characters, in this order:
<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> <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 <P>Callbacks are functions that are called when the value of a
the widget that changed and optionally a pointer to data of some sort: widget changes. A callback function is sent a <TT>Fl_Widget</TT>
<UL> pointer of the widget that changed and a pointer to data that
<PRE> you provide:</P>
<UL><PRE>
void xyz_callback(Fl_Widget *w, void *data) { void xyz_callback(Fl_Widget *w, void *data) {
... ...
} }
</PRE> </PRE></UL>
</UL>
The <TT>callback()</TT> method sets the callback function for a <P>The <TT>callback()</TT> method sets the callback function for a
widget. You can optionally pass a pointer to some data needed for the widget. You can optionally pass a pointer to some data needed for the
callback: callback:</P>
<UL>
<PRE> <UL><PRE>
int xyz_data; int xyz_data;
button-&gt;callback(xyz_callback, data); button-&gt;callback(xyz_callback, &amp;xyz_data);
</PRE> </PRE></UL>
</UL>
Normally callbacks are performed only when the value of the widget <P>Normally callbacks are performed only when the value of the
changes. You can change this using the <A href=Fl_Widget.html#Fl_Widget.when> widget changes. You can change this using the
<TT>when()</TT></A> method: <A href="Fl_Widget.html#Fl_Widget.when"><TT>when()</TT></A>
<UL> method:</P>
<PRE>
<UL><PRE>
button-&gt;when(FL_WHEN_NEVER); button-&gt;when(FL_WHEN_NEVER);
button-&gt;when(FL_WHEN_CHANGED); button-&gt;when(FL_WHEN_CHANGED);
button-&gt;when(FL_WHEN_RELEASE); button-&gt;when(FL_WHEN_RELEASE);
@ -328,24 +517,60 @@ button-&gt;when(FL_WHEN_RELEASE_ALWAYS);
button-&gt;when(FL_WHEN_ENTER_KEY); button-&gt;when(FL_WHEN_ENTER_KEY);
button-&gt;when(FL_WHEN_ENTER_KEY_ALWAYS); button-&gt;when(FL_WHEN_ENTER_KEY_ALWAYS);
button-&gt;when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED); button-&gt;when(FL_WHEN_CHANGED | FL_WHEN_NOT_CHANGED);
</PRE> </PRE></UL>
</UL>
<CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" CELLSPACING="0" BGCOLOR="#cccccc">
<TR>
<TD><B>Hint:</B>
<P>Many programmers new to FLTK or C++ try to use a
non-static class method instead of a static class method
or function for their callback. Since callbacks are done
outside a C++ class, the <TT>this</TT> pointer is not
initialized for class methods.</P>
<P>To work around this problem, define a static method
in your class that accepts a pointer to the class, and
then have the static method call the class method(s) as
needed. The data pointer you provide to the
<TT>callback()</TT> method of the widget can be a
pointer to the instance of your class.</P>
<UL><PRE>
class foo {
void my_callback(Widget *);
static void my_static_callback(Widget *w, foo *f) { f->my_callback(w); }
...
}
...
w->callback(my_static_callback, this);
</PRE></UL>
</TD>
</TR>
</TABLE></CENTER>
<H2>Shortcuts</H2> <H2>Shortcuts</H2>
Shortcuts are key sequences that activate widgets (usually buttons or
menu items). The <TT>shortcut()</TT> method sets the shortcut for a <P>Shortcuts are key sequences that activate widgets such as
widget: buttons or menu items. The <TT>shortcut()</TT> method sets the
<UL> shortcut for a widget:</P>
<PRE>
<UL><PRE>
button-&gt;shortcut(FL_Enter); button-&gt;shortcut(FL_Enter);
button-&gt;shortcut(FL_SHIFT + 'b'); button-&gt;shortcut(FL_SHIFT + 'b');
button-&gt;shortcut(FL_CTRL + 'b'); button-&gt;shortcut(FL_CTRL + 'b');
button-&gt;shortcut(FL_ALT + 'b'); button-&gt;shortcut(FL_ALT + 'b');
button-&gt;shortcut(FL_CTRL + FL_ALT + 'b'); button-&gt;shortcut(FL_CTRL + FL_ALT + 'b');
button-&gt;shortcut(0); // no shortcut button-&gt;shortcut(0); // no shortcut
</PRE> </PRE></UL>
</UL>
The shortcut value is the key event value (the ASCII value or one of <P>The shortcut value is the key event value - the ASCII value
the special keys like <a or one of the special keys like
href="enumerations.html#key_values"><TT>FL_Enter</TT></a>) combined <a href="enumerations.html#key_values"><TT>FL_Enter</TT></a> -
with any modifiers (like shift, alt, and control). combined with any modifiers like <KBD>Shift</KBD>,
</BODY></HTML> <KBD>Alt</KBD>, and <KBD>Control</KBD>.</P>
</BODY>
</HTML>

View File

@ -1,25 +1,27 @@
<HTML> <HTML>
<BODY> <BODY>
<H1 ALIGN="RIGHT"><A NAME="intro">1 - Introduction to FLTK</A></H1> <H1 ALIGN="RIGHT"><A NAME="intro">1 - Introduction to FLTK</A></H1>
<P>The Fast Light Tool Kit (&quot;FLTK&quot;, pronounced <P>The Fast Light Tool Kit (&quot;FLTK&quot;, pronounced
&quot;fulltick&quot;) is a LGPL'd C++ graphical user interface &quot;fulltick&quot;) is a LGPL'd C++ graphical user interface
toolkit for X (UNIX&reg;), OpenGL&reg;, and Microsoft&reg; toolkit for X (UNIX&reg;), OpenGL&reg;, and Microsoft&reg;
Windows&reg; NT 4.0, 95, or 98. It was originally developed by Windows&reg;. Work is also underway to support FLTK under MacOS
Mr. Bill Spitzak and is currently maintained by a small group X. It was originally developed by Mr. Bill Spitzak and is
of developers across the world with a central repository in the currently maintained by a small group of developers across the
US.</P> world with a central repository in the US.</P>
<H2>History of FLTK</H2> <H2>History of FLTK</H2>
<P>It has always been Bill's belief that the GUI API of all modern <P>It has always been Bill's belief that the GUI API of all
systems is much too high level. Toolkits (even FL) are <I>not</I> what modern systems is much too high level. Toolkits (even FLTK) are
should be provided and documented as part of an operating system. The <I>not</I> what should be provided and documented as part of an
system only has to provide arbitrary shaped but featureless windows, a operating system. The system only has to provide arbitrary
powerful set of graphics drawing calls, and a simple <I>unalterable</I> shaped but featureless windows, a powerful set of graphics
method of delivering events to the owners of the windows. NeXT (if drawing calls, and a simple <I>unalterable</I> method of
you ignored NextStep) provided this, but they chose to hide it and delivering events to the owners of the windows. NeXT (if you
tried to push their own baroque toolkit instead...</P> ignored NextStep) provided this, but they chose to hide it and
tried to push their own baroque toolkit instead.</P>
<P>Many of the ideas in FLTK were developed on a NeXT (but <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 <I>not</I> using NextStep) in 1987 in a C toolkit Bill called
@ -36,8 +38,8 @@ even better and cleaner windowing system, and he reimplemented
&quot;views&quot; atop that. NeWS did have an unnecessarily &quot;views&quot; atop that. NeWS did have an unnecessarily
complex method of delivering events which hurt it. But the complex method of delivering events which hurt it. But the
designers did admit that perhaps the user could write just as designers did admit that perhaps the user could write just as
good of a button as they could, and officially exposed the good of a button as they could, and officially exposed the lower
lower level interface.</P> level interface.</P>
<P>With the death of NeWS Bill realized that he would have to <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 live with X. The biggest problem with X is the &quot;window
@ -101,8 +103,8 @@ is now included with several Linux distributions.</P>
performance.</LI> performance.</LI>
<LI>Precise low-level compatability between the X11 and <LI>Precise low-level compatability between the X11 and
WIN32 version (only about 10% of the code is WIN32 version - only about 10% of the code is
different).</LI> different.</LI>
<LI>Interactive user interface builder program. Output is <LI>Interactive user interface builder program. Output is
human-readable and editable C++ source code.</LI> human-readable and editable C++ source code.</LI>
@ -235,12 +237,21 @@ to &quot;bindir&quot;, the header files to
<H2>Building FLTK Under Microsoft Windows</H2> <H2>Building FLTK Under Microsoft Windows</H2>
<P>There are two ways to build FLTK under Microsoft Windows. <P>There are three ways to build FLTK under Microsoft Windows.
The first is to use the Visual C++ 5.0 project files under the The first is to use the Visual C++ 5.0 project files under the
&quot;visualc&quot; directory. Just open (or double-click on) &quot;visualc&quot; directory. Just open (or double-click on)
the &quot;fltk.dsw&quot; file to get the whole shebang.</P> the &quot;fltk.dsw&quot; file to get the whole shebang.</P>
<P>The second method is to use a GNU-based development tool with <P>The second method is to use the <TT>configure</TT> script
included with the FLTK software; this has only been tested with
the CygWin tools:</P>
<UL><PRE>
sh configure --prefix=C:/FLTK
make
</PRE></UL>
<P>The final method is to use a GNU-based development tool with
the files in the &quot;makefiles&quot; directory. To build the files in the &quot;makefiles&quot; directory. To build
using one of these tools simply copy the appropriate using one of these tools simply copy the appropriate
makeinclude and config files to the main directory and do a makeinclude and config files to the main directory and do a
@ -252,19 +263,23 @@ make
</PRE></UL> </PRE></UL>
<H3>Using the Visual C++ DLL Library</H3> <H3>Using the Visual C++ DLL Library</H3>
The &quot;fltkdll.dsp&quot; project file builds a DLL-version of the FLTK
library. Because of name mangling differences between PC compilers (even <P>The &quot;fltkdll.dsp&quot; project file builds a DLL-version
between different versions of Visual C++!) you can only use the DLL that of the FLTK library. Because of name mangling differences
is generated with the same version compiler that you built it with. between PC compilers (even between different versions of Visual
<P>When compiling an application or DLL that uses the FLTK DLL, you will need C++!) you can only use the DLL that is generated with the same
to define the <tt>FL_DLL</tt> preprocessor symbol to get the correct linkage version compiler that you built it with.</P>
commands embedded within the FLTK header files.
<P>When compiling an application or DLL that uses the FLTK DLL,
you will need to define the <tt>FL_DLL</tt> preprocessor symbol
to get the correct linkage commands embedded within the FLTK
header files.</P>
<H2>Building FLTK Under OS/2</H2> <H2>Building FLTK Under OS/2</H2>
The current OS/2 build requires XFree86 for OS/2 to work. A native <P>The current OS/2 build requires XFree86 for OS/2 to work. A
Presentation Manager version has not been implemented yet (volunteers native Presentation Manager version has not been implemented
are welcome!). yet (volunteers are welcome!).</P>
<p>The current set of Makefiles/configuration failes assumes that <p>The current set of Makefiles/configuration failes assumes that
EMX 0.9d and libExt EMX 0.9d and libExt
@ -274,18 +289,28 @@ is installed.
<P>To build the XFree86 version of FLTK for OS/2, copy the appropriate <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> makeinclude and config files to the main directory and do a make: </P>
<UL> <UL><PRE>
<PRE>
copy makefiles\Makefile.os2x Makefile copy makefiles\Makefile.os2x Makefile
make make
</PRE> </PRE></UL>
</UL>
<H2>Building FLTK Under MacOS X</H2>
<P>The current version of FLTK requires the XFree86 X server for
Darwin. Follow the instructions for building FLTK under
UNIX.</P>
<P>Future versions of FLTK will provide a Carbon-based window
interface, so XFree86 will no longer be required.</P>
<H2>Internet Resources</H2> <H2>Internet Resources</H2>
FLTK is available on the 'net in a bunch of locations:
<P>FLTK is available on the 'net in a bunch of locations:</P>
<DL> <DL>
<DT>WWW <DT>WWW
<DD><A href="http://www.fltk.org">http://www.fltk.org</A> <DD><A href="http://www.fltk.org/">http://www.fltk.org/</A>
<DT>FTP <DT>FTP
<DD><A HREF="ftp://ftp.fltk.org/pub/fltk">California, USA (ftp.fltk.org)</A> <DD><A HREF="ftp://ftp.fltk.org/pub/fltk">California, USA (ftp.fltk.org)</A>
@ -299,18 +324,35 @@ FLTK is available on the 'net in a bunch of locations:
instructions below] instructions below]
<DD><A href="mailto:fltk-bugs@fltk.org">fltk-bugs@fltk.org</A> [for <DD><A href="mailto:fltk-bugs@fltk.org">fltk-bugs@fltk.org</A> [for
reporting bugs] reporting bugs]
<DT>News</DT>
<DD><A HREF="news://news.easysw.com">news.easysw.com</A></DD>
</DL> </DL>
To send a message to the FLTK mailing list (&quot;fltk@fltk.org&quot;) you
must first join the list. Non-member submissions are blocked to avoid <P>To send a message to the FLTK mailing list
problems with unsolicited email. (&quot;fltk@fltk.org&quot;) you must first join the list.
Non-member submissions are blocked to avoid problems with
unsolicited email.</P>
<P>To join the FLTK mailing list, send a message to <P>To join the FLTK mailing list, send a message to
&quot;majordomo@fltk.org&quot; with &quot;subscribe fltk&quot; in the message body. A &quot;majordomo@fltk.org&quot; with &quot;subscribe fltk&quot;
digest of this list is available by subscribing to the &quot;fltk-digest&quot; in the message body. A digest of this list is available by
mailing list. </P> subscribing to the &quot;fltk-digest&quot; mailing list.</P>
<H2>Reporting Bugs</H2> <H2>Reporting Bugs</H2>
To report a bug in FLTK, send an email to &quot;fltk-bugs@fltk.org&quot;.
Please include the FLTK version, operating system &amp; version, and <P>To report a bug in FLTK, send an email to
compiler that you are using when describing the bug or problem. &quot;fltk-bugs@fltk.org&quot;. Please include the FLTK version,
operating system &amp; version, and compiler that you are using
when describing the bug or problem. We will be unable to provide
any kind of help without that basic information.</P>
<P>Bugs can also be reported to the "fltk.bugs" newsgroup or on the
SourceForge bug tracker pages.</P>
<P>For general support and questions, please use the FLTK mailing list <P>For general support and questions, please use the FLTK mailing list
at &quot;fltk@fltk.org&quot;. </P> at &quot;fltk@fltk.org&quot; or one of the newsgroups.</P>
</BODY></HTML>
</BODY>
</HTML>

View File

@ -56,7 +56,9 @@ interfaces.</P>
<LI><A HREF="license.html#license">Appendix F - Operating System Issues</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> <LI><A HREF="migration.html">Appendix G - Migrating from FLTK 1.0.x to FLTK 1.1.x</A></LI>
<LI><A HREF="license.html#license">Appendix H - Software License</A></LI>
</UL> </UL>

View File

@ -1,96 +0,0 @@
#
# "$Id: Makefile.cygwin,v 1.1.2.2 2001/01/22 15:13:39 easysw Exp $"
#
# Top-level makefile for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2001 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@fltk.org".
#
# By default use a Un*x-style shell
#
# uncomment next line to use NT command shell
# SHELL=cmd.exe
#
# or uncomment next line to explicitly use a unix-compatible shell
# SHELL=sh.exe
#
# If we are using a Un*x-based make, make sure the environmental var is set
# set MAKE_MODE=unix
#
# By default, a Un*x style make is assumed, so towards the bottom of this
# file filenames are copied with 'cp' and use forward slashes throughout
# in filepaths.
#
# Changing to a Windows-based command line would require 'cp' replaced with
# a local equivalent ('copy' is OK) and potentially for forward-slashes in
# filepaths to be replaced by back-slashes.
all: makeinclude config.h
echo "=== making src ==="
touch src/makedepend
cd src ; $(MAKE)
echo "=== making fluid ==="
touch fluid/makedepend
cd fluid ; $(MAKE)
echo "=== making test ==="
touch test/makedepend
cd test ; $(MAKE)
install:
echo "=== installing src ==="
touch src/makedepend
cd src ; $(MAKE) install
echo "=== installing fluid ==="
touch fluid/makedepend
cd fluid ; $(MAKE) install
depend:
echo "=== making src dependencies ==="
touch src/makedepend
cd src ; $(MAKE) depend
echo "=== making fluid dependencies ==="
touch fluid/makedepend
cd fluid ; $(MAKE) depend
echo "=== making test dependencies ==="
touch test/makedepend
cd test ; $(MAKE) depend
clean:
-@ rm -f core config.cache *.o *.bck
echo "=== cleaning src ==="
touch src/makedepend
cd src ; $(MAKE) clean
echo "=== cleaning fluid ==="
touch fluid/makedepend
cd fluid ; $(MAKE) clean
echo "=== cleaning test ==="
touch test/makedepend
cd test ; $(MAKE) clean
config.h: makefiles/config.cygwin
cp $< $@
makeinclude: makefiles/makeinclude.cygwin
cp $< $@
#
# End of "$Id: Makefile.cygwin,v 1.1.2.2 2001/01/22 15:13:39 easysw Exp $".
#

View File

@ -1,96 +0,0 @@
#
# "$Id: Makefile.no-cygwin,v 1.1.2.2 2001/01/22 15:13:39 easysw Exp $"
#
# Top-level makefile for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2001 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@fltk.org".
#
# By default use a Un*x-style shell
#
# uncomment next line to use NT command shell
# SHELL=cmd.exe
#
# or uncomment next line to explicitly use a unix-compatible shell
# SHELL=sh.exe
#
# If we are using a Un*x-based make, make sure the environmental var is set
# set MAKE_MODE=unix
#
# By default, a Un*x style make is assumed, so towards the bottom of this
# file filenames are copied with 'cp' and use forward slashes throughout
# in filepaths.
#
# Changing to a Windows-based command line would require 'cp' replaced with
# a local equivalent ('copy' is OK) and potentially for forward-slashes in
# filepaths to be replaced by back-slashes.
all: makeinclude config.h
echo "=== making src ==="
touch src/makedepend
cd src ; $(MAKE)
echo "=== making fluid ==="
touch fluid/makedepend
cd fluid ; $(MAKE)
echo "=== making test ==="
touch test/makedepend
cd test ; $(MAKE)
install:
echo "=== installing src ==="
touch src/makedepend
cd src ; $(MAKE) install
echo "=== installing fluid ==="
touch fluid/makedepend
cd fluid ; $(MAKE) install
depend:
echo "=== making src dependencies ==="
touch src/makedepend
cd src ; $(MAKE) depend
echo "=== making fluid dependencies ==="
touch fluid/makedepend
cd fluid ; $(MAKE) depend
echo "=== making test dependencies ==="
touch test/makedepend
cd test ; $(MAKE) depend
clean:
-@ rm -f core config.cache *.o *.bck
echo "=== cleaning src ==="
touch src/makedepend
cd src ; $(MAKE) clean
echo "=== cleaning fluid ==="
touch fluid/makedepend
cd fluid ; $(MAKE) clean
echo "=== cleaning test ==="
touch test/makedepend
cd test ; $(MAKE) clean
config.h: makefiles/config.no-cygwin
cp $< $@
makeinclude: makefiles/makeinclude.no-cygwin
cp $< $@
#
# End of "$Id: Makefile.no-cygwin,v 1.1.2.2 2001/01/22 15:13:39 easysw Exp $".
#

View File

@ -1,24 +0,0 @@
#!/bin/sh
#
# aixmakesharedlib - a simple script for AIX shared lib creation from a
# non shared library
#
# Notes:
# - Should work for both AIX 3.2.x & 4.1.x
# - Copies original (non shared) lib to be lib.NS
# - May require slight modifications for different uses (this was written
# with the FL library in mind)
#
/bin/rm -f shr.o syms.exp
# create the exports list:
echo "#!" > syms.exp
dump -g $1 | egrep -e '[ \t]*[0-9]+' | sed 's/^[ \t]*[0-9][0-9]*[ \t]*[^ \t]//' | sed 's/^\.//' | sort | uniq >> syms.exp
xlC -o shr.o $1 -bM:SRE -bE:syms.exp -bnoentry -lc -lm -lX11
mv $1 $1.NS
ar ruv $1 shr.o syms.exp
/bin/rm -f shr.o syms.exp

View File

@ -1,187 +0,0 @@
/*
* "$Id: config.cygwin,v 1.1.2.3.2.2 2001/10/19 14:04:08 easysw Exp $"
*
* Configuration file for the Fast Light Tool Kit (FLTK).
*
* Copyright 1998-2001 by Bill Spitzak and others.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "FLTK-bugs@fltk.org".
*/
/*
* Where to find the documentation files...
*/
#define FLTK_DOCDIR "C:/FLTK/DOC"
/*
* BORDER_WIDTH:
*
* Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are
* supported.
*
* 3 is the historic FLTK look.
* 2 is the default and looks like Microsoft Windows, KDE, and Qt.
* 1 is a plausible future evolution...
*
* Note that this may be simulated at runtime by redefining the boxtypes
* using Fl::set_boxtype().
*/
#define BORDER_WIDTH 2
/*
* HAVE_GL:
*
* Do you have OpenGL? Set this to 0 if you don't have or plan to use
* OpenGL, and FLTK will be smaller.
*
* In order to set to 1 you will need to obtain the OpenGL header and
* library files. Consult the README.win32 file for further details.
*/
#define HAVE_GL 0
/*
* USE_COLORMAP:
*
* Setting this to zero will save a good deal of code (especially for
* fl_draw_image), but FLTK will only work on TrueColor visuals.
*/
#define USE_COLORMAP 1
/*
* HAVE_XDBE:
*
* Do we have the X double-buffer extension?
*/
#define HAVE_XDBE 0
/*
* USE_XDBE:
*
* Actually try to use the double-buffer extension? Set this to zero
* disable use of XDBE without breaking the list_visuals program.
*/
#define USE_XDBE HAVE_XDBE
/*
* HAVE_OVERLAY:
*
* Use the X overlay extension? FLTK will try to use an overlay
* visual for Fl_Overlay_Window, the Gl_Window overlay, and for the
* menus. Setting this to zero will remove a substantial amount of
* code from FLTK. Overlays have only been tested on SGI servers!
*/
#define HAVE_OVERLAY 0
/*
* HAVE_GL_OVERLAY:
*
* It is possible your GL has an overlay even if X does not. If so,
* set this to 1.
*/
#define HAVE_GL_OVERLAY HAVE_OVERLAY
/*
* WORDS_BIGENDIAN:
*
* Byte order of your machine: 1 = big-endian, 0 = little-endian.
*/
#define WORDS_BIGENDIAN 0
/*
* U16, U32, U64:
*
* Types used by fl_draw_image. One of U32 or U64 must be defined.
* U16 is optional but FLTK will work better with it!
*/
#define U16 unsigned short
#define U32 unsigned
/* #undef U64 */
/*
* HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H, HAVE_SCANDIR:
*
* Where is <dirent.h> (used only by fl_file_chooser and scandir).
*/
#define HAVE_DIRENT_H 1
#define HAVE_SYS_NDIR_H 0
#define HAVE_SYS_DIR_H 0
#define HAVE_NDIR_H 0
#define HAVE_SCANDIR 1
/*
* Possibly missing sprintf-style functions:
*/
#define HAVE_VSNPRINTF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSPRINTF 1
/*
* String functions...
*/
#define HAVE_STRCASECMP 1
/*
* HAVE_SYS_SELECT_H:
*
* Whether or not select() call has its own header file.
*/
#define HAVE_SYS_SELECT_H 0
/*
* HAVE_POLL:
*
* Use poll() if we don't have select().
*/
#define HAVE_POLL 0
/*
* Do we have various image libraries?
*/
#undef HAVE_LIBPNG
#undef HAVE_LIBZ
#undef HAVE_LIBJPEG
/*
* Do we have the png_xyz() functions?
*/
#undef HAVE_PNG_GET_VALID
#undef HAVE_PNG_SET_TRNS_TO_ALPHA
#undef HAVE_PNG_READ_DESTROY
/*
* End of "$Id: config.cygwin,v 1.1.2.3.2.2 2001/10/19 14:04:08 easysw Exp $".
*/

View File

@ -1,187 +0,0 @@
/*
* "$Id: config.no-cygwin,v 1.1.2.3.2.2 2001/10/19 14:04:08 easysw Exp $"
*
* Configuration file for the Fast Light Tool Kit (FLTK).
*
* Copyright 1998-2001 by Bill Spitzak and others.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "FLTK-bugs@fltk.org".
*/
/*
* Where to find the documentation files...
*/
#define FLTK_DOCDIR "C:/FLTK/DOC"
/*
* BORDER_WIDTH:
*
* Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are
* supported.
*
* 3 is the historic FLTK look.
* 2 is the default and looks like Microsoft Windows, KDE, and Qt.
* 1 is a plausible future evolution...
*
* Note that this may be simulated at runtime by redefining the boxtypes
* using Fl::set_boxtype().
*/
#define BORDER_WIDTH 2
/*
* HAVE_GL:
*
* Do you have OpenGL? Set this to 0 if you don't have or plan to use
* OpenGL, and FLTK will be smaller.
*
* In order to set to 1 you will need to obtain the OpenGL header and
* library files. Consult the README.win32 file for further details.
*/
#define HAVE_GL 0
/*
* USE_COLORMAP:
*
* Setting this to zero will save a good deal of code (especially for
* fl_draw_image), but FLTK will only work on TrueColor visuals.
*/
#define USE_COLORMAP 1
/*
* HAVE_XDBE:
*
* Do we have the X double-buffer extension?
*/
#define HAVE_XDBE 0
/*
* USE_XDBE:
*
* Actually try to use the double-buffer extension? Set this to zero
* disable use of XDBE without breaking the list_visuals program.
*/
#define USE_XDBE HAVE_XDBE
/*
* HAVE_OVERLAY:
*
* Use the X overlay extension? FLTK will try to use an overlay
* visual for Fl_Overlay_Window, the Gl_Window overlay, and for the
* menus. Setting this to zero will remove a substantial amount of
* code from FLTK. Overlays have only been tested on SGI servers!
*/
#define HAVE_OVERLAY 0
/*
* HAVE_GL_OVERLAY:
*
* It is possible your GL has an overlay even if X does not. If so,
* set this to 1.
*/
#define HAVE_GL_OVERLAY HAVE_OVERLAY
/*
* WORDS_BIGENDIAN:
*
* Byte order of your machine: 1 = big-endian, 0 = little-endian.
*/
#define WORDS_BIGENDIAN 0
/*
* U16, U32, U64:
*
* Types used by fl_draw_image. One of U32 or U64 must be defined.
* U16 is optional but FLTK will work better with it!
*/
#define U16 unsigned short
#define U32 unsigned
/* #undef U64 */
/*
* HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H, HAVE_SCANDIR:
*
* Where is <dirent.h> (used only by fl_file_chooser and scandir).
*/
#define HAVE_DIRENT_H 1
#define HAVE_SYS_NDIR_H 0
#define HAVE_SYS_DIR_H 0
#define HAVE_NDIR_H 0
#define HAVE_SCANDIR 0
/*
* Possibly missing sprintf-style functions:
*/
#define HAVE_VSNPRINTF 0
#define HAVE_SNPRINTF 0
#define HAVE_VSPRINTF 0
/*
* String functions...
*/
#define HAVE_STRCASECMP 1
/*
* HAVE_SYS_SELECT_H:
*
* Whether or not select() call has its own header file.
*/
#define HAVE_SYS_SELECT_H 0
/*
* HAVE_POLL:
*
* Use poll() if we don't have select().
*/
#define HAVE_POLL 0
/*
* Do we have various image libraries?
*/
#undef HAVE_LIBPNG
#undef HAVE_LIBZ
#undef HAVE_LIBJPEG
/*
* Do we have the png_xyz() functions?
*/
#undef HAVE_PNG_GET_VALID
#undef HAVE_PNG_SET_TRNS_TO_ALPHA
#undef HAVE_PNG_READ_DESTROY
/*
* End of "$Id: config.no-cygwin,v 1.1.2.3.2.2 2001/10/19 14:04:08 easysw Exp $".
*/

View File

@ -1,100 +0,0 @@
#
# "$Id: makeinclude.cygwin,v 1.1.2.2.2.2 2001/10/27 03:33:25 easysw Exp $"
#
# Make include file for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2001 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@fltk.org".
#
# Notes:
#
# 1) Console windows appearing
#
# Consoles will not appear when run from a cygwin shell command line prompt
# but will cause an 'unnecessary' console to appear when run directly from
# windows (say explorer). It provides i/o for stdin/stdout for debugging
#
# To avoid this add "-mwindows" to LDLIBS and GLDLIBS below
#
# 2) Stripping the executable to reduce size
#
# An external program may be run to strip out any debug symbols:
# strip filename.exe
#
# Alternatively add -s option to LDLIBS and GLDLIBS below to strip all
# symbols. (or -S for stripping of debug symbols only). See 'ld' man page
# for other useful link-time options.
#
# The default is to leave -mwindows and the stripping off, so as to facilitate
# debugging. For release it may be appropriate to add these additional switches
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
includedir = ${prefix}/include
libdir = ${exec_prefix}/lib
srcdir = .
# compiler names:
CXX = g++
CC = gcc
# flags for C++ compiler:
CFLAGS = -Wall -O2 -DWIN32
CXXFLAGS = -Wall -O2 -DWIN32
# program to make the archive:
LIBNAME = ../lib/libfltk.a
GLLIBNAME = ../lib/libfltk_gl.a
LIBCOMMAND = ar -ruv
RANLIB = ranlib
RM = del
DSONAME =
DSOCOMMAND = echo
# libraries to link with (in addition to default libs):
LDLIBS = -lgdi32 -lwsock32
GLDLIBS = -lglu32 -lopengl32 -lgdi32 -lwsock32
LINKFLTK =-L../lib -lfltk
LINKFLTKGL =-L../lib -lfltk_gl
IMAGELIBS =
# Be quiet when building...
.SILENT:
# Build commands and filename extensions...
.SUFFIXES: .c .cxx .h .fl .o
.cxx:
echo Compiling and linking $@...
$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTK) $(LDLIBS) -o $@
.c.o:
echo Compiling $@...
$(CC) -I.. $(CXXFLAGS) $< -c
.cxx.o:
echo Compiling $@...
$(CXX) -I.. $(CXXFLAGS) $< -c
#
# End of "$Id: makeinclude.cygwin,v 1.1.2.2.2.2 2001/10/27 03:33:25 easysw Exp $".
#

View File

@ -1,100 +0,0 @@
#
# "$Id: makeinclude.no-cygwin,v 1.1.2.4.2.2 2001/10/27 03:33:25 easysw Exp $"
#
# Make include file for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2001 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@fltk.org".
#
# Notes:
#
# 1) Console windows appearing
#
# Consoles will not appear when run from a cygwin shell command line prompt
# but will cause an 'unnecessary' console to appear when run directly from
# windows (say explorer). It provides i/o for stdin/stdout for debugging
#
# To avoid this add "-mwindows" to LDLIBS and GLDLIBS below
#
# 2) Stripping the executable to reduce size
#
# An external program may be run to strip out any debug symbols:
# strip filename.exe
#
# Alternatively add -s option to LDLIBS and GLDLIBS below to strip all
# symbols. (or -S for stripping of debug symbols only). See 'ld' man page
# for other useful link-time options.
#
# The default is to leave -mwindows and the stripping off, so as to facilitate
# debugging. For release it may be appropriate to add these additional switches
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
includedir = ${prefix}/include
libdir = ${exec_prefix}/lib
srcdir = .
# compiler names:
CXX = g++ -mno-cygwin
CC = gcc -mno-cygwin
# flags for C++ compiler:
CFLAGS = -Wall -O2 -DWIN32
CXXFLAGS = -Wall -O2 -DWIN32
# program to make the archive:
LIBNAME = ../lib/libfltk.a
GLLIBNAME = ../lib/libfltk_gl.a
LIBCOMMAND = ar -ruv
RM = del
RANLIB = ranlib
DSONAME =
DSOCOMMAND = echo
# libraries to link with (in addition to default libs):
LDLIBS = -lgdi32 -lwsock32
GLDLIBS = -lglu32 -lopengl32 -lgdi32 -lwsock32
LINKFLTK =-L../lib -lfltk
LINKFLTKGL =-L../lib -lfltk_gl
IMAGELIBS =
# Be quiet when building...
.SILENT:
# Build commands and filename extensions...
.SUFFIXES: .c .cxx .h .fl .o
.cxx:
echo Compiling and linking $@...
$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTK) $(LDLIBS) -o $@
.c.o:
echo Compiling $@...
$(CC) -I.. $(CXXFLAGS) $< -c
.cxx.o:
echo Compiling $@...
$(CXX) -I.. $(CXXFLAGS) $< -c
#
# End of "$Id: makeinclude.no-cygwin,v 1.1.2.4.2.2 2001/10/27 03:33:25 easysw Exp $".
#