Wt::WWebWidget Class Reference

WWebWidget is the base class for widgets directly provided by HTML. More...

#include <WWebWidget>

Inherits Wt::WWidget.

Inherited by Wt::Iframe, Wt::WBreak, Wt::WFileUpload, Wt::WInteractWidget, Wt::WScrollArea, and Wt::WViewWidget.

Inheritance diagram for Wt::WWebWidget:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 WWebWidget (WContainerWidget *parent=0)
 Construct a WebWidget with a given parent.
virtual PositionScheme positionScheme () const
 Get the widget position scheme.
virtual void setOffset (int s, WLength x)
 Position a non-statically positioned widget with respect to its parent.
virtual void resize (WLength width, WLength height)
 Resize the widget.
virtual WLength width () const
 Get the widget width.
virtual WLength height () const
 Get the widget height.
virtual Side floatSide () const
 Return the float side.
virtual void setClearSides (int sides)
 Set the sides that should be remain empty.
virtual int clearSides () const
 Get the sides that should be remain empty.
virtual void setMargin (WLength margin, int sides=All)
 Set margins around the widget.
virtual void setHidden (bool)
 Set whether the widget must be hidden.
virtual bool isHidden () const
 Return whether this widget is set hidden.
virtual void setPopup (bool)
 Set whether this widget is overlayed on the parent widget.
virtual bool isPopup () const
 Returns whether this WWidget is overlayed.
virtual void setInline (bool)
 Set whether this widget is inline or stacked.
virtual bool isInline () const
 Returns whether this widget is inline or stacked.
virtual WCssDecorationStyledecorationStyle ()
 Access the decoration style of this widget.
virtual void setStyleClass (const WString &styleClass)
 Specify that a particular style class must be applied to this WWidget.
virtual WString styleClass () const
 Returns the style class for this WWidget.
virtual VerticalAlignment verticalAlignment () const
 Get the vertical alignment of this WWidget.
virtual WLength verticalAlignmentLength () const
 Get the a fixed vertical alignment with respect to the baseline of this WWidget.
virtual void setToolTip (const WString &toolTip)
 Set the tooltip for the widget.
virtual WString toolTip () const
 Get the tooltip text.
virtual void refresh ()
 Refresh the widget.
virtual void setAttributeValue (const std::string name, const WString &value)
 Set an attribute value.
virtual void load ()
 Load content just before the widget's content is rendered.
virtual bool loaded () const
 Return if this widget has been loaded.

Static Protected Member Functions

static WString escapeText (const WString &text, bool newlinesToo=false)
 escape HTML control characters in the text, to display literally.

Detailed Description

WWebWidget is the base class for widgets directly provided by HTML.

All descendants of WWebWidget implement a particular HTML control. While these widgets provide all (sensible) capabilities exposed by the underlying rendering technology, they make no attempt to do anything more. Therefore it makes sense to make more sophisticated widget libraries on top of Wt.


Constructor & Destructor Documentation

WWebWidget::WWebWidget ( WContainerWidget parent = 0  ) 

Construct a WebWidget with a given parent.

See also:
WWidget::WWidget


Member Function Documentation

int WWebWidget::clearSides (  )  const [virtual]

Get the sides that should be remain empty.

Fixme: lookup what this actually does in the CSS manual.

Implements Wt::WWidget.

WCssDecorationStyle & WWebWidget::decorationStyle (  )  [virtual]

Access the decoration style of this widget.

This groups all decorative aspects of the widget, which do not affect the widget layout (except for the border properties which change the total size of the widget when adding a non-zero-width border).

Implements Wt::WWidget.

WWidget::Side WWebWidget::floatSide (  )  const [virtual]

Return the float side.

See also:
setFloatSide(Side)

Implements Wt::WWidget.

WLength WWebWidget::height (  )  const [virtual]

Get the widget height.

Return the height set for this widget. This is not a calculated height, based on layout, but the height as specified previously with resize(WLength width, WLength height).

See also:
resize(WLength width, WLength height), height()

Implements Wt::WWidget.

bool WWebWidget::isHidden (  )  const [virtual]

Return whether this widget is set hidden.

A widget that is not hidden may still be not visible when one of its ancestor widgets are hidden.

See also:
setHidden()

Implements Wt::WWidget.

bool WWebWidget::isInline (  )  const [virtual]

Returns whether this widget is inline or stacked.

See also:
setInline(bool)

Implements Wt::WWidget.

bool WWebWidget::isPopup (  )  const [virtual]

Returns whether this WWidget is overlayed.

See also:
setPopup(bool)

Implements Wt::WWidget.

void WWebWidget::load (  )  [virtual]

Load content just before the widget's content is rendered.

As soon as a widget is inserted into the widget hierarchy, it is rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground. This method is called when the widget is directly or indirectly inserted into the widget tree.

The default implementation simply propagates the load signal to its children. You may want to override this method to load resource-intensive content only when the widget is loaded into the browser.

Implements Wt::WWidget.

Reimplemented in Wt::WViewWidget.

bool WWebWidget::loaded (  )  const [virtual]

Return if this widget has been loaded.

See also:
load()

Implements Wt::WWidget.

WWidget::PositionScheme WWebWidget::positionScheme (  )  const [virtual]

Get the widget position scheme.

See also:
setPositionScheme(PositionScheme)

Implements Wt::WWidget.

void WWebWidget::refresh (  )  [virtual]

Refresh the widget.

The refresh method is invoked when the locale is changed using WApplication::setLocale() or when the user hit the refresh button.

The widget must actualize its contents in response.

Implements Wt::WWidget.

Reimplemented in Wt::WComboBox, Wt::WGroupBox, Wt::WPushButton, and Wt::WText.

void WWebWidget::resize ( WLength  width,
WLength  height 
) [virtual]

Resize the widget.

Specify a new size for this widget, by specifying width and height. By default a widget has automatic width and height, see WLength::isAuto().

See also:
width(), height()

Implements Wt::WWidget.

void WWebWidget::setAttributeValue ( const std::string  name,
const WString value 
) [virtual]

Set an attribute value.

Associate an extra attribute with this widget, with the given value. This is only useful when processing dom nodes associated with widgets in custom JavaScript code.

See also:
JSlot, WApplication::runJavaScript()

Implements Wt::WWidget.

void WWebWidget::setClearSides ( int  sides  )  [virtual]

Set the sides that should be remain empty.

Fixme: lookup what this actually does in the CSS manual.

Implements Wt::WWidget.

void WWebWidget::setHidden ( bool   )  [virtual]

Set whether the widget must be hidden.

Hide or show the widget (including all its descendant widgets). setHidden(false) will show this widget and all child widgets that are not hidden.

See also:
hide(), show()

Implements Wt::WWidget.

Reimplemented in Wt::WFormWidget.

void WWebWidget::setInline ( bool   )  [virtual]

Set whether this widget is inline or stacked.

This option changes whether this widget must be rendered in-line with sibling widgets wrapping at the right edge of the parent container (like text), or whether this widget must be stacked vertically with sibling widgets. Depending on the WWidget type, the default value is inline (such as for example for WText, or WPushButton), or stacked (such as for example for WTable).

Implements Wt::WWidget.

void WWebWidget::setMargin ( WLength  margin,
int  sides = All 
) [virtual]

Set margins around the widget.

Setting margin has the effect of adding a distance between the widget and surrounding widgets. The default margin (with an automatic length) is zero.

Use any combination of Left , Right , Bottom , or Top .

See also:
WWidget::margin(Side side);

Implements Wt::WWidget.

void WWebWidget::setOffset ( int  s,
WLength  x 
) [virtual]

Position a non-statically positioned widget with respect to its parent.

This applies only to widgets that have a non-Static positionScheme(), as these latter widgets are layed out automatically in an inline or block flow.

When this widget uses a Relative position scheme, it specifies the offset with respect to its position as it would be when layed-out using a Static positionScheme(). In that case, one can specify an vertical offset (with respect to Top or Bottom ) to shift the widget up or down, or a horizontal offset (with respect to Left or Right ) to shift the widget to the left or to the right.

When this widget uses an Absolute or Fixed position scheme, it specifies the position within respectively the reference parent WWidget, or the browser viewport. In that case, the side refers to the sides of this reference.

In all cases, valid values for Side or only Left , Right , Bottom and Top .

See also:
offset(Side) const

Implements Wt::WWidget.

void WWebWidget::setPopup ( bool   )  [virtual]

Set whether this widget is overlayed on the parent widget.

This option only applies to widgets with a Absolute or Fixed positionScheme().

A widget that isPopup() will be rendered on top of the parent widget.

Implements Wt::WWidget.

void WWebWidget::setStyleClass ( const WString styleClass  )  [virtual]

Specify that a particular style class must be applied to this WWidget.

Setting a style class will interfere with all layout and decoration style properties of the WWidget (does it?). To remove the style class, set an empty string as style class.

See also:
WApplication::styleSheet()

Implements Wt::WWidget.

void WWebWidget::setToolTip ( const WString toolTip  )  [virtual]

Set the tooltip for the widget.

The tooltip is displayed when the cursor rests above the widget.

Implements Wt::WWidget.

WString WWebWidget::styleClass (  )  const [virtual]

Returns the style class for this WWidget.

See also:
setStyleClass(const WString&)

Implements Wt::WWidget.

WWidget::VerticalAlignment WWebWidget::verticalAlignment (  )  const [virtual]

Get the vertical alignment of this WWidget.

See also:
WWidget::setVerticalAlignment()

Implements Wt::WWidget.

WLength WWebWidget::verticalAlignmentLength (  )  const [virtual]

Get the a fixed vertical alignment with respect to the baseline of this WWidget.

See also:
WWidget::setVerticalAlignment()

Implements Wt::WWidget.

WLength WWebWidget::width (  )  const [virtual]

Get the widget width.

Return the width set for this widget. This is not a calculated width, based on layout, but the width as specified with resize(WLength width, WLength height).

See also:
resize(WLength width, WLength height), width()

Implements Wt::WWidget.


The documentation for this class was generated from the following files:
Generated on Sun Jul 1 19:37:18 2007 for Wt by doxygen 1.4.7