Changed PostScript output to Level 1 for maximum compatibility.

Fixed some more typos and formatting problems.


git-svn-id: file:///fltk/svn/fltk/trunk@415 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 1999-03-10 20:18:38 +00:00
parent ce193d0ec5
commit b5f85fd9d6
5 changed files with 211 additions and 183 deletions

View File

@ -47,10 +47,8 @@ enum { // values for flags:
}; };
</PRE> </PRE>
</UL> </UL>
Typically menu items are statically defined; for example: Typically menu items are statically defined; for example:
<TABLE> <UL><PRE>
<TR valign=top><TD><IMG align=left src=./menu.gif></TD><TD>
<PRE>
Fl_Menu_Item popup[] = { Fl_Menu_Item popup[] = {
{&quot;&amp;alpha&quot;, FL_ALT+'a', the_cb, (void*)1}, {&quot;&amp;alpha&quot;, FL_ALT+'a', the_cb, (void*)1},
{&quot;&amp;beta&quot;, FL_ALT+'b', the_cb, (void*)2}, {&quot;&amp;beta&quot;, FL_ALT+'b', the_cb, (void*)2},
@ -69,15 +67,16 @@ Fl_Menu_Item popup[] = {
{&quot;check&quot;, FL_ALT+'i', 0, 0, FL_MENU_TOGGLE|FL_MENU_VALUE}, {&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}, {&quot;box&quot;, FL_ALT+'i', 0, 0, FL_MENU_TOGGLE},
{0}}; {0}};
</PRE> </PRE></UL>
</TD></TR> produces:
</TABLE> <P ALIGN=CENTER><IMG src="menu.gif"></P>
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> A submenu title is identified by the bit <TT>FL_SUBMENU</TT> in the <TT>
. You can nest menus to any depth. A pointer to the first item in the 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 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> possible to make seperate submenu arrays with <TT>FL_SUBMENU_POINTER</TT>
flags. flags.
<P>You should use the method functions to access structure members and <P>You should use the method functions to access structure members and
not access them directly to avoid compatibility problems with future not access them directly to avoid compatibility problems with future
releases of FLTK. </P> releases of FLTK. </P>

View File

@ -1,5 +1,5 @@
# #
# "$Id: Makefile,v 1.8 1999/02/22 22:17:48 mike Exp $" # "$Id: Makefile,v 1.9 1999/03/10 20:18:37 mike Exp $"
# #
# Documentation makefile for the Fast Light Tool Kit (FLTK). # Documentation makefile for the Fast Light Tool Kit (FLTK).
# #
@ -134,7 +134,7 @@ fltk.d/index.html: $(HTMLFILES)
fltk.ps: $(HTMLFILES) fltk.ps: $(HTMLFILES)
@echo "Generating PostScript documentation..." @echo "Generating PostScript documentation..."
@$(HTMLDOC) -f fltk.ps --jpeg --duplex --verbose --toclevels 2 --title FL.gif $(HTMLFILES) @$(HTMLDOC) -f fltk.ps -t ps1 --duplex --verbose --toclevels 2 --title FL.gif $(HTMLFILES)
fltk.pdf: $(HTMLFILES) fltk.pdf: $(HTMLFILES)
@echo "Generating PDF documentation..." @echo "Generating PDF documentation..."
@ -142,5 +142,5 @@ fltk.pdf: $(HTMLFILES)
@$(HTMLDOC) -f fltk.pdf --jpeg --compression=9 --duplex --verbose --toclevels 2 --title FL.gif $(HTMLFILES) @$(HTMLDOC) -f fltk.pdf --jpeg --compression=9 --duplex --verbose --toclevels 2 --title FL.gif $(HTMLFILES)
# #
# End of "$Id: Makefile,v 1.8 1999/02/22 22:17:48 mike Exp $". # End of "$Id: Makefile,v 1.9 1999/03/10 20:18:37 mike Exp $".
# #

View File

@ -192,132 +192,132 @@ calls <TT>XK_Multi_key</TT>.
<th>Keys</th><th>Char</th> <th>Keys</th><th>Char</th>
</tr> </tr>
<tr> <tr>
<td><TT>sp</TT></td><td>nbsp</td> <td align=center><TT>sp</TT></td><td align=center>nbsp</td>
<td><TT>*</TT></td><td>°</td> <td align=center><TT>*</TT></td><td align=center>°</td>
<td><TT>A`</TT></td><td>À</td> <td align=center><TT>A`</TT></td><td align=center>À</td>
<td><TT>D-</TT></td><td>Ð</td> <td align=center><TT>D-</TT></td><td align=center>Ð</td>
<td><TT>a`</TT></td><td>à</td> <td align=center><TT>a`</TT></td><td align=center>à</td>
<td><TT>d-</TT></td><td>ð</td> <td align=center><TT>d-</TT></td><td align=center>ð</td>
</tr> </tr>
<tr> <tr>
<td><TT>!</TT></td><td>¡</td> <td align=center><TT>!</TT></td><td align=center>¡</td>
<td><TT>+-</TT></td><td>±</td> <td align=center><TT>+-</TT></td><td align=center>±</td>
<td><TT>A'</TT></td><td>Á</td> <td align=center><TT>A'</TT></td><td align=center>Á</td>
<td><TT>N~</TT></td><td>Ñ</td> <td align=center><TT>N~</TT></td><td align=center>Ñ</td>
<td><TT>a'</TT></td><td>á</td> <td align=center><TT>a'</TT></td><td align=center>á</td>
<td><TT>n~</TT></td><td>ñ</td> <td align=center><TT>n~</TT></td><td align=center>ñ</td>
</tr> </tr>
<tr> <tr>
<td><TT>%</TT></td><td>¢</td> <td align=center><TT>%</TT></td><td align=center>¢</td>
<td><TT>2</TT></td><td>²</td> <td align=center><TT>2</TT></td><td align=center>²</td>
<td><TT>A^</TT></td><td>Â</td> <td align=center><TT>A^</TT></td><td align=center>Â</td>
<td><TT>O`</TT></td><td>Ò</td> <td align=center><TT>O`</TT></td><td align=center>Ò</td>
<td><TT>a^</TT></td><td>â</td> <td align=center><TT>a^</TT></td><td align=center>â</td>
<td><TT>o`</TT></td><td>ò</td> <td align=center><TT>o`</TT></td><td align=center>ò</td>
</tr> </tr>
<tr> <tr>
<td><TT>#</TT></td><td>£</td> <td align=center><TT>#</TT></td><td align=center>£</td>
<td><TT>3</TT></td><td>³</td> <td align=center><TT>3</TT></td><td align=center>³</td>
<td><TT>A~</TT></td><td>Ã</td> <td align=center><TT>A~</TT></td><td align=center>Ã</td>
<td><TT>O'</TT></td><td>Ó</td> <td align=center><TT>O'</TT></td><td align=center>Ó</td>
<td><TT>a~</TT></td><td>ã</td> <td align=center><TT>a~</TT></td><td align=center>ã</td>
<td><TT>o'</TT></td><td>ó</td> <td align=center><TT>o'</TT></td><td align=center>ó</td>
</tr> </tr>
<tr> <tr>
<td><TT>$</TT></td><td>¤</td> <td align=center><TT>$</TT></td><td align=center>¤</td>
<td><TT>'</TT></td><td>´</td> <td align=center><TT>'</TT></td><td align=center>´</td>
<td><TT>A:</TT></td><td>Ä</td> <td align=center><TT>A:</TT></td><td align=center>Ä</td>
<td><TT>O^</TT></td><td>Ô</td> <td align=center><TT>O^</TT></td><td align=center>Ô</td>
<td><TT>a:</TT></td><td>ä</td> <td align=center><TT>a:</TT></td><td align=center>ä</td>
<td><TT>o^</TT></td><td>ô</td> <td align=center><TT>o^</TT></td><td align=center>ô</td>
</tr> </tr>
<tr> <tr>
<td><TT>y=</TT></td><td>¥</td> <td align=center><TT>y=</TT></td><td align=center>¥</td>
<td><TT>u</TT></td><td>µ</td> <td align=center><TT>u</TT></td><td align=center>µ</td>
<td><TT>A*</TT></td><td>Å</td> <td align=center><TT>A*</TT></td><td align=center>Å</td>
<td><TT>O~</TT></td><td>Õ</td> <td align=center><TT>O~</TT></td><td align=center>Õ</td>
<td><TT>a*</TT></td><td>å</td> <td align=center><TT>a*</TT></td><td align=center>å</td>
<td><TT>o~</TT></td><td>õ</td> <td align=center><TT>o~</TT></td><td align=center>õ</td>
</tr> </tr>
<tr> <tr>
<td><TT>|</TT></td><td>¦</td> <td align=center><TT>|</TT></td><td align=center>¦</td>
<td><TT>p</TT></td><td></td> <td align=center><TT>p</TT></td><td align=center></td>
<td><TT>AE</TT></td><td>Æ</td> <td align=center><TT>AE</TT></td><td align=center>Æ</td>
<td><TT>O:</TT></td><td>Ö</td> <td align=center><TT>O:</TT></td><td align=center>Ö</td>
<td><TT>ae</TT></td><td>æ</td> <td align=center><TT>ae</TT></td><td align=center>æ</td>
<td><TT>o:</TT></td><td>ö</td> <td align=center><TT>o:</TT></td><td align=center>ö</td>
</tr> </tr>
<tr> <tr>
<td><TT>&amp;</TT></td><td>§</td> <td align=center><TT>&amp;</TT></td><td align=center>§</td>
<td><TT>.</TT></td><td>·</td> <td align=center><TT>.</TT></td><td align=center>·</td>
<td><TT>C,</TT></td><td>Ç</td> <td align=center><TT>C,</TT></td><td align=center>Ç</td>
<td><TT>x</TT></td><td>×</td> <td align=center><TT>x</TT></td><td align=center>×</td>
<td><TT>c,</TT></td><td>ç</td> <td align=center><TT>c,</TT></td><td align=center>ç</td>
<td><TT>-:</TT></td><td>÷</td> <td align=center><TT>-:</TT></td><td align=center>÷</td>
</tr> </tr>
<tr> <tr>
<td><TT>:</TT></td><td>¨</td> <td align=center><TT>:</TT></td><td align=center>¨</td>
<td><TT>,</TT></td><td>¸</td> <td align=center><TT>,</TT></td><td align=center>¸</td>
<td><TT>E`</TT></td><td>È</td> <td align=center><TT>E`</TT></td><td align=center>È</td>
<td><TT>O/</TT></td><td>Ø</td> <td align=center><TT>O/</TT></td><td align=center>Ø</td>
<td><TT>e`</TT></td><td>è</td> <td align=center><TT>e`</TT></td><td align=center>è</td>
<td><TT>o/</TT></td><td>ø</td> <td align=center><TT>o/</TT></td><td align=center>ø</td>
</tr> </tr>
<tr> <tr>
<td><TT>c</TT></td><td>©</td> <td align=center><TT>c</TT></td><td align=center>©</td>
<td><TT>1</TT></td><td>¹</td> <td align=center><TT>1</TT></td><td align=center>¹</td>
<td><TT>E'</TT></td><td>É</td> <td align=center><TT>E'</TT></td><td align=center>É</td>
<td><TT>U`</TT></td><td>Ù</td> <td align=center><TT>U`</TT></td><td align=center>Ù</td>
<td><TT>e'</TT></td><td>é</td> <td align=center><TT>e'</TT></td><td align=center>é</td>
<td><TT>u`</TT></td><td>ù</td> <td align=center><TT>u`</TT></td><td align=center>ù</td>
</tr> </tr>
<tr> <tr>
<td><TT>a</TT></td><td>ª</td> <td align=center><TT>a</TT></td><td align=center>ª</td>
<td><TT>o</TT></td><td>º</td> <td align=center><TT>o</TT></td><td align=center>º</td>
<td><TT>E^</TT></td><td>Ê</td> <td align=center><TT>E^</TT></td><td align=center>Ê</td>
<td><TT>U'</TT></td><td>Ú</td> <td align=center><TT>U'</TT></td><td align=center>Ú</td>
<td><TT>e^</TT></td><td>ê</td> <td align=center><TT>e^</TT></td><td align=center>ê</td>
<td><TT>u'</TT></td><td>ú</td> <td align=center><TT>u'</TT></td><td align=center>ú</td>
</tr> </tr>
<tr> <tr>
<td><TT>&lt;&lt;</TT></td><td>«</td> <td align=center><TT>&lt;&lt;</TT></td><td align=center>«</td>
<td><TT>>></TT></td><td>»</td> <td align=center><TT>>></TT></td><td align=center>»</td>
<td><TT>E:</TT></td><td>Ë</td> <td align=center><TT>E:</TT></td><td align=center>Ë</td>
<td><TT>U^</TT></td><td>Û</td> <td align=center><TT>U^</TT></td><td align=center>Û</td>
<td><TT>e:</TT></td><td>ë</td> <td align=center><TT>e:</TT></td><td align=center>ë</td>
<td><TT>u^</TT></td><td>û</td> <td align=center><TT>u^</TT></td><td align=center>û</td>
</tr> </tr>
<tr> <tr>
<td><TT>~</TT></td><td>¬</td> <td align=center><TT>~</TT></td><td align=center>¬</td>
<td><TT>14</TT></td><td>¼</td> <td align=center><TT>14</TT></td><td align=center>¼</td>
<td><TT>I`</TT></td><td>Ì</td> <td align=center><TT>I`</TT></td><td align=center>Ì</td>
<td><TT>U:</TT></td><td>Ü</td> <td align=center><TT>U:</TT></td><td align=center>Ü</td>
<td><TT>i`</TT></td><td>ì</td> <td align=center><TT>i`</TT></td><td align=center>ì</td>
<td><TT>u:</TT></td><td>ü</td> <td align=center><TT>u:</TT></td><td align=center>ü</td>
</tr> </tr>
<tr> <tr>
<td><TT>-</TT></td><td>­</td> <td align=center><TT>-</TT></td><td align=center>­</td>
<td><TT>12</TT></td><td>½</td> <td align=center><TT>12</TT></td><td align=center>½</td>
<td><TT>I'</TT></td><td>Í</td> <td align=center><TT>I'</TT></td><td align=center>Í</td>
<td><TT>Y'</TT></td><td>Ý</td> <td align=center><TT>Y'</TT></td><td align=center>Ý</td>
<td><TT>i'</TT></td><td>í</td> <td align=center><TT>i'</TT></td><td align=center>í</td>
<td><TT>y'</TT></td><td>ý</td> <td align=center><TT>y'</TT></td><td align=center>ý</td>
</tr> </tr>
<tr> <tr>
<td><TT>r</TT></td><td>®</td> <td align=center><TT>r</TT></td><td align=center>®</td>
<td><TT>34</TT></td><td>¾</td> <td align=center><TT>34</TT></td><td align=center>¾</td>
<td><TT>I^</TT></td><td>Î</td> <td align=center><TT>I^</TT></td><td align=center>Î</td>
<td><TT>DD</TT></td><td>Þ</td> <td align=center><TT>DD</TT></td><td align=center>Þ</td>
<td><TT>i^</TT></td><td>î</td> <td align=center><TT>i^</TT></td><td align=center>î</td>
<td><TT>dd</TT></td><td>þ</td> <td align=center><TT>dd</TT></td><td align=center>þ</td>
</tr> </tr>
<tr> <tr>
<td><TT>_</TT></td><td>¯</td> <td align=center><TT>_</TT></td><td align=center>¯</td>
<td><TT>?</TT></td><td>¿</td> <td align=center><TT>?</TT></td><td align=center>¿</td>
<td><TT>I:</TT></td><td>Ï</td> <td align=center><TT>I:</TT></td><td align=center>Ï</td>
<td><TT>ss</TT></td><td>ß</td> <td align=center><TT>ss</TT></td><td align=center>ß</td>
<td><TT>i:</TT></td><td>ï</td> <td align=center><TT>i:</TT></td><td align=center>ï</td>
<td><TT>y:</TT></td><td>ÿ</td> <td align=center><TT>y:</TT></td><td align=center>ÿ</td>
</tr> </tr>
</table> </table>
</center> </center>

View File

@ -94,17 +94,16 @@ files found to be compiled:
</PRE> </PRE>
</UL> </UL>
<H2>A Short Tutorial</H2> <H2>A Short Tutorial</H2>
FLUID is an amazingly powerful little program. However,
this power comes at a price, it is not always obvious how FLUID is an amazingly powerful little program. However, this power
to accomplish seemingly simple tasks with it. This comes at a price, as it is not always obvious how to accomplish seemingly
tutorial will show you how to generate a complete user simple tasks with it. This tutorial will show you how to generate a
interface class with FLUID. complete user interface class with FLUID that is used for the CubeView
<P> program below.
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0>
<TR VALIGN=TOP> <P ALIGN=CENTER><IMG SRC="cubeview.gif"></P>
<TD>
The program shown to the right is called CubeView. The window you see <P>The window is of class CubeViewUI, and is completely generated by FLUID, including
is of class CubeViewUI, and is completely generated by FLUID, including
class member functions. The central display of the cube is a separate class member functions. The central display of the cube is a separate
subclass of Fl_Gl_Window called CubeView. CubeViewUI manages CubeView subclass of Fl_Gl_Window called CubeView. CubeViewUI manages CubeView
using callbacks from the various sliders and rollers to manipulate the using callbacks from the various sliders and rollers to manipulate the
@ -120,10 +119,7 @@ classes.
href="Fl_Gl_Window.html#Fl_Gl_Window"><TT>Fl_Gl_Window</TT></A> to suit href="Fl_Gl_Window.html#Fl_Gl_Window"><TT>Fl_Gl_Window</TT></A> to suit
your purposes. your purposes.
</ol> </ol>
</TD>
<TD><IMG SRC="cubeview.gif"></TD>
</TR>
</TABLE>
<h3>The CubeView Class</h3> <h3>The CubeView Class</h3>
The CubeView class is a subclass of Fl_Gl_Window. It has methods for The CubeView class is a subclass of Fl_Gl_Window. It has methods for
setting the zoom, the <i>x</i> and <i>y</i> pan, and the rotation angle setting the zoom, the <i>x</i> and <i>y</i> pan, and the rotation angle
@ -216,42 +212,85 @@ CubeView::CubeView(int x,int y,int w,int h,const char *l)
void CubeView::drawCube() { void CubeView::drawCube() {
/* Draw a colored cube */ /* Draw a colored cube */
glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv0); #define ALPHA 0.5
v3f(boxv1); v3f(boxv2); v3f(boxv3); glEnd(); glShadeModel(GL_FLAT);
glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv5);
v3f(boxv4); v3f(boxv7); v3f(boxv6); glEnd();
glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv0); glBegin(GL_QUADS);
v3f(boxv4); v3f(boxv5); v3f(boxv1); glEnd(); glColor4f(0.0, 0.0, 1.0, ALPHA);
glVertex3fv(boxv0);
glVertex3fv(boxv1);
glVertex3fv(boxv2);
glVertex3fv(boxv3);
glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv2); glColor4f(1.0, 1.0, 0.0, ALPHA);
v3f(boxv6); v3f(boxv7); v3f(boxv3); glEnd(); glVertex3fv(boxv0);
glVertex3fv(boxv4);
glVertex3fv(boxv5);
glVertex3fv(boxv1);
glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv0); glColor4f(0.0, 1.0, 1.0, ALPHA);
v3f(boxv3); v3f(boxv7); v3f(boxv4); glEnd(); glVertex3fv(boxv2);
glVertex3fv(boxv6);
glVertex3fv(boxv7);
glVertex3fv(boxv3);
glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv1); glColor4f(1.0, 0.0, 0.0, ALPHA);
v3f(boxv5); v3f(boxv6); v3f(boxv2); glEnd(); glVertex3fv(boxv4);
glVertex3fv(boxv5);
glVertex3fv(boxv6);
glVertex3fv(boxv7);
#define ALPHA 128 glColor4f(1.0, 0.0, 1.0, ALPHA);
glBegin(GL_QUADS); glColor4ub( 0, 0, 255, ALPHA); v3f(boxv0); glVertex3fv(boxv0);
v3f(boxv1); v3f(boxv2); v3f(boxv3); glEnd(); glVertex3fv(boxv3);
glVertex3fv(boxv7);
glVertex3fv(boxv4);
glBegin(GL_QUADS); glColor4ub(255, 255, 0, ALPHA); v3f(boxv0); glColor4f(0.0, 1.0, 0.0, ALPHA);
v3f(boxv4); v3f(boxv5); v3f(boxv1); glEnd(); glVertex3fv(boxv1);
glVertex3fv(boxv5);
glVertex3fv(boxv6);
glVertex3fv(boxv2);
glEnd();
glBegin(GL_QUADS); glColor4ub( 0, 255, 255, ALPHA); v3f(boxv2); glColor3f(1.0, 1.0, 1.0);
v3f(boxv6); v3f(boxv7); v3f(boxv3); glEnd(); glBegin(GL_LINES);
glVertex3fv(boxv0);
glVertex3fv(boxv1);
glBegin(GL_QUADS); glColor4ub(255, 0, 0, ALPHA); v3f(boxv4); glVertex3fv(boxv1);
v3f(boxv5); v3f(boxv6); v3f(boxv7); glEnd(); glVertex3fv(boxv2);
glBegin(GL_QUADS); glColor4ub(255, 0, 255, ALPHA); v3f(boxv0); glVertex3fv(boxv2);
v3f(boxv3); v3f(boxv7); v3f(boxv4); glEnd(); glVertex3fv(boxv3);
glBegin(GL_QUADS); glColor4ub( 0, 255, 0, ALPHA); v3f(boxv1); glVertex3fv(boxv3);
v3f(boxv5); v3f(boxv6); v3f(boxv2); glEnd(); glVertex3fv(boxv0);
glVertex3fv(boxv4);
glVertex3fv(boxv5);
glVertex3fv(boxv5);
glVertex3fv(boxv6);
glVertex3fv(boxv6);
glVertex3fv(boxv7);
glVertex3fv(boxv7);
glVertex3fv(boxv4);
glVertex3fv(boxv0);
glVertex3fv(boxv4);
glVertex3fv(boxv1);
glVertex3fv(boxv5);
glVertex3fv(boxv2);
glVertex3fv(boxv6);
glVertex3fv(boxv3);
glVertex3fv(boxv7);
glEnd();
};//drawCube };//drawCube
void CubeView::draw() { void CubeView::draw() {
@ -305,9 +344,7 @@ CubeViewUI.
<p>We will talk about the <tt>show()</tt> method that is highlighted <p>We will talk about the <tt>show()</tt> method that is highlighted
shortly. shortly.
<h4><a name="addcube">Adding the CubeView Widget</a></h4> <h4><a name="addcube">Adding the CubeView Widget</a></h4>
<table cellpadding=0 cellspacing=0>
<tr valign=top>
<td>
What we have is nice, but does little to show our cube. We have already What we have is nice, but does little to show our cube. We have already
defined the CubeView class and we would like to show it within the defined the CubeView class and we would like to show it within the
CubeViewUI. CubeViewUI.
@ -323,10 +360,9 @@ Code:&quot; field enter <tt>#include &quot;CubeView.h&quot;</tt>
<p>This <tt>#include</tt> is important, as we have just included <p>This <tt>#include</tt> is important, as we have just included
CubeView as a member of CubeViewUI, so any public CubeView methods are CubeView as a member of CubeViewUI, so any public CubeView methods are
now available to CubeViewUI. now available to CubeViewUI.
</td>
<td><img src="fluid3.gif"></td> <p align=center><img src="fluid3.gif"></p>
</tr>
</table>
<h4><a name="defcall">Defining the Callbacks</a></h4> <h4><a name="defcall">Defining the Callbacks</a></h4>
Each of the widgets we defined before adding CubeView can have Each of the widgets we defined before adding CubeView can have
callbacks that call CubeView methods. You can call an external callbacks that call CubeView methods. You can call an external
@ -345,9 +381,6 @@ more than one view change only redrawing once saves a lot of time.
enter these callbacks. FLUID assumes you are smart enough not to refer enter these callbacks. FLUID assumes you are smart enough not to refer
to members or functions that don't exist. to members or functions that don't exist.
<h4><a name="addmeth">Adding a Class Method</a></h4> <h4><a name="addmeth">Adding a Class Method</a></h4>
<table cellpadding=0 cellspacing=0>
<tr valign=top>
<td>
You can add class methods within FLUID that have nothing to do with the You can add class methods within FLUID that have nothing to do with the
GUI. An an example add a show function so that CubeViewUI can actually GUI. An an example add a show function so that CubeViewUI can actually
appear on the screen. appear on the screen.
@ -356,12 +389,9 @@ appear on the screen.
<tt>show()</tt>. We don't need a return value here, and since we will <tt>show()</tt>. We don't need a return value here, and since we will
not be adding any widgets to this method FLUID will assign it a return not be adding any widgets to this method FLUID will assign it a return
type of <tt>void</tt>. type of <tt>void</tt>.
<p align=center><img src="fluid4.gif"></p>
<p>Once the new method has been added, highlight its name and select <p>Once the new method has been added, highlight its name and select
New-&gt;Code-&gt;Code. Enter the method's code in the code window. New-&gt;Code-&gt;Code. Enter the method's code in the code window.
</td>
<td><img src="fluid4.gif"></td>
</tr>
</table>
<h3><a name="addconst">Adding Constructor Initialization Code</a></h3> <h3><a name="addconst">Adding Constructor Initialization Code</a></h3>
If you need to add code to initialize class, for example setting If you need to add code to initialize class, for example setting
@ -488,9 +518,13 @@ to reorder functions, classes, and windows within functions.
<H4>Edit/Later (F3)</H4> <H4>Edit/Later (F3)</H4>
Moves all of the selected widgets one later in order among the Moves all of the selected widgets one later in order among the
children of their parent (if possible). children of their parent (if possible).
<P>
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0>
<TR>
<TD VALIGN=TOP>
<H4>Edit/Group (F7)</H4> <H4>Edit/Group (F7)</H4>
Creates a new <tt>Fl_Group</tt> and make all the currently selected widgets Creates a new <tt>Fl_Group</tt> and make all the currently selected widgets
children of it. children of it.
<H4>Edit/Ungroup (F8)</H4> <H4>Edit/Ungroup (F8)</H4>
Deletes the parent group if all the children of a group are selected. Deletes the parent group if all the children of a group are selected.
<H4>Edit/Overlays on/off (Alt+Shift+O)</H4> <H4>Edit/Overlays on/off (Alt+Shift+O)</H4>
@ -499,21 +533,17 @@ selection. This makes it easier to see box borders and how the layout
looks. The overlays will be forced back on if you change the looks. The overlays will be forced back on if you change the
selection. selection.
<H4>Edit/Preferences (Alt+p)</H4> <H4>Edit/Preferences (Alt+p)</H4>
<TABLE WIDTH=100%>
<TR>
<TD VALIGN=TOP>
Displays the preferences panel. The alignment preferences control the Displays the preferences panel. The alignment preferences control the
grid that all widgets snap to when you move and resize them, and for the grid that all widgets snap to when you move and resize them, and for the
"snap" which is how far a widget has to be dragged from its original position "snap" which is how far a widget has to be dragged from its original position
to actually change. to actually change.
<P>The output filenames control the extensions or names of the files the are
generated by FLUID. If you check the "Include .h from .cxx" button the code
file will include the header file automatically.
</TD> </TD>
<TD VALIGN=TOP><IMG SRC="fluid_prefs.gif"></TD> <TD VALIGN=TOP><IMG SRC="fluid_prefs.gif"></TD>
</TR> </TR>
</TABLE> </TABLE>
The output filenames control the extensions or names of the files the are
generated by FLUID. If you check the "Include .h from .cxx" button the code
file will include the header file automatically.
<H4>New/Code/Function</H4> <H4>New/Code/Function</H4>
Creates a new C function. You will be asked for a name for the Creates a new C function. You will be asked for a name for the
@ -550,28 +580,28 @@ which is described later in this chapter. </P>
<H4>Help/About FLUID</H4> <H4>Help/About FLUID</H4>
Pops up a panel showing the version of FLUID. Pops up a panel showing the version of FLUID.
<H3>The Widget Panel</H3> <H3>The Widget Panel</H3>
<TABLE cellpadding=0 cellspacing=0> <TABLE cellpadding=0 cellspacing=0 width=100%>
<TR><TD>When you double-click on a widget or a set of widgets you will get <TR><TD>When you double-click on a widget or a set of widgets you will get
the &quot;widget attribute panel&quot;. the &quot;widget attribute panel&quot;.
<P>When you change attributes using this panel, the changes are <P>When you change attributes using this panel, the changes are
reflected immediately in the window. It is useful to hit the &quot;no reflected immediately in the window. It is useful to hit the &quot;no
overlay&quot; button (or type Alt+Shift+O) to hide the red overlay so you can see overlay&quot; button (or type Alt+Shift+O) to hide the red overlay so you can see
the widgets more accurately, especially when setting the box type. </P> the widgets more accurately, especially when setting the box type.
<P>If you have several widgets selected, they may have different values <P>If you have several widgets selected, they may have different values
for the fields. In this case the value for <I>one</I> of the widgets for the fields. In this case the value for <I>one</I> of the widgets
is shown. But if you change this value, <I>all</I> of the selected is shown. But if you change this value, <I>all</I> of the selected
widgets are changed to the new value. </P> widgets are changed to the new value.
<P>Hitting &quot;OK&quot; makes the changes permanent. Selecting a different <P>Hitting &quot;OK&quot; makes the changes permanent. Selecting a different
widget also makes the changes permanent. FLUID checks for simple widget also makes the changes permanent. FLUID checks for simple
syntax errors such as mismatched parenthesis in any code before syntax errors such as mismatched parenthesis in any code before
saving any text. </P> saving any text.
</TD><TD><IMG src=fluid_widget.gif width=225></TD></TR> <P>&quot;Revert&quot; or &quot;Cancel&quot; put everything back to when you last brought up
</TABLE>
&quot;Revert&quot; or &quot;Cancel&quot; put everything back to when you last brought up
the panel or hit OK. However in the current version of FLUID, changes the panel or hit OK. However in the current version of FLUID, changes
to &quot;visible&quot; attributes (such as the color, label, box) are not undone to &quot;visible&quot; attributes (such as the color, label, box) are not undone
by revert or cancel. Changes to code like the callbacks are undone, by revert or cancel. Changes to code like the callbacks are undone,
however. however.
</TD><TD><IMG src="fluid_widget.gif"></TD></TR>
</TABLE>
<H3><A name=widget_attributes>Widget Attributes</A></H3> <H3><A name=widget_attributes>Widget Attributes</A></H3>
<H4>Name (text field)</H4> <H4>Name (text field)</H4>
Name of a variable to declare, and to store a pointer to this Name of a variable to declare, and to store a pointer to this

View File

@ -65,9 +65,8 @@ library, though, and has started being included on Linux distributions.
<UL> <UL>
<LI>sizeof(Fl_Widget) == 40 to 48.</LI> <LI>sizeof(Fl_Widget) == 40 to 48.</LI>
<LI>The &quot;core&quot; (the &quot;hello&quot; program compiled &amp; linked with a static <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> FLTK library using gcc on a 486 and then stripped) is 110K.</LI>
<LI>A program including every widget is less than 108K. Does not use <LI>The FLUID program (which includes every widget) is 372k.
macros, templates, multiple inheritance, or exceptions.</LI>
<LI>Written directly atop Xlib (or WIN32) for maximum speed, and <LI>Written directly atop Xlib (or WIN32) for maximum speed, and
carefully optimized for code size and performance.</LI> carefully optimized for code size and performance.</LI>
<LI>Precise low-level compatability between the X11 and WIN32 version <LI>Precise low-level compatability between the X11 and WIN32 version