Symbols
#include <FL/Fl_Object.H>

Symbols are provided for Forms compatability. To avoid code bloat they are not automatically linked in. The Forms-compatable function fl_show_form() will install them, or you can do it yourself. Calling will cause all objects to draw symbols in their labels (if they have a label() that starts with '@'). This is done by replacing the entry for FL_NORMAL_LABEL with FL_SYMBOL_LABEL. Instead you can do to make a single object draw it's label as a symbol (the label() must still start with a '@').

The @ sign may be followed by a '#' which forces square scaling, and by a digit which is an angle to rotate, 6 meaning no rotation, and the other digits laid out as in a numeric keypad. There is a built-in set of symbols:

int fl_draw_symbol(const char* n,int x,int y,int w,int h,uchar c);

You can add extra symbols by defining a function to draw the symbol and then calling fl_add_symbol to put it in the table:

int fl_add_symbol(const char *, void (*f)(uchar), int scalable=1);

Call this to define a new symbol. The string is the symbol name, without any leading '@'. If scalable is zero then it does not do fl_scale before calling the function. The passed function is called to draw the symbol, the argument is the fl_color() to use. Before it is called, fl_translate() and fl_scale() have been done so that a 1x1 square covers the area the symbol should take.

(back to contents)