From cda7f614627d3bcf303ab1ad92d5d7fe53f3e3af Mon Sep 17 00:00:00 2001
From: Matthias Melcher
The Fl::set_labeltype method can also be used to overload an existing label type such as FL_NORMAL_LABEL.
+It is also possible to define your own drawings and add +them to the symbol list, so they can be rendered as part of +any label.
+ +To create a new symbol, you implement a drawing function +void drawit(Fl_Color c) which typically uses the +complex drawing functions +to generate a vector shape inside a two-by-two units sized box +around the origin. This function is then linked into the symbols +table using fl_add_symbol:
+ ++int fl_add_symbol(const char *name, void (*drawit)(Fl_Color), int scalable) ++ +
name is the name of the symbol without the "@"; scalable +must be set to 1 if the symbol is generated using scalable vector drawing +functions.
+Callbacks are functions that are called when the value of a diff --git a/documentation/drawing.html b/documentation/drawing.html index d7d36def6..9e3b6e0b0 100644 --- a/documentation/drawing.html +++ b/documentation/drawing.html @@ -300,11 +300,12 @@ href="#complex">transformation matrix, so you should only call these while the matrix is set to the identity matrix (the default). -
Draw a single pixel at the given coordinates. -
Color a rectangle that exactly fills the given bounding box. @@ -316,43 +317,44 @@ color this is done by drawing a solid-colored block using fl_draw_image() so that the correct color shade is produced. -
Draw a 1-pixel border inside this bounding box. -
Draw one or two lines between the given points. -
Outline a 3 or 4-sided polygon with lines. -
Fill a 3 or 4-sided polygon. The polygon must be convex. -
Draw horizontal and vertical lines. A horizontal line is drawn first, then a vertical, then a horizontal. -
Draw vertical and horizontal lines. A vertical line is drawn first, then a horizontal, then a vertical. -
Draw ellipse sections using integer coordinates. These functions match the rather limited circle drawing code provided @@ -389,40 +391,40 @@ severely limits the accuracy of these functions for complex graphics, so use OpenGL when greater accuracy and/or performance is required. -
Save and restore the current transformation. The maximum depth of the stack is 4. -
Concatenate another transformation onto the current one. The rotation angle is in degrees (not radians) and is counter-clockwise. -
Start and end drawing lines. -
Start and end drawing a closed sequence of lines. -
Start and end drawing a convex filled polygon. -
Start and end drawing a complex filled polygon. This polygon may be concave, may have holes in it, or may be several @@ -451,11 +453,11 @@ fl_begin_complex_polygon() and fl_begin_loop() and replace each fl_gap() with fl_end_loop();fl_begin_loop().
-Add a series of points on a Bezier curve to the path. The curve ends (and two of the points) are at x,y and x3,y3. @@ -471,7 +473,7 @@ in degrees counter-clockwise from 3 o'clock. If end is less than start then it draws the arc in a clockwise direction. -
fl_circle() is equivalent to fl_arc(...,0,360) but may be faster. It must be the only thing in the path: if you @@ -494,8 +496,8 @@ want a circle as part of a complex polygon you must use fl_arc(). It is undefined whether this location or the characters are modified by the current transformation. -
Draw a nul-terminated string or an array of n characters starting at the given location. Text is aligned to the left and to @@ -527,32 +529,33 @@ to look for symbol names starting with the "@" character.
The text length is limited to 1024 caracters per line. -
Measure how wide and tall the string will be when printed by the fl_draw(...align) function. If the incoming w is non-zero it will wrap to that width. -
Recommended minimum line spacing for the current font. You can also just use the value of size passed to fl_font(). -
Recommended distance above the bottom of a fl_height() tall box to draw the text at so it looks centered vertically in that box. -
Return the pixel width of a nul-terminated string, a sequence of n characters, or a single character in the current font. -
Unparse a shortcut value as used by Fl_Button @@ -598,7 +601,7 @@ the display. fl_font(a,b). This can be used to save/restore the font. -
FLTK 1 supports western character sets using the eight bit encoding of the user-selected global code page. For MS Windows and X11, the code @@ -748,7 +751,7 @@ the first one may be greater than zero.
If D is 4 or more, you must fill in the unused bytes with zero.
-Draws XPM image data, with the top-left corner at the given position. The image is dithered on 8-bit displays so you won't lose color space @@ -767,7 +770,7 @@ fl_draw_pixmap(foo, X, Y); Fl_Color argument. To draw with true transparency you must use the Fl_Pixmap class. -
An XPM image contains the dimensions in its data. This function finds and returns the width and height. The return diff --git a/documentation/functions.html b/documentation/functions.html index 26a19b74c..635c424f8 100644 --- a/documentation/functions.html +++ b/documentation/functions.html @@ -11,39 +11,138 @@ A.
When the virtual function Fl_Widget::draw() is