From b983b285cc4f0627a1f72c9d6c510047af0ad116 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 26 Jan 1999 21:36:02 +0000 Subject: Lots of documentation fixes, and added a new image for the Fluid chapter. git-svn-id: file:///fltk/svn/fltk/trunk@244 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/Fl_Menu_Item.html | 16 +- documentation/basics.html | 7 +- documentation/common.html | 26 ++- documentation/drawing.html | 56 +++-- documentation/editor.html | 8 +- documentation/events.html | 60 ++--- documentation/fluid.html | 471 ++++++++++++++++++++-------------------- documentation/fluid_prefs.gif | Bin 0 -> 10419 bytes documentation/intro.html | 30 ++- documentation/opengl.html | 73 ++++--- documentation/preface.html | 6 +- documentation/subclassing.html | 99 +++++---- 12 files changed, 455 insertions(+), 397 deletions(-) create mode 100644 documentation/fluid_prefs.gif (limited to 'documentation') diff --git a/documentation/Fl_Menu_Item.html b/documentation/Fl_Menu_Item.html index bdce5feb9..6ab539dc6 100644 --- a/documentation/Fl_Menu_Item.html +++ b/documentation/Fl_Menu_Item.html @@ -52,14 +52,14 @@ enum { // values for flags:
 Fl_Menu_Item popup[] = {
-  {",   FL_ALT+'a', the_cb, (void*)1},
-  {",    FL_ALT+'b', the_cb, (void*)2},
+  {"&alpha",   FL_ALT+'a', the_cb, (void*)1},
+  {"&beta",    FL_ALT+'b', the_cb, (void*)2},
   {"gamma",    FL_ALT+'c', the_cb, (void*)3, FL_MENU_DIVIDER},
-  {",  0,   strange_cb},
-  {",    0,   charm_cb},
-  {",    0,   truth_cb},
-  {"b,   0,   beauty_cb},
-  {"sub,	0,   0, 0, FL_SUBMENU},
+  {"&strange",  0,   strange_cb},
+  {"&charm",    0,   charm_cb},
+  {"&truth",    0,   truth_cb},
+  {"b&eauty",   0,   beauty_cb},
+  {"sub&menu",	0,   0, 0, FL_SUBMENU},
     {"one"},
     {"two"},
     {"three"},
@@ -292,4 +292,4 @@ Fl_Menu_Item::next(int n=1) const
 
Fl_Menu_Item* Fl_Menu_Item::next(int n=1); Advance a pointer by n items through a menu array, skipping the contents of submenus and invisible items. There are two calls so -that you can advance through const and non-const data. \ No newline at end of file +that you can advance through const and non-const data. diff --git a/documentation/basics.html b/documentation/basics.html index 4b78f840b..e394a6cc2 100644 --- a/documentation/basics.html +++ b/documentation/basics.html @@ -57,11 +57,12 @@ FLTK header files. This can be done by selecting "Settings" from the WIN32 applications. If you want to use the standard C main() function as the entry point, FLTK includes a WinMain() function that will call your main() function for you.

-

Note: The Visual C++ optimizer is known to cause problems with +

Note: The Visual C++ 5.0 optimizer is known to cause problems with many programs. We only recommend using the "Favor Small Code" -optimization setting.

+optimization setting. The Visual C++ 6.0 optimizer seems to be much +better and can be used with the "optimized for speed" setting.

Writing Your First FLTK Program

- All programs must include the file <FL/Fl.H In addition the + All programs must include the file <FL/Fl.H>. In addition the program must include a header file for each FLTK class it uses. Listing 1 shows a simple "Hello, World!" program that uses FLTK to display the window. diff --git a/documentation/common.html b/documentation/common.html index 4fa974e75..ae42af388 100644 --- a/documentation/common.html +++ b/documentation/common.html @@ -3,7 +3,7 @@ This chapter describes many of the widgets that are provided with FLTK and covers how to query and set the standard attributes.

Buttons

- FLTK provides many types of buttons: + FLTK provides many types of buttons:
  • Fl_Button - A standard push button.
  • Fl_Check_Button - A button with a check box.
  • @@ -13,7 +13,8 @@ and covers how to query and set the standard attributes. Enter key.
  • Fl_Round_Button - A button with a check circle.
- For all of these buttons you just need to include the corresponding +

+For all of these buttons you just need to include the corresponding <FL/Fl_xyz_Button.H> header file. The constructor takes the bounding box of the button and optionally a label string:
    @@ -39,7 +40,7 @@ rbutton->type(FL_RADIO_BUTTON); clear() methods can be used on toggle buttons to turn a toggle button on or off, respectively. Radio buttons can be turned on with the setonly() method; this -will also turn off other radio buttons in the current group. +will also turn off other radio buttons in the same group.

    Text

    FLTK provides several text widgets for displaying and receiving text:
      @@ -74,7 +75,8 @@ strings. FLTK provides the following valuators:
    • Fl_Slider - A scrollbar with a knob.
    • Fl_Value_Slider - A slider that shows the current value.
    - The value() +

    +The value() method gets and sets the current value of the widget. The minimum() and maximum() methods set the range of values that are reported by @@ -144,11 +146,11 @@ button->labelcolor(FL_WHITE);

    FL_NO_BOX means nothing is drawn at all, so whatever is already on the screen remains. The FL_..._FRAME types only -draw their edges, leaving the center unchanged. In the above diagram +draw their edges, leaving the interior unchanged. In the above diagram the blue color is the area that is not drawn by the box.

    Making your own Boxtypes

    You can define your own boxtypes by making a small function that draws -the box and adding a pointer to it to a table of boxtypes. +the box and adding it to the table of boxtypes.

    The Drawing Function

    The drawing function is passed the bounding box and background color for the widget: @@ -183,9 +185,9 @@ Fl::set_boxtype(XYZ_BOX, xyz_draw, 1, 1, 2, 2);
The last 4 arguments to Fl::set_boxtype() are the offsets for the bounding box that should be subtracted when drawing the label -inside the box. +inside the box.

Labels and Label Types

- The label(), align, labelfont(), + The label(), align(), labelfont(), labelsize(), and labeltype() methods control the labeling of widgets.

label()

@@ -226,7 +228,7 @@ raised Fl_Bitmap or Fl_Pixmap objects.

Making Your Own Label Types

- Label types are actually indexes into a table of functions to draw + Label types are actually indexes into a table of functions that draw them. The primary purpose of this is to let you reuse the label() pointer as a pointer to arbitrary data such as a bitmap or pixmap. You can also use this to draw the labels in ways inaccessible through the @@ -252,7 +254,7 @@ label value is NULL. Fl_Label structure and references to the width and height:

- In the current version the XPM data is converted to 8-bit full color + In the current version the XPM data is converted to 24-bit RGB color and passed through fl_draw_image(). This is obviously not the most efficient way to do it, and has the same visual limitations as listed above for fl_draw_image(). Transparent colors are @@ -448,7 +444,7 @@ make an Fl_Widget use a pixmap as a label, or to just draw the pixmap directly. Under X it will create an offscreen pixmap the first time it is drawn, and copy this each subsequent time it is drawn . -

The current implementation converts the pixmap to 8 bit color data +

The current implementation converts the pixmap to 24-bit RGB data and uses fl_draw_image() to draw it. Thus you will get dithered colors on an 8 bit screen.

Fl_Pixmap(char *const* data)

@@ -482,7 +478,7 @@ to draw the pixmap. You can use the same pixmap for many widgets. make an Fl_Widget use an image as a label, or to just draw the image directly. Under X it will create an offscreen pixmap the first time it is drawn, and copy this each subsequent time it is drawn. -

Fl_Image(char uchar *data, int W, int H, int D = 3, int LD = 0)

+

Fl_Image(const uchar *data, int W, int H, int D = 3, int LD = 0)

Construct using a pointer to RGB data. W and H are the size of the image in pixels. D is the delta between pixels (it may be more than 3 to skip alpha or other data, or negative to flip @@ -504,4 +500,4 @@ ox
and oy may be negative and w and h the same as doing draw(x,y,this->w,this->h,0,0).

void label(Fl_Widget *)

Change the label() and the labeltype() of the widget -to draw the image. You can use the same image for many widgets. \ No newline at end of file +to draw the image. You can use the same image for many widgets. diff --git a/documentation/editor.html b/documentation/editor.html index 4d18c7b33..8da7c9a5c 100644 --- a/documentation/editor.html +++ b/documentation/editor.html @@ -6,7 +6,7 @@ editor. Since this will be the first big project you'll be doing with FLTK, lets define what we want our text editor to do:
    -
  1. Menu_Bar/menus for all functions.
  2. +
  3. Menubar/menus for all functions.
  4. Edit a single text file.
  5. Load from a file.
  6. Save to a file.
  7. @@ -31,7 +31,7 @@ things: - Once we have the menus defined we can create the Fl_Menu_Bar +Once we have the menus defined we can create the Fl_Menu_Bar widget and assign the menus to it with: - You can then put OpenGL drawing code anywhere you can draw normally by +You can then put OpenGL drawing code anywhere you can draw normally by surrounding it with:
      @@ -153,7 +157,7 @@ projection transformation or anything else you should use 
       glPushMatrix() and glPopMatrix() functions to put the 
       state back before calling gl_finish(). 

      You may want to use Fl_Window::current()->h() to get the -drawable height so you can flip the Y coordinates.

      +drawable height so that you can flip the Y coordinates.

      Unfortunately, there are a bunch of limitations you must adhere to for maximum portability:

        @@ -163,24 +167,25 @@ for maximum portability:

      • You cannot use Fl_Double_Window or Fl_Overlay_Window .
      - Do not call gl_start() or gl_finish() when +Do not call gl_start() or gl_finish() when drawing into an Fl_Gl_Window! -

      OpenGL drawing functions

      - FLTK provides some useful OpenGL drawing functions. They can be +

      OpenGL Drawing Functions

      +FLTK provides some useful OpenGL drawing functions. They can be freely mixed with any OpenGL calls, and are defined by including <FL/gl.H> (which you should include instead of the OpenGL header <GL/gl.h>).

      void gl_color(Fl_Color)

      - Set the current color to a FLTK color index. For color-index modes +Set the current color to a FLTK color. For color-index modes it will use fl_xpixel(c), which is only right if this window uses the default colormap!

      void gl_rect(int x, int y, int w, int h)
      void gl_rectf(int x, int y, int w, int h)

      - Outline or fill a rectangle with the current color. If ortho() - has been called, then the rectangle will exactly fill the pixel +Outline or fill a rectangle with the current color. If +Fl_Gl_Window::ortho() +has been called, then the rectangle will exactly fill the pixel rectangle passed.

      void gl_font(Fl_Font fontid, int size)

      - Set the "current OpenGL font" to the same font you get by calling +Set the current OpenGL font to the same font you get by calling fl_font().

      int gl_height()
      int gl_descent() @@ -190,8 +195,8 @@ rectangle passed. Return information about the current OpenGL font.

      void gl_draw(const char *)
      void gl_draw(const char *, int n)

      - Draw a nul-terminated string or an array of n characters in -the current OpenGL font at the current glRasterPos. +Draw a nul-terminated string or an array of n characters in +the current OpenGL font at the current raster position.

      void gl_draw(const char *, int x, int y)
      void gl_draw(const char *, int n, int x, int y)
      void gl_draw(const char *, float x, float y) @@ -299,4 +304,4 @@ void OptimizerWindow::draw() {

      The scene() Method

      The scene() method sets the scene to be drawn. The scene is a collection of 3D objects in a csGroup. The scene is redrawn -after this call. \ No newline at end of file +after this call. diff --git a/documentation/preface.html b/documentation/preface.html index 8726c158c..634f0ab65 100644 --- a/documentation/preface.html +++ b/documentation/preface.html @@ -1,11 +1,11 @@ - + FLTK 1.0 Programming Manual

      Preface

      - This manual describes the Fast Light Tool Kit ("FLTK") version 1.0, a +This manual describes the Fast Light Tool Kit ("FLTK") version 1.0, a C++ Graphical User Interface ("GUI") toolkit for UNIX and Microsoft Windows. Each of the chapters in this manual is designed as a tutorial for using FLTK, while the appendices provide a convenient reference for diff --git a/documentation/subclassing.html b/documentation/subclassing.html index 5951f0305..7ccf44fb9 100644 --- a/documentation/subclassing.html +++ b/documentation/subclassing.html @@ -5,12 +5,12 @@ widgets in FLTK.

      Subclassing

      New widgets are created by subclassing an existing FLTK widget, typically Fl_Widget for controls and Fl_Group for -containers. +composite widgets.

      A control widget typically interacts with the user to receive and/or display a value of some sort.

      -

      A container widget holds a list of child widgets and handles moving, +

      A composite widget widget holds a list of child widgets and handles moving, sizing, showing, or hiding them as needed. Fl_Group is the -main container widget class in FLTK, and all of the other containers ( +main composite widget widget class in FLTK, and all of the other composite widgets ( Fl_Pack, Fl_Scroll, Fl_Tabs, Fl_Tile, and Fl_Window) are subclasses of it.

      You can also subclass other existing widgets to provide a different @@ -23,13 +23,13 @@ the face of the button.

      subclass of Fl_Widget. Fl_Widget has only four virtual methods, and overriding some or all of these may be necessary.

      The Constructor

      - The constructor should access the following arguments: + The constructor should have the following arguments:
         MyClass(int x, int y, int w, int h, const char *label = 0);
         
      - This will allow the class to be used in Fluid + This will allow the class to be used in FLUID without problems.

      The constructor must call the constructor for the base class and pass the same arguments:

      @@ -41,8 +41,8 @@ MyClass::MyClass(int x, int y, int w, int h, const char *label) }
    -Fl_Widget's protected constructor sets x(), y() -, w(), h(), and label() to the passed values +Fl_Widget's protected constructor sets x(), y(), +w(), h(), and label() to the passed values and initializes the other instance variables to: