From 4c53a5d8f4f23358a101ef6bda4b6b8ea4b95274 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Sun, 31 Jan 1999 07:43:16 +0000 Subject: Added optimization for SGI builds (mike: please run autoconf before making a distribution). Documentation fixes. git-svn-id: file:///fltk/svn/fltk/trunk@259 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/subclassing.html | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'documentation/subclassing.html') diff --git a/documentation/subclassing.html b/documentation/subclassing.html index 7ccf44fb9..943b954eb 100644 --- a/documentation/subclassing.html +++ b/documentation/subclassing.html @@ -71,9 +71,9 @@ flags(ACTIVE|VISIBLE);
  • Fl_Widget::test_shortcut
  • Fl_Widget::type
  • -

    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) const

    +

    void Fl_Widget::draw_box() const +
    void Fl_Widget::draw_box(Fl_Boxtype b, ulong c) 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_label() const +

    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

    +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.

    FL_ALIGN_INSIDE has been forced on so the label will appear inside the passed bounding box. This is designed for parent groups to draw labels with.

    -

    void Fl_Widget::set_flag(SHORTCUT_LABEL)

    +

    void Fl_Widget::set_flag(SHORTCUT_LABEL)

    Modifies draw_label() so that '&' characters cause an underscore to be printed under the next letter. -

    void Fl_Widget::set_visible() -
    void Fl_Widget::clear_visible()

    +

    void Fl_Widget::set_visible() +
    void Fl_Widget::clear_visible()

    Fast inline versions of Fl_Widget::hide() and Fl_Widget::show(). These do not send the FL_HIDE and FL_SHOW events to the widget. -

    int Fl_Widget::test_shortcut() const -
    static int Fl_Widget::test_shortcut(const char *s)

    +

    int Fl_Widget::test_shortcut() const +
    static int Fl_Widget::test_shortcut(const char *s)

    The first version tests Fl_Widget::label() against the current event (which should be a FL_SHORTCUT event). If the label contains a '&' character and the character after it matches the key @@ -147,8 +147,8 @@ flag is off, if the label is NULL or does not have a '&' character in it, or if the keypress does not match the character.

    The second version lets you do this test against an arbitrary string.

    -

    uchar Fl_Widget::type() const -
    void Fl_Widget::type(uchar t)

    +

    uchar Fl_Widget::type() const +
    void Fl_Widget::type(uchar t)

    The property Fl_Widget::type() can return an arbitrary 8-bit identifier, and can be set with the protected method type(uchar t) . This value had to be provided for Forms compatibility, but you can @@ -240,7 +240,7 @@ must be redrawn (e.g. for 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 -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:

  • draw_outside_label
  • update_child
  • -

    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). -

    void Fl_Group::update_child(Fl_Widget&)

    +

    void Fl_Group::update_child(Fl_Widget&)

    Draws the child only if its damage() is non-zero. You should call this on all the children if your own damage is equal to FL_DAMAGE_CHILD. Nothing is done if the child is not visible() @@ -377,7 +377,7 @@ can be useful if your widget wants to occupy an entire window, and can also be used to take advantage of system-provided clipping, or to work with a library that expects a system window ID to indicate where to draw. -

    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:

      -- cgit v1.2.3