Author: AlbrechtS
Date: 2009-02-20 00:15:32 -0800 (Fri, 20 Feb 2009)
New Revision: 6665
Log:
Documentation updates for STR #2142 (protected draw methods).


Modified:
   branches/branch-1.3/CHANGES
   branches/branch-1.3/FL/Fl_Widget.H
   branches/branch-1.3/documentation/src/drawing.dox

Modified: branches/branch-1.3/CHANGES
===================================================================
--- branches/branch-1.3/CHANGES 2009-02-18 09:27:54 UTC (rev 6664)
+++ branches/branch-1.3/CHANGES 2009-02-20 08:15:32 UTC (rev 6665)
@@ -1,5 +1,6 @@
 CHANGES IN FLTK 1.3.0
 
+       - All draw() methods of widgets are now protected (STR #2142).
        - The new configure option --enable-x11 (lowercase 'x') enables
          cygwin builds under Windows (with --enable-cygwin) to use X11
          instead of GDI drawing (STR #2147) and is ignored otherwise.

Modified: branches/branch-1.3/FL/Fl_Widget.H
===================================================================
--- branches/branch-1.3/FL/Fl_Widget.H  2009-02-18 09:27:54 UTC (rev 6664)
+++ branches/branch-1.3/FL/Fl_Widget.H  2009-02-20 08:15:32 UTC (rev 6665)
@@ -177,8 +177,17 @@
       Never call this function directly. FLTK will schedule redrawing whenever
       needed. If your widget must be redrawn as soon as possible, call redraw()
       instead.
-    
+
       Override this function to draw your own widgets.
+
+      If you ever need to call another widget's draw method <I>from within your
+      own draw method</I>, e.g. for an embedded scrollbar, you must downcast 
the
+      embedded widget's pointer to Fl_Widget* and call the virtual draw() 
method.
+
+      \code
+        Fl_Widget *s = &scroll;                // scroll is an embedded 
Fl_Scrollbar
+       s->draw();                      // calls Fl_Scrollbar::draw()
+      \endcode
    */
   virtual void draw() = 0;
 

Modified: branches/branch-1.3/documentation/src/drawing.dox
===================================================================
--- branches/branch-1.3/documentation/src/drawing.dox   2009-02-18 09:27:54 UTC 
(rev 6664)
+++ branches/branch-1.3/documentation/src/drawing.dox   2009-02-20 08:15:32 UTC 
(rev 6665)
@@ -13,17 +13,12 @@
     To write code here, you must subclass one of the existing Fl_Widget
     classes and implement your own version of draw().
 
-\li The most common place is inside the virtual method
-    <A href="subclassing.html#draw"><tt>Fl_Widget::draw()</tt></A>. 
-    To write code here, you must subclass one of the existing Fl_Widget
-    classes and implement your own version of draw().
-
 \li You can also write <A href="common.html#boxtypes">boxtypes</A> and
     <A href="common.html#labeltypes">labeltypes</A>. These are small
     procedures that can be called by existing
-    <A HREF="subclassing.html#draw"><tt>Fl_Widget::draw()</tt></A>
-    methods. These "types" are identified by an 8-bit index that is stored
-    in the widget's box(), labeltype(), and possibly other properties.
+    Fl_Widget::draw() methods. These "types" are identified by an 8-bit
+    index that is stored in the widget's box(), labeltype(), and possibly
+    other properties.
 
 \li You can call Fl_Window::make_current() to do incremental update of a
     widget. Use Fl_Widget::window() to find the window.

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to