From 7ac3b8e5b9cd4920c954cb3ba9011d07c4fb6b3d Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 6 Sep 2006 07:29:20 +0000 Subject: Updated documentation on Fl::box_dx and friends. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5424 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/Fl.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'documentation') diff --git a/documentation/Fl.html b/documentation/Fl.html index a20e913d4..701e9c314 100644 --- a/documentation/Fl.html +++ b/documentation/Fl.html @@ -424,19 +424,43 @@ handle()).

int box_dh(Fl_Boxtype);

Returns the height offset for the given boxtype. +See box_dy.

int box_dw(Fl_Boxtype);

Returns the width offset for the given boxtype. +See box_dy.

int box_dx(Fl_Boxtype);

Returns the X offset for the given boxtype. +See box_dy.

int box_dy(Fl_Boxtype);

Returns the Y offset for the given boxtype. +

These functions return the offset values necessary for a given +boxtype, useful for computing the area inside a box's borders, to +prevent overdrawing the borders. + +

For instance, in the case of a boxtype like FL_DOWN_BOX +where the border width might be 2 pixels all around, the above +functions would return 2, 2, 4, and 4 for box_dx, +box_dy, box_dw, and box_dh +respectively. + +

An example to compute the area inside a widget's box(): +

+      int X = yourwidget->x() + Fl::box_dx(yourwidget->box());
+      int Y = yourwidget->y() + Fl::box_dy(yourwidget->box());
+      int W = yourwidget->w() - Fl::box_dw(yourwidget->box());
+      int H = yourwidget->h() - Fl::box_dh(yourwidget->box());
+
+

These functions are mainly useful in the draw() code +for deriving custom widgets, where one wants to avoid drawing +over the widget's own border box(). +

int check();

Same as Fl::wait(0). Calling this during a big calculation -- cgit v1.2.3