summaryrefslogtreecommitdiff
path: root/documentation/src/basics.dox
diff options
context:
space:
mode:
authorengelsman <engelsman>2009-03-30 20:41:22 +0000
committerengelsman <engelsman>2009-03-30 20:41:22 +0000
commit12318a5d25acd3e62cbc58bddae178a677b15671 (patch)
treecd3ffe4f30fcc23d203590bda252db1bcea86a3f /documentation/src/basics.dox
parent165eed565c0b08d008e996093541ee28115d1f1f (diff)
started changing html href calls to doxygen \ref commands
in basics.dox, common.dox and drawing.dox, and other cleaning up git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6729 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation/src/basics.dox')
-rw-r--r--documentation/src/basics.dox109
1 files changed, 58 insertions, 51 deletions
diff --git a/documentation/src/basics.dox b/documentation/src/basics.dox
index 96be28048..722614af9 100644
--- a/documentation/src/basics.dox
+++ b/documentation/src/basics.dox
@@ -41,7 +41,7 @@ Fl_Window *window = new Fl_Window(300,180);
\endcode
Then we create a box with the "Hello, World!" string in it. FLTK automatically
-adds the new box to <tt>window</tt>, the current grouping widget.
+adds the new box to \p window, the current grouping widget.
\code
Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");
@@ -56,7 +56,7 @@ box->labelfont(FL_BOLD+FL_ITALIC);
box->labeltype(FL_SHADOW_LABEL);
\endcode
-We tell FLTK that we will not add any more widgets to <tt>window</tt>.
+We tell FLTK that we will not add any more widgets to \p window.
\code
window->end();
@@ -71,32 +71,34 @@ return Fl::run();
The resulting program will display the window in Figure 2-1.
You can quit the program by closing the window or pressing the
-<KBD>ESC</KBD>ape key.
+<tt>ESC</tt>ape key.
\image html hello.C.gif "Figure 2-1: The Hello, World! Window"
\image latex hello.C.eps "The Hello, World! Window" width=8cm
+
\subsection basics_creating Creating the Widgets
-The widgets are created using the C++ <tt>new</tt> operator. For
+The widgets are created using the C++ \p new operator. For
most widgets the arguments to the constructor are:
\code
Fl_Widget(x, y, width, height, label)
\endcode
-The <tt>x</tt> and <tt>y</tt> parameters determine where the
+The \p x and \p y parameters determine where the
widget or window is placed on the screen. In FLTK the top left
-corner of the window or screen is the origin (i.e. x = 0, y =
-0) and the units are in pixels.
+corner of the window or screen is the origin
+(i.e. <tt>x = 0, y = 0</tt>)
+and the units are in pixels.
-The <tt>width</tt> and <tt>height</tt> parameters determine
+The \p width and \p height parameters determine
the size of the widget or window in pixels. The maximum widget
size is typically governed by the underlying window system or
hardware.
-<tt>label</tt> is a pointer to a character string to label
-the widget with or <tt>NULL</tt>. If not specified the label
-defaults to <tt>NULL</tt>. The label string must be in static
+\p label is a pointer to a character string to label
+the widget with or \p NULL. If not specified the label
+defaults to \p NULL. 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.
@@ -105,28 +107,33 @@ copy of it - it just uses the pointer.
Widgets are commonly ordered into functional groups, which
in turn may be grouped again, creating a hierarchy of widgets.
FLTK makes it easy to fill groups by automatically adding all widgets
-that are created between a <tt>myGroup->begin()</tt> and
-<tt>myGroup->end()</tt>. In this example, <tt>myGroup</tt>
-would be the <i>current</i> group.
+that are created between a
+<tt>myGroup->begin()</tt>
+and
+<tt>myGroup->end()</tt>.
+In this example, \p myGroup would be the \e current group.
Newly created groups and their derived widgets implicitly call
-<tt>begin()</tt> in the constructor, effectively adding all
-subsequently created widgets to itself until <tt>end()</tt>
+\p begin() in the constructor, effectively adding all
+subsequently created widgets to itself until \p end()
is called.
-Setting the current group to <tt>NULL</tt> will stop automatic
+Setting the current group to \p NULL will stop automatic
hierarchies. New widgets can now be added manually using
-<tt>Fl_Group::add(...)</tt> and <tt>Fl_Group::insert(...)</tt>.
+<tt>Fl_Group::add(...)</tt>
+and
+<tt>Fl_Group::insert(...)</tt>.
\subsection basics_getset Get/Set Methods
-<tt>box->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 that no box is drawn. In our
-"Hello, World!" example we use <tt>FL_UP_BOX</tt>,
+<tt>box->box(FL_UP_BOX)</tt>
+sets the type of box the Fl_Box draws, changing it from the default of
+\p FL_NO_BOX, which means that no box is drawn. In our
+"Hello, World!" example we use \p FL_UP_BOX,
which means that a raised button border will be drawn around
-the widget. You can learn more about boxtypes in
-<A href="common.html#boxtypes">Chapter 3</A>.
+the widget. More details are available in the
+\ref common_boxtypes
+section.
You could examine the boxtype in by doing
<tt>box->box()</tt>. FLTK uses method name overloading to make
@@ -138,11 +145,11 @@ of the form "type name() const".
Almost all of the set/get pairs are very fast, short inline
functions and thus very efficient. However, <i>the "set" methods
-do not call <tt>redraw()</tt></i> - you have to call it
+do not call \p redraw()</i> - you have to call it
yourself. This greatly reduces code size and execution time. The
-only common exceptions are <tt>value()</tt> which calls
-<tt>redraw()</tt> and <tt>label()</tt> which calls
-<tt>redraw_label()</tt> if necessary.
+only common exceptions are \p value() which calls
+\p redraw() and \p label() which calls
+\p redraw_label() if necessary.
\subsection basics_labels Labels
@@ -151,24 +158,24 @@ the label is used for the label in the title bar. Our example
program calls the \p labelfont(), \p labelsize(),
and \p labeltype() methods.
-The <tt>labelfont</tt> method sets the typeface and style
+The \p labelfont() method sets the typeface and style
that is used for the label, which for this example we are using
-<tt>FL_BOLD</tt> and <tt>FL_ITALIC</tt>. You can also specify
+\p FL_BOLD and \p FL_ITALIC. You can also specify
typefaces directly.
-The <tt>labelsize</tt> method sets the height of the font in pixels.
+The \p labelsize() method sets the height of the font in pixels.
-The <tt>labeltype</tt>
+The \p labeltype()
method sets the type of label. FLTK supports normal, embossed,
and shadowed labels internally, and more types can be added as
desired.
-A complete list of all label options can be found in
-<A href="common.html#labels">Chapter 3</A>.
+A complete list of all label options can be found in the section on
+\ref common_labels.
\subsection basics_showing Showing the Window
-The <tt>show()</tt> method shows the widget or window. For windows
+The \p show() method shows the widget or window. For windows
you can also provide the command-line arguments to allow users to
customize the appearance, size, and position of your windows.
@@ -217,14 +224,14 @@ under FLTK control are closed by the user or your program.
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:
+header files. This is usually done using the \p -I option:
\code
CC -I/usr/local/include ...
gcc -I/usr/local/include ...
\endcode
-The <tt>fltk-config</tt> script included with FLTK can be
+The \p fltk-config script included with FLTK can be
used to get the options that are required by your compiler:
\code
@@ -248,7 +255,7 @@ classes, Fl_Help_Dialog widget, and system icon support.
The libraries are named "fltk.lib", "fltkgl.lib", "fltkforms.lib",
and "fltkimages.lib", respectively under Windows.
-As before, the <tt>fltk-config</tt> script included with FLTK can be
+As before, the \p fltk-config script included with FLTK can be
used to get the options that are required by your linker:
\code
@@ -267,7 +274,7 @@ CC ... `fltk-config --use-images --ldflags`
CC ... `fltk-config --use-forms --use-gl --use-images --ldflags`
\endcode
-Finally, you can use the <tt>fltk-config</tt> script to
+Finally, you can use the \p fltk-config script to
compile a single source file as a FLTK program:
\code
@@ -278,15 +285,15 @@ fltk-config --use-images --compile filename.cpp
fltk-config --use-forms --use-gl --use-images --compile filename.cpp
\endcode
-Any of these will create an executable named <tt>filename</tt>.
+Any of these will create an executable named \p filename.
\section basics_makefile Compiling Programs with Makefiles
-The previous section described how to use <tt>fltk-config</tt> to
+The previous section described how to use \p fltk-config to
build a program consisting of a single source file from the command
line, and this is very convenient for small test programs.
-But <tt>fltk-config</tt> can also be used to set the compiler and
-linker options as variables within a <tt>Makefile</tt> that can be
+But \p fltk-config can also be used to set the compiler and
+linker options as variables within a \p Makefile that can be
used to build programs out of multiple source files:
\code
@@ -329,9 +336,9 @@ Controls (COMCTRL32.LIB), and WinSock2 (WS2_32.LIB) libraries to
the "Link" settings.
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.
+WIN32 applications. If you want to use the standard C \p main()
+function as the entry point, FLTK includes a \p WinMain()
+function that will call your \p main() function for you.
<I>Note: The Visual C++ 5.0 optimizer is known to cause problems with
many programs. We only recommend using the "Favor Small Code"
@@ -342,12 +349,12 @@ better and can be used with the "optimized for speed" setting.
All public symbols in FLTK start with the characters 'F' and 'L':
-\li Functions are either <tt>Fl::foo()</tt> or <tt>fl_foo()</tt>.
+\li Functions are either \p Fl::foo() or \p fl_foo().
-\li Class and type names are capitalized: <tt>Fl_Foo</tt>.
+\li Class and type names are capitalized: \p Fl_Foo.
-\li <A href="enumerations.html">Constants and enumerations</A>
- are uppercase: <tt>FL_FOO</tt>.
+\li \ref enumerations "Constants and enumerations"
+ are uppercase: \p FL_FOO.
\li All header files start with <tt><FL/...></tt>.
@@ -362,7 +369,7 @@ The proper way to include FLTK header files is:
\endcode
\note
-Case <I>is</I> significant on many operating systems,
+Case \e is significant on many operating systems,
and the C standard uses the forward slash (/) to
separate directories. <i>Do not use any of the following
include lines:</i>