Wt: Wt::WRectArea Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::WRectArea Class Reference

A interactive area in a widget, specified by a rectangle. More...

`#include <Wt/WRectArea>`

Inheritance diagram for Wt::WRectArea:
[legend]

List of all members.

## Public Member Functions
| WRectArea ()
| Default constructor.
| WRectArea (int x, int y, int width, int height)
| Creates a rectangular area with given geometry.
| WRectArea (double x, double y, double width, double height)
| Creates a rectangular area with given geometry.
| WRectArea (const WRectF &rect)
| Creates a rectangular area with given geometry.
void | setX (int x)
| Sets the top-left X coordinate.
int | x () const
| Returns the top-left X coordinate.
void | setY (int y)
| Sets the top-left Y coordinate.
int | y () const
| Returns the top-left Y coordinate.
void | setWidth (int width)
| Sets the width.
int | width () const
| Returns the width.
void | setHeight (int height)
| Sets the height.
int | height () const
| Returns the height.

## Detailed Description

A interactive area in a widget, specified by a rectangle.

The area may be added to a WImage or WPaintedWidget to provide interactivity on a rectangular area of the image. The rectangle is specified in pixel coordinates.

     Wt::WImage *image = new Wt::WImage("images/family.jpg");
     Wt::WRectArea *face = new Wt::WRectArea(100, 120, 200, 130);
     face->setToolTip("Uncle Frank");
     image->addArea(face);

See also:
  WImage::addArea(), WPaintedWidget::addArea()
  WCircleArea, WPolygonArea

## Constructor & Destructor Documentation

Wt::WRectArea::WRectArea | ( |  | ) |

Default constructor.

The default constructor creates a rectangular area spans the whole widget.

Wt::WRectArea::WRectArea | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height
| ) |  |

Creates a rectangular area with given geometry.

The arguments are in pixel units.

Wt::WRectArea::WRectArea | ( | double | x,
|  | double | y,
|  | double | width,
|  | double | height
| ) |  |

Creates a rectangular area with given geometry.

The arguments are in pixel units.

Wt::WRectArea::WRectArea | ( | const WRectF & | rect | ) |

Creates a rectangular area with given geometry.

The `rect` argument is in pixel units.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator