From 4c53a5d8f4f23358a101ef6bda4b6b8ea4b95274 Mon Sep 17 00:00:00 2001
From: Bill Spitzak void Fl_Widget::damage(uchar mask)
+
+void Fl_Widget::damage(uchar mask)
void Fl_Widget::damage(uchar mask, int x, int y, int w, int h)
-
uchar Fl_Widget::damage()
uchar Fl_Widget::damage()
The first form indicates that a partial update of the object is
needed. The bits in mask are OR'd into damage(). Your
draw() routine can examine these bits to limit what it is
@@ -109,15 +109,15 @@ MyClass::draw() {
if (damage() & (FL_DAMAGE_ALL | 4)) draw_part3();
}
-void Fl_Widget::draw_box() const
-
+
void Fl_Widget::draw_box(Fl_Boxtype b, ulong c) constvoid Fl_Widget::draw_box() const
+
The first form draws this widget's box(), using the
dimensions of the widget. The second form uses b as the box
type and c as the color for the box.
-
void Fl_Widget::draw_box(Fl_Boxtype b, ulong c) constvoid Fl_Widget::draw_label() const
+
+align) const
This is the usual function for a draw() method to call to
draw the widget's label. It does not draw the label if it is supposed
to be outside the box (on the assumption that the enclosing group will
@@ -129,16 +129,16 @@ feature, like a moving slider. void Fl_Widget::draw_label() const
void Fl_Widget::draw_label(int x, int y, int w, int h) const
void Fl_Widget::draw_label(int x, int y, int w, int h, Fl_Align
-align) const
The second version lets you do this test against an arbitrary string.
-Expose events (and the above damage(b,x,y,w,h)) will cause draw() to be called with FLTK's clipping turned on. You can greatly speed up redrawing in some -cases by testing fl_clipped and fl_current_clip and +cases by testing fl_not_clipped(x,y,w,h) or fl_clip_box(...) and skipping invisible parts.
Besides the protected methods described above, FLTK provides a large
number of basic drawing functions, which are described
@@ -343,19 +343,19 @@ easier:
void Fl_Group::draw_child(Fl_Widget&)
+void Fl_Group::draw_child(Fl_Widget&)
This will force the child's damage() bits all to one and call
draw() on it, then clear the damage(). You should call
this on all children if a total redraw of your widget is requested, or
if you draw something (like a background box) that damages the child.
Nothing is done if the child is not visible() or if it is
clipped.
-void
-Fl_Group::draw_outside_label(Fl_Widget&) const
+void
+Fl_Group::draw_outside_label(Fl_Widget&) const
Draw the labels that are not drawn by
draw_label(). If you want more control over the label
positions you might want to call child->draw_label(x,y,w,h,a).
-
Subclassing Fl_Window is almost exactly like subclassing +
Subclassing Fl_Window is almost exactly like subclassing Fl_Widget, and in fact you can easily switch a subclass back and forth. Watch out for the following differences: