41 : x_(0), y_(0), w_(0), h_(0) {}
46 : x_(0), y_(0), w_(W), h_(H) {}
51 : x_(X), y_(Y), w_(W), h_(H) {}
60 : x_(X), y_(Y), w_(W), h_(H) {
66 : x_(widget.x()), y_(widget.y()), w_(widget.w()), h_(widget.h()) {}
70 : x_(widget->x()), y_(widget->y()), w_(widget->w()), h_(widget->h()) {}
72 int x()
const {
return x_; }
73 int y()
const {
return y_; }
74 int w()
const {
return w_; }
75 int h()
const {
return h_; }
80 int r()
const {
return x_ + w_; }
84 int b()
const {
return y_ + h_; }
86 void x(
int X) { x_ = X; }
87 void y(
int Y) { y_ = Y; }
88 void w(
int W) { w_ = W; }
89 void h(
int H) { h_ = H; }
91 void r(
int R) { w_ = R - x_; }
92 void b(
int B) { h_ = B - y_; }
142 void inset(
int left,
int top,
int right,
int bottom) {
145 w_ -= (left + right);
146 h_ -= (top + bottom);
150 return (lhs.x_==rhs.x_) && (lhs.y_==rhs.y_) && (lhs.w_==rhs.w_) && (lhs.h_==rhs.h_);
Fl_Boxtype
FLTK standard box types.
Definition: Enumerations.H:638
Rectangle with standard FLTK coordinates (X, Y, W, H).
Definition: Fl_Rect.H:30
int r() const
gets the right edge (x + w).
Definition: Fl_Rect.H:80
int y() const
gets the y coordinate (top edge)
Definition: Fl_Rect.H:73
int b() const
gets the bottom edge (y + h).
Definition: Fl_Rect.H:84
Fl_Rect(int W, int H)
This constructor creates a rectangle with x = y = 0 and the given width and height.
Definition: Fl_Rect.H:45
Fl_Rect(const Fl_Widget &widget)
This constructor creates a rectangle based on a widget's position and size.
Definition: Fl_Rect.H:65
Fl_Rect(const Fl_Widget *const widget)
This constructor creates a rectangle based on a widget's position and size.
Definition: Fl_Rect.H:69
void x(int X)
sets the x coordinate (left edge)
Definition: Fl_Rect.H:86
void r(int R)
sets the width based on R and x
Definition: Fl_Rect.H:91
int w() const
gets the width
Definition: Fl_Rect.H:74
Fl_Rect(int X, int Y, int W, int H, Fl_Boxtype bt)
This constructor creates a rectangle with the given x,y coordinates and the given width and height re...
Definition: Fl_Rect.H:59
int h() const
gets the height
Definition: Fl_Rect.H:75
void b(int B)
sets the height based on B and y
Definition: Fl_Rect.H:92
Fl_Rect(int X, int Y, int W, int H)
This constructor creates a rectangle with the given x,y coordinates and the given width and height.
Definition: Fl_Rect.H:50
Fl_Rect()
The default constructor creates an empty rectangle (x = y = w = h = 0).
Definition: Fl_Rect.H:40
void inset(Fl_Boxtype bt)
Move all edges in by the frame size of box type bt.
Definition: Fl_Rect.H:125
void y(int Y)
sets the y coordinate (top edge)
Definition: Fl_Rect.H:87
int x() const
gets the x coordinate (left edge)
Definition: Fl_Rect.H:72
void w(int W)
sets the width
Definition: Fl_Rect.H:88
void h(int H)
sets the height
Definition: Fl_Rect.H:89
void inset(int left, int top, int right, int bottom)
Move all edges in by left, top, right, bottom.
Definition: Fl_Rect.H:142
void inset(int d)
Move all edges in by d.
Definition: Fl_Rect.H:104
static int box_dx(Fl_Boxtype)
Returns the X offset for the given boxtype.
Definition: fl_boxtype.cxx:379
static int box_dw(Fl_Boxtype)
Returns the width offset for the given boxtype.
Definition: fl_boxtype.cxx:410
static int box_dy(Fl_Boxtype)
Returns the Y offset for the given boxtype.
Definition: fl_boxtype.cxx:404
static int box_dh(Fl_Boxtype)
Returns the height offset for the given boxtype.
Definition: fl_boxtype.cxx:416