From 0e6e2393bfc7eeaa47b8a2ebd6c2023f560d7a90 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 28 Apr 2000 18:15:26 +0000 Subject: Typos reported by Alexander Mai Fl_Browser_ docos finished. Added Fl_Group::init_sizes() description. Added links for common widgets in chapter 3 (?) Fixed formatting problems in subclassing and FLUID chapters. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1100 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/fluid.html | 56 +++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 22 deletions(-) (limited to 'documentation/fluid.html') diff --git a/documentation/fluid.html b/documentation/fluid.html index ebd60af3f..b4a4cc2cd 100644 --- a/documentation/fluid.html +++ b/documentation/fluid.html @@ -1,24 +1,36 @@

8 - Programming with FLUID

- This chapter shows how to use the Fast Light User-Interface Designer + +This chapter shows how to use the Fast Light User-Interface Designer ("FLUID") to create your GUIs. +

What is FLUID?

- The Fast Light User Interface Designer, or FLUID, is a graphical + +

The Fast Light User Interface Designer, or FLUID, is a graphical editor that is used to produce FLTK source code. +

FLUID edits and saves its state in .fl files. These files are text, and you can (with care) edit them in a text editor, perhaps to get some special effects.

+

FLUID can "compile" the .fl file into a .cxx and a .h file. The .cxx file defines all the objects from the .fl file and the .h file declares all the global ones.

+ +

FLUID also supports localization (Internationalization) +of label strings using message files and the GNU gettext or POSIX catgets +interfaces. +

A simple program can be made by putting all your code (including a main() function) into the .fl file and thus making the .cxx file a single source file to compile. Most programs are more complex than this, so you write other .cxx files that call the FLUID functions. - These .cxx files must #include the .h file or they can +These .cxx files must #include the .h file or they can #include the .cxx file so it still appears to be a single source file. +

+

Normally the FLUID file defines one or more functions or classes which output C++ code. Each function defines a one or more FLTK windows, and all the widgets that go inside those windows.

@@ -61,7 +73,7 @@ save-as to write it to a file). Changing the colors may be useful to see what your interface will look at if the user calls it with the same switches.

In the current version, if you don't go into the background (with -'&' then you will be able to abort FLUID by typing ^C on the terminal. It +'&') then you will be able to abort FLUID by typing ^C on the terminal. It will exit immediately, losing any changes.

Running FLUID Under Microsoft Windows

To run FLUID under WIN32, double-click on the FLUID.exe file. @@ -81,7 +93,7 @@ code. In a makefile you can use a line like this: Some versions of make will accept rules like this to allow all .fl @@ -90,16 +102,16 @@ files found to be compiled:
 .SUFFIXES: .fl .cxx .h
 .fl.h .fl.cxx:
-	FLUID -c $<
+	fluid -c $<
 

A Short Tutorial

FLUID is an amazingly powerful little program. However, this power -comes at a price, as it is not always obvious how to accomplish seemingly +comes at a price as it is not always obvious how to accomplish seemingly simple tasks with it. This tutorial will show you how to generate a complete user interface class with FLUID that is used for the CubeView -program below. +program provided with FLTK.

@@ -524,10 +536,6 @@ to reorder functions, classes, and windows within functions.

Edit/Later (F3)

Moves all of the selected widgets one later in order among the children of their parent (if possible). -

- - - - - -

Edit/Group (F7)

Creates a new Fl_Group and make all the currently selected widgets children of it. @@ -539,14 +547,13 @@ selection. This makes it easier to see box borders and how the layout looks. The overlays will be forced back on if you change the selection.

Edit/Preferences (Alt+p)

+ Displays the preferences panel. The alignment preferences control 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 to actually change. -
+ +

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 @@ -600,9 +607,7 @@ the widgets more accurately, especially when setting the box type. for the fields. In this case the value for one of the widgets is shown. But if you change this value, all of the selected widgets are changed to the new value. - - - + + + +
Hitting "OK" makes the changes permanent. Selecting a different +

Hitting "OK" makes the changes permanent. Selecting a different widget also makes the changes permanent. FLUID checks for simple syntax errors such as mismatched parenthesis in any code before saving any text. @@ -611,6 +616,10 @@ the panel or hit OK. However in the current version of FLUID, changes to "visible" attributes (such as the color, label, box) are not undone by revert or cancel. Changes to code like the callbacks are undone, however. + + + + -

Widget Attributes

Name (text field)

Name of a variable to declare, and to store a pointer to this @@ -620,13 +629,16 @@ blank then no variable is created. etc. This will cause FLUID to declare an array of pointers. The array is big enough that the highest number found can be stored. All widgets that in the array must be the same type.

-

Type (upper-right pulldown menu)

Some classes have subtypes that modify their appearance or behavior. You pick the subtype off of this menu.

Box (pulldown menu)

- The boxtype to draw as a background for the widget. +The boxtype to draw as a background for the widget. +
   

Many widgets will work, and draw faster, with a "frame" instead of a "box". A frame does not draw the colored interior, leaving whatever was already there visible. Be careful, as FLUID may draw this ok but -- cgit v1.2.3