summaryrefslogtreecommitdiff
path: root/documentation/drawing.html
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-05-13 20:03:20 +0000
committerBill Spitzak <spitzak@gmail.com>2000-05-13 20:03:20 +0000
commitd5b47034a7575151963f1fc85a4630f68208e73a (patch)
tree023ff7f35eeda76f2343cd895b4e2ea2101319b8 /documentation/drawing.html
parent2d826eb564160432259480504537e5797eced931 (diff)
Added Fl::first_window(window) to change which window is at the top of
the window list. This window is used as the "parent" of any modal windows you create so it is a good idea to be able to change it. Normally it is whatever window got the last event. Fixed Fl_Menu::global handler to use first_window so if a modal window pops up in response it is parented to the window containing the menubar rather than the current top window. This was an annoying bug! Copied fl_line_style() and the line_style demo over from fltk 2.0 because I am tired of mailing this code to people. Better to advertise this as "added fl_line_style() function to set line thickness, dash patterns, and end caps". Fixed the documentation for these changes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1117 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation/drawing.html')
-rw-r--r--documentation/drawing.html41
1 files changed, 41 insertions, 0 deletions
diff --git a/documentation/drawing.html b/documentation/drawing.html
index e29450c21..225806ee6 100644
--- a/documentation/drawing.html
+++ b/documentation/drawing.html
@@ -27,6 +27,7 @@ drawing functions:
<UL>
<LI><A href=#clipping>Clipping</A></LI>
<LI><A href=#colors>Colors</A></LI>
+<LI><A href=#lines>Line dashes and thickness</A></LI>
<LI><A href=#fast>Fast Shapes</A></LI>
<LI><A href=#complex>Complex Shapes</A></LI>
<LI><A href=#text>Text</A></LI>
@@ -82,6 +83,46 @@ for state save/restore.
possible match to the RGB color is used. The RGB color is used
directly on TrueColor displays. For colormap visuals the nearest index
in the gray ramp or color cube is used.
+
+<h3><A name=lines>Line dashes and thickness</a></h3>
+
+<h4>void fl_line_style(int style, int width=0, char* dashes=0)</h4>
+
+Set how to draw lines (the "pen"). If you change this it is your
+responsibility to set it back to the default with
+<tt>fl_line_style(0)</tt>.
+
+<p><i>style</i> is a bitmask in which you 'or' the following values. If
+you don't specify a dash type you will get a solid line. If you don't
+specify a cap or join type you will get a system-defined default of
+whatever value is fastest.
+
+<ul>
+<li><tt>FL_SOLID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------</tt>
+<li><tt>FL_DASH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - - - -</tt>
+<li><tt>FL_DOT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .......</tt>
+<li><tt>FL_DASHDOT&nbsp;&nbsp;&nbsp; - . - .</tt>
+<li><tt>FL_DASHDOTDOT - .. -</tt>
+<li><tt>FL_CAP_FLAT</tt>
+<li><tt>FL_CAP_ROUND</tt>
+<li><tt>FL_CAP_SQUARE</tt> (extends past end point 1/2 line width)
+<li><tt>FL_JOIN_MITER</tt> (pointed)
+<li><tt>FL_JOIN_ROUND</tt>
+<li><tt>FL_JOIN_BEVEL</tt> (flat)
+</ul>
+
+<p><i>width</i> is the number of pixels thick to draw the lines. Zero
+results in the system-defined default, which on both X and Windows is
+somewhat different and nicer than 1.
+
+<p><i>dashes</i> is a pointer to an array of dash lengths, measured in
+pixels. The first location is how long to draw a solid portion, the
+next is how long to draw the gap, then the solid, etc. It is
+terminated with a zero-length entry. A null pointer or a zero-length
+array results in a solid line. Odd array sizes are not supported and
+result in undefined behavior. <i>The dashes array does not work on
+Windows 95/98, use the dash styles instead.</i>
+
<H3><A name=fast>Fast Shapes</A></H3>
These are used to draw almost all the FLTK widgets. They draw on
exact pixel boundaries and are as fast as possible, and their behavior