fltk::Rectangle Class Reference

Inheritance diagram for fltk::Rectangle:

Inheritance graph
[legend]
List of all members.

Public Member Functions

int x () const
int y () const
int w () const
int h () const
int r () const
int b () const
void x (int v)
void y (int v)
void w (int v)
void h (int v)
void set_x (int v)
void set_y (int v)
void set_r (int v)
void set_b (int v)
void set (int x, int y, int w, int h)
void set (const Rectangle &r, int w, int h, int flags=0)
void move_x (int d)
void move_y (int d)
void move_r (int d)
void move_b (int d)
void inset (int d)
void move (int dx, int dy)
bool empty () const
bool not_empty () const
int center_x () const
int center_y () const
int baseline_y () const
 Rectangle (int x, int y, int w, int h)
 Rectangle (int w, int h)
 Rectangle (const Rectangle &r)
 Rectangle (const Rectangle &r, int w, int h, int flags=0)
bool contains (int x, int y) const
void merge (const Rectangle &r)

Detailed Description

A base class for fltk::Widget


Constructor & Destructor Documentation

fltk::Rectangle::Rectangle int  x,
int  y,
int  w,
int  h
[inline]
 

Constructor that sets x(), y(), w(), and h().

fltk::Rectangle::Rectangle int  w,
int  h
[inline]
 

Constructor that sets x() and y() to zero, and sets w() and h().

fltk::Rectangle::Rectangle const Rectangle r  )  [inline]
 

Copy constructor.

fltk::Rectangle::Rectangle const Rectangle r,
int  w,
int  h,
int  flags = 0
[inline]
 

Constructor that calls set().


Member Function Documentation

int fltk::Rectangle::b  )  const [inline]
 

Return y()+h(), the bottom edge of the rectangle.

int fltk::Rectangle::baseline_y  )  const
 

Where to put baseline to center current font nicely

int fltk::Rectangle::center_x  )  const [inline]
 

Integer center position. Rounded to the left if w() is odd.

int fltk::Rectangle::center_y  )  const [inline]
 

Integer center position. Rounded to lower y if h() is odd.

bool fltk::Rectangle::contains int  x,
int  y
const [inline]
 

True if rectangle contains the pixel who's upper-left corner is at x,y

bool fltk::Rectangle::empty  )  const [inline]
 

True if w() or h() are less or equal to zero.

void fltk::Rectangle::h int  v  )  [inline]
 

Change h() by moving the bottom edge. y() does not change.

int fltk::Rectangle::h  )  const [inline]
 

Distance between top and bottom edges

void fltk::Rectangle::inset int  d  )  [inline]
 

Move all edges in by d. See also Symbol::inset()

void fltk::Rectangle::merge const Rectangle r  ) 
 

calculate bounding box of this union r

void fltk::Rectangle::move int  dx,
int  dy
[inline]
 

Move entire rectangle by given distance in x and y.

void fltk::Rectangle::move_b int  d  )  [inline]
 

Add d to b() and h().

void fltk::Rectangle::move_r int  d  )  [inline]
 

Add d to r() and w().

void fltk::Rectangle::move_x int  d  )  [inline]
 

Add d to x() without changing r() (it reduces w() by d).

void fltk::Rectangle::move_y int  d  )  [inline]
 

Add d to y() without changing b() (it reduces h() by d).

bool fltk::Rectangle::not_empty  )  const [inline]
 

Same as !empty(), true if w() and h() are both greater than zero.

int fltk::Rectangle::r  )  const [inline]
 

Return x()+w(), the right edge of the rectangle.

void fltk::Rectangle::set const Rectangle r,
int  w,
int  h,
int  flags = 0
 

Sets x, y, w, h so that's it's centered or aligned (if flags!=0) inside the source r

void fltk::Rectangle::set int  x,
int  y,
int  w,
int  h
[inline]
 

Set x(), y(), w(), and h() all at once.

void fltk::Rectangle::set_b int  v  )  [inline]
 

Change b() without changing y(), by changine the height.

void fltk::Rectangle::set_r int  v  )  [inline]
 

Change r() without changing x(), by changine the width.

void fltk::Rectangle::set_x int  v  )  [inline]
 

Change x() without changing r(), by changing the width.

void fltk::Rectangle::set_y int  v  )  [inline]
 

Change y() without changing b(), by changing the height.

void fltk::Rectangle::w int  v  )  [inline]
 

Change w() by moving the right edge. x() does not change.

int fltk::Rectangle::w  )  const [inline]
 

Distance between left and right edges

void fltk::Rectangle::x int  v  )  [inline]
 

Move the rectangle so the left edge is at v.

int fltk::Rectangle::x  )  const [inline]
 

Left edge

void fltk::Rectangle::y int  v  )  [inline]
 

Move the rectangle so the top edge is at v.

int fltk::Rectangle::y  )  const [inline]
 

Top edge


Tue Jun 27 02:19:50 2006. FLTK Dock is copyright © 2006 by MD. Z. Hossain