typedef Fl_Boxtype
Fl_Boxtype is a pointer to the structure
Fl_Boxtype_, which contains the information needed to draw
the rectangles around and inside widgets. Boxtypes are used by
Fl_Widget::box().

Members
void (*Fl_Boxtype_::draw_)(const Fl_Boxtype_* this,
int,int,int,int, Fl_Color fill, Fl_Flags);
Pointer to the function that draws the box. The first argument is the
Fl_Boxtype_ itself, this allows access to the down or
data value. The next four integers are the x,y,w,h of the
box to draw. The next is the color to fill the interior of the box
with. The last argument is a set of bitflags. The following values
are of use to the boxes, ignore any other bits that are on:
- FL_INACTIVE - gray out the widget.
- FL_VALUE - draw the box pushed in, you can ignore this if
the box type is already pushed in.
- FL_FOCUSED - draw the button with keyboard focus.
- FL_HIGHLIGHT - draw the box highlighted. Usually you can
ignore this because the fill color will also be changed.
- FL_FRAME_ONLY - it is not necessary to fill in the
interior of the box. You can fill it in anyway but obeying this flag
can make drawing faster and flicker less.
A simple drawing function might fill a rectangle with the given color
and then draw a black outline:
void xyz_draw(const Fl_Boxtype_*, int x, int y, int w, int h,
Fl_Color c, Fl_Flags f)
{
if (!(f&FL_FRAME_ONLY)) {
fl_color(c);
fl_rectf(x, y, w, h);
}
fl_color(FL_BLACK);
fl_rect(x, y, w, h);
}
const void* Fl_Boxtype_::data;
This is a pointer to arbitrary data used by draw_(). Often
several boxtypes use the same draw_() but different data.
const Fl_Boxtype_* Fl_Boxtype_::down;
It is very common that a boxtype can use another boxtype to draw
itself when FL_VALUE
is set. This pointer can be used to
store a pointer to that other boxtype. draw_() needs to
check FL_VALUE and call this->down->draw().
int dx_, dy_, dw_, dh_;
The values returned by the dx(), dy(), dw(), dh() methods.
Methods
void Fl_Boxtype_::draw(int x, int y, int w, int h, Fl_Color c,
Fl_Flags f=0) const
This is the public method to draw the box. It is simply an inline
function to call draw_ with this boxtype as the first
argument.
int Fl_Boxtype_::dx() const;
int Fl_Boxtype_::dy() const;
int Fl_Boxtype_::dw() const;
int Fl_Boxtype_::dh() const;
Return the offsets for the bounding box that should be subtracted when
drawing the label inside the box. These are all positive numbers, so
dx() and dy() are added to the x and y, while dw() and dh() are
subtracted from the width and height. Usually dw() is two times dx(),
and dh() is two times dy(), and usually dx() and dy() are equal.