From dc70b69502de6769c8fe109161f984494a0c00b8 Mon Sep 17 00:00:00 2001
From: Michael R Sweet The second form indicates that a region is damaged. If only these
calls are done in a window (no calls to damage(n)) then FLTK
will clip to the union of all these calls before drawing anything.
This can greatly speed up incremental displays. The mask bits are
or'd into damage() unless this is a Fl_Window widget. The third form returns the bitwise-OR of all damage(n)
- calls done since the last draw(). The public method
-redraw() does damage(FL_DAMAGE_ALL), but the
-implementation of your widget can call the private damage(n). void Fl_Widget::damage(uchar mask)
- The first form indicates that a partial update of the object is
+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 drawing.
- The public method Fl_Widget::redraw() simply does
-Fl_Widget::damage(FL_DAMAGE_ALL).
+draw() routine can examine these bits to limit what it is
+drawing. The public method Fl_Widget::redraw() simply does
+ Fl_Widget::damage(FL_DAMAGE_ALL), but the implementation of
+your widget can call the private damage(n).
void Fl_Widget::damage(uchar mask, int x, int y, int w, int h)
uchar Fl_Widget::damage()
The second version lets you do this test against an arbitrary string.
If you don't have RTTI you can use the clumsy FLTK mechanisim, by having type() have a unique value. These unique values must be greater than the symbol FL_RESERVED_TYPE (which is 100). - Look through the header files for FL_RESERVED_TYPE to find an -unused number. If you make a subclass of Fl_Group you must -use FL_GROUP + n, and if you make a subclass of Fl_Window -you must use FL_WINDOW + n (in both cases n is in the -range 1 to 7).
+Look through the header files for FL_RESERVED_TYPE to find an +unused number. If you make a subclass of Fl_Window +you must use FL_WINDOW + n (n must be in the +range 1 to 7).damage() contains the bitwise-OR of all the damage(n) calls to this widget since it was last drawn. This can be used for minimal update, by only redrawing the parts whose bits are set. FLTK -will turn all the bits on if it thinks the entire widget must be -redrawn (for instance due to an expose event).
+will turn on the FL_DAMAGE_ALL bit if it thinks the entire widget +must be redrawn (for instance due to an expose event).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 @@ -285,8 +283,8 @@ void MyClass::slider_cb() { // normal method If you make the handle() method, you can quickly pass all the events to the children using the Fl_Group::handle() method. -Note that you don't need to override handle() if your -composite widget does nothing other than pass events to the children: +You don't need to override handle() if your composite widget +does nothing other than pass events to the children:
int MyClass::handle(int event) {
@@ -373,4 +371,4 @@ rather than draw_box( x(), y(), w(), h()).
You may also want to subclass Fl_Window in order to get
access to different visuals or to change other attributes of the
windows. See Appendix F - Operating
-System Issues for more information.