Wt  3.3.8
Public Member Functions | List of all members
Wt::WRectArea Class Reference

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

#include <Wt/WRectArea>

Inheritance diagram for Wt::WRectArea:
Inheritance graph
[legend]

Public Member Functions

 WRectArea ()
 Default constructor. More...
 
 WRectArea (int x, int y, int width, int height)
 Creates a rectangular area with given geometry. More...
 
 WRectArea (double x, double y, double width, double height)
 Creates a rectangular area with given geometry. More...
 
 WRectArea (const WRectF &rect)
 Creates a rectangular area with given geometry. More...
 
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.
 
- Public Member Functions inherited from Wt::WAbstractArea
virtual ~WAbstractArea ()
 Destructor. More...
 
void setHole (bool hole)
 Specifies that this area specifies a hole for another area. More...
 
bool isHole () const
 Returns whether this area specifies a hole. More...
 
void setLink (const WLink &link)
 Sets a link. More...
 
WLink link () const
 Returns the link. More...
 
void setRef (const std::string &ref)
 Sets the destination URL (deprecated). More...
 
const std::string ref () const
 Returns the the destination URL (deprecated). More...
 
void setResource (WResource *resource)
 Sets a destination resource (deprecated). More...
 
WResourceresource () const
 Returns the destination resource (deprecated). More...
 
void setTarget (AnchorTarget target)
 Specifies the location where the referred content should be displayed. More...
 
AnchorTarget target () const
 Returns the location where the referred content should be displayed. More...
 
void setAlternateText (const WString &text)
 Sets an alternate text. More...
 
const WString alternateText () const
 Returns the alternate text. More...
 
void setToolTip (const WString &text)
 Sets the tooltip. More...
 
WString toolTip () const
 Returns the tooltip text. More...
 
void setStyleClass (const WString &styleClass)
 Defines a style class. More...
 
WString styleClass () const
 Returns the style class. More...
 
void addStyleClass (const WString &styleClass, bool force=false)
 Adds a style class. More...
 
void removeStyleClass (const WString &styleClass, bool force=false)
 Removes a style class.
 
void setCursor (Cursor cursor)
 Sets the cursor. More...
 
void setCursor (std::string cursorImage, Cursor fallback=ArrowCursor)
 Sets a custom cursor image URL. More...
 
Cursor cursor () const
 Returns the cursor. More...
 
EventSignal< WKeyEvent > & keyWentDown ()
 Event signal emitted when a keyboard key is pushed down. More...
 
EventSignal< WKeyEvent > & keyPressed ()
 Event signal emitted when a "character" was entered. More...
 
EventSignal< WKeyEvent > & keyWentUp ()
 Event signal emitted when a keyboard key is released. More...
 
EventSignalenterPressed ()
 Event signal emitted when enter was pressed. More...
 
EventSignalescapePressed ()
 Event signal emitted when escape was pressed. More...
 
EventSignal< WMouseEvent > & clicked ()
 Event signal emitted when a mouse key was clicked on this widget. More...
 
EventSignal< WMouseEvent > & doubleClicked ()
 Event signal emitted when a mouse key was double clicked on this widget. More...
 
EventSignal< WMouseEvent > & mouseWentDown ()
 Event signal emitted when a mouse key was pushed down on this widget. More...
 
EventSignal< WMouseEvent > & mouseWentUp ()
 Event signal emitted when a mouse key was released on this widget. More...
 
EventSignal< WMouseEvent > & mouseWentOut ()
 Event signal emitted when the mouse went out of this widget. More...
 
EventSignal< WMouseEvent > & mouseWentOver ()
 Event signal emitted when the mouse entered this widget. More...
 
EventSignal< WMouseEvent > & mouseMoved ()
 Event signal emitted when the mouse moved over this widget. More...
 
EventSignal< WMouseEvent > & mouseDragged ()
 Event signal emitted when the mouse is dragged over this widget. More...
 
EventSignal< WMouseEvent > & mouseWheel ()
 Event signal emitted when the mouse scroll wheel was used. More...
 
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object. More...
 
virtual ~WObject ()
 Destructor. More...
 
virtual const std::string id () const
 Returns the (unique) identifier for this object. More...
 
virtual void setObjectName (const std::string &name)
 Sets an object name. More...
 
virtual std::string objectName () const
 Returns the object name. More...
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations. More...
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance. More...
 
void isNotStateless ()
 Marks the current function as not stateless. More...
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method. More...
 
void addChild (WObject *child)
 Adds a child object. More...
 
virtual void removeChild (WObject *child)
 Removes a child object. More...
 
const std::vector< WObject * > & children () const
 Returns the children.
 
WObjectparent () const
 Returns the parent object.
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation. More...
 
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 Returns the sender of the current slot call. More...
 

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.


Generated on Mon Sep 4 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11