typedef Fl_Labeltype
Fl_Labeltype is a pointer to the structure
Fl_Labeltype_, which contains the information needed to draw
text labels. This is used by Fl_Widget::label_type().
Members
void (*Fl_Labeltype_::draw_)(const Fl_Labeltype_* this, const char* label,
int,int,int,int, Fl_Color fill, Fl_Flags);
Pointer to the function that draws the text. The first argument is
the Fl_Labeltype_ itself, this allows access to the data
value. Next is the text string. The next four integers are the
x,y,w,h to fit the label into. The next is the color to fill the
interior of the letters with. The last argument is a set of bitflags.
The following values are of use to the labeltypes, ignore any other
bits that are on:
- FL_ALIGN_TOP - align the label at the top of the widget.
- FL_ALIGN_BOTTOM - align the label at the bottom of the
widget.
- FL_ALIGN_LEFT - align the label to the left of the widget.
- FL_ALIGN_RIGHT - align the label to the right of the
widget.
- FL_ALIGN_CLIP - clip the label to the widget's bounding
box.
- FL_ALIGN_WRAP - wrap the label text as needed.
- FL_SHORTCUT_LABEL - interpret &x to
underscore under the next letter.
- FL_INACTIVE - gray out the widget.
- FL_VALUE - draw the label atop a pushed-in box (usually
you can ignore this).
- FL_FOCUSED - draw the label atop a box with keyboard
focus (usually you can ignore this).
- FL_HIGHLIGHT - draw the label atop a highlighted box
(usually you can ignore this).
The label should be drawn inside this bounding box. Ignore the
setting of FL_ALIGN_INSIDE. Outside labels are handled by
the Fl_Group code by modifying the bounding box before this is called.
If none of the align flags are on you should center the label in
the widget.
The function is not called if the label value is NULL.
const void* Fl_Labeltype_::data;
This is a pointer to arbitrary data used by draw_(). Often
several labeltypes use the same draw_() but different data.
Methods
void Fl_Labeltype_::draw(const char* m, int x,int y,int w,int h,
Fl_Color c, Fl_Flags f=0) const
This is the public method to draw the label. It is simply an inline
function to call draw_ with this labeltype as the first
argument.