Wt::WAbstractArea Class Reference

Abstract base class for interactive areas in a widget. More...

#include <Wt/WAbstractArea>

Inheritance diagram for Wt::WAbstractArea:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~WAbstractArea ()
 Destructor.
void setHole (bool hole)
 Specifies that this area specifies a hole for another area.
bool isHole () const
 Returns whether this area specifies a hole.
void setRef (const std::string &ref)
 Sets the destination URL.
const std::string ref () const
 Returns the the destination URL.
void setResource (WResource *resource)
 Set a destination resource.
WResourceresource () const
 Returns the destination resource.
void setTarget (AnchorTarget target)
 Specifies the location where the referred content should be displayed.
AnchorTarget target () const
 Returns the location where the referred content should be displayed.
void setAlternateText (const WString &text)
 Sets an alternate text.
const WString alternateText () const
 Returns the alternate text.
void setToolTip (const WString &text)
 Sets the tooltip.
WString toolTip () const
 Returns the tooltip text.
void setStyleClass (const WString &styleClass)
 Defines a style class.
WString styleClass () const
 Returns the style class.
void setCursor (Cursor cursor)
 Sets the cursor.
Cursor cursor () const
 Returns the cursor.
EventSignal< WKeyEvent > & keyWentDown ()
 Event signal emitted when a keyboard key is pushed down.
EventSignal< WKeyEvent > & keyPressed ()
 Event signal emitted when a "character" was entered.
EventSignal< WKeyEvent > & keyWentUp ()
 Event signal emitted when a keyboard key is released.
EventSignalenterPressed ()
 Event signal emitted when enter was pressed.
EventSignalescapePressed ()
 Event signal emitted when escape was pressed.
EventSignal< WMouseEvent > & clicked ()
 Event signal emitted when a mouse key was clicked on this widget.
EventSignal< WMouseEvent > & doubleClicked ()
 Event signal emitted when a mouse key was double clicked on this widget.
EventSignal< WMouseEvent > & mouseWentDown ()
 Event signal emitted when a mouse key was pushed down on this widget.
EventSignal< WMouseEvent > & mouseWentUp ()
 Event signal emitted when a mouse key was released on this widget.
EventSignal< WMouseEvent > & mouseWentOut ()
 Event signal emitted when the mouse went out of this widget.
EventSignal< WMouseEvent > & mouseWentOver ()
 Event signal emitted when the mouse entered this widget.
EventSignal< WMouseEvent > & mouseMoved ()
 Event signal emitted when the mouse moved over this widget.


Detailed Description

Abstract base class for interactive areas in a widget.

Use an WAbstractArea (or rather, one of its concrete implementations), to define interactivity that applies on a part of a WImage or WPaintedWidget. The area may be defined using different shapes through WRectArea, WCircleArea or WPolygonArea.

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

Constructor & Destructor Documentation

Wt::WAbstractArea::~WAbstractArea (  )  [virtual]

Destructor.

The are is automatically removed from the WImage or WPaintedWidget to which it was added.

See also:
WImage::removeArea(), WPaintedWidget::removeArea()


Member Function Documentation

void Wt::WAbstractArea::setHole ( bool  hole  ) 

Specifies that this area specifies a hole for another area.

When set to true, this area will define an area that does not provide interactivity. When it preceeds other, overlapping, areas, it acts as if it cuts a hole in those areas.

The default value is false.

See also:
isHole()

bool Wt::WAbstractArea::isHole (  )  const [inline]

Returns whether this area specifies a hole.

See also:
setHole()

void Wt::WAbstractArea::setRef ( const std::string &  ref  ) 

Sets the destination URL.

By setting a destination URL, the area behaves like a WAnchor.

By default, no destination URL is set (ref = "").

This method should not be used when the area has been pointed to a dynamically generated resource using setResource().

See also:
setResource()
Note:
Even when no destination URL is set, in some circumstances, a identity URL ('#') will be set on the underlying HTML <area> element (see also setCursor()).

const std::string Wt::WAbstractArea::ref (  )  const

Returns the the destination URL.

When the area refers to a resource, the current resource URL is returned.

See also:
setRef(), WResource::url()

void Wt::WAbstractArea::setResource ( WResource resource  ) 

Set a destination resource.

A resource specifies application-dependent content, which may be generated by your application on demand.

By setting a resource, the area behaves like a WAnchor that refers to the resource resource. The resource may be cleared by passing resource = 0.

The area does not assume ownership of the resource.

See also:
setRef()

WResource * Wt::WAbstractArea::resource (  )  const

Returns the destination resource.

Returns 0 if no resource has been set.

See also:
setResource()

void Wt::WAbstractArea::setTarget ( AnchorTarget  target  ) 

Specifies the location where the referred content should be displayed.

This configures the location where referred content should be displayed, that was specified using setRef() or setResource().

By default, the reference is displayed in the application (Wt::TargetSelf). When the destination is an HTML document, the application is replaced with the new document. When the reference is a document that cannot be displayed in the browser, it is offered for download or opened using an external program, depending on browser settings.

By setting target to Wt::TargetNewWindow, the destination is displayed in a new browser window or tab.

See also:
setRef(), setResource(), target()

AnchorTarget Wt::WAbstractArea::target (  )  const

Returns the location where the referred content should be displayed.

See also:
setTarget()

void Wt::WAbstractArea::setAlternateText ( const WString text  ) 

Sets an alternate text.

The alternate text should provide a fallback for browsers that do not display an image. If no sensible fallback text can be provided, an empty text is preferred over nonsense.

This should not be confused with toolTip() text, which provides additional information that is displayed when the mouse hovers over the area.

The default alternate text is an empty text ("").

See also:
alternateText()

const WString Wt::WAbstractArea::alternateText (  )  const

Returns the alternate text.

See also:
setAlternateText()

void Wt::WAbstractArea::setToolTip ( const WString text  ) 

Sets the tooltip.

The tooltip is displayed when the cursor hovers over the area.

WString Wt::WAbstractArea::toolTip (  )  const

Returns the tooltip text.

See also:
setToolTip()

WString Wt::WAbstractArea::styleClass (  )  const

Returns the style class.

See also:
setStyleClass()

void Wt::WAbstractArea::setCursor ( Cursor  cursor  ) 

Sets the cursor.

This sets the mouse cursor that is shown when the mouse pointer is over the area. Most browsers only support PointingHandCursor, which is activated by a non-empty ref.

See also:
setRef()

Cursor Wt::WAbstractArea::cursor (  )  const

Returns the cursor.

See also:
setCursor()

EventSignal< WKeyEvent > & Wt::WAbstractArea::keyWentDown (  ) 

Event signal emitted when a keyboard key is pushed down.

The keyWentDown signal is the first signal emitted when a key is pressed (before the keyPressed() signal). Unlike keyPressed() however it is also emitted for modifier keys (such as "shift", "control", ...) or keyboard navigation keys that do not have a corresponding character.

See also:
keyPressed(), keyWentUp()

EventSignal< WKeyEvent > & Wt::WAbstractArea::keyPressed (  ) 

Event signal emitted when a "character" was entered.

The keyPressed signal is emitted when a key is pressed, and a character is entered. Unlike keyWentDown(), it is emitted only for key presses that result in a character being entered, and thus not for modifier keys or keyboard navigation keys.

See also:
keyWentDown()

EventSignal< WKeyEvent > & Wt::WAbstractArea::keyWentUp (  ) 

Event signal emitted when a keyboard key is released.

This is the counter-part of the keyWentDown() event. Every key-down has its corresponding key-up.

See also:
keyWentDown()

EventSignal & Wt::WAbstractArea::enterPressed (  ) 

Event signal emitted when enter was pressed.

This signal is emitted when the Enter or Return key was pressed.

See also:
keyPressed(), Key_Enter

EventSignal & Wt::WAbstractArea::escapePressed (  ) 

Event signal emitted when escape was pressed.

This signal is emitted when the Escape key was pressed.

See also:
keyPressed(), Key_Escape

EventSignal< WMouseEvent > & Wt::WAbstractArea::clicked (  ) 

Event signal emitted when a mouse key was clicked on this widget.

The event details contains information such as the button, optional keyboard modifiers, and mouse coordinates relative to the widget, the window window, or the document.

Note:
When JavaScript is disabled, the event details contain invalid information.

EventSignal< WMouseEvent > & Wt::WAbstractArea::doubleClicked (  ) 

Event signal emitted when a mouse key was double clicked on this widget.

The event details contains information such as the button, optional keyboard modifiers, and mouse coordinates relative to the widget, the window window, or the document.

Note:
When JavaScript is disabled, the signal will never fire.

EventSignal< WMouseEvent > & Wt::WAbstractArea::mouseWentDown (  ) 

Event signal emitted when a mouse key was pushed down on this widget.

The event details contains information such as the button, optional keyboard modifiers, and mouse coordinates relative to the widget, the window window, or the document.

Note:
When JavaScript is disabled, the signal will never fire.

EventSignal< WMouseEvent > & Wt::WAbstractArea::mouseWentUp (  ) 

Event signal emitted when a mouse key was released on this widget.

The event details contains information such as the button, optional keyboard modifiers, and mouse coordinates relative to the widget, the window window, or the document.

Note:
When JavaScript is disabled, the signal will never fire.

EventSignal< WMouseEvent > & Wt::WAbstractArea::mouseWentOut (  ) 

Event signal emitted when the mouse went out of this widget.

Note:
When JavaScript is disabled, the signal will never fire.

EventSignal< WMouseEvent > & Wt::WAbstractArea::mouseWentOver (  ) 

Event signal emitted when the mouse entered this widget.

Note:
When JavaScript is disabled, the signal will never fire.

EventSignal< WMouseEvent > & Wt::WAbstractArea::mouseMoved (  ) 

Event signal emitted when the mouse moved over this widget.

Note:
When JavaScript is disabled, the signal will never fire.


Generated on Fri Mar 26 17:12:06 2010 for Wt by doxygen 1.5.6