Wt  3.2.2
Public Member Functions | Protected Member Functions
Wt::WCompositeWidget Class Reference

A widget that hides the implementation of composite widgets. More...

#include <Wt/WCompositeWidget>

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

List of all members.

Public Member Functions

 WCompositeWidget (WContainerWidget *parent=0)
 Creates a WCompositeWidget.
 WCompositeWidget (WWidget *implementation, WContainerWidget *parent)
 Creates a WCompositeWidget with given implementation.
virtual const std::string id () const
 Returns the (unique) identifier for this object.
virtual void setPositionScheme (PositionScheme scheme)
 Sets the CSS position scheme.
virtual PositionScheme positionScheme () const
 Returns the CSS position scheme.
virtual void setOffsets (const WLength &offset, WFlags< Side > sides=All)
 Sets CSS offsets for a non-statically positioned widget.
virtual WLength offset (Side s) const
 Returns a CSS offset.
virtual void resize (const WLength &width, const WLength &height)
 Resizes the widget.
virtual WLength width () const
 Returns the width.
virtual WLength height () const
 Returns the height.
virtual void setMinimumSize (const WLength &width, const WLength &height)
 Sets a minimum size.
virtual WLength minimumWidth () const
 Returns the minimum width.
virtual WLength minimumHeight () const
 Returns the minimum height.
virtual void setMaximumSize (const WLength &width, const WLength &height)
 Sets a maximum size.
virtual WLength maximumWidth () const
 Returns the maximum width.
virtual WLength maximumHeight () const
 Returns the maximum height.
virtual void setLineHeight (const WLength &height)
 Sets the CSS line height for contained text.
virtual WLength lineHeight () const
 Returns the CSS line height for contained text.
virtual void setFloatSide (Side s)
 Specifies a CSS float side.
virtual Side floatSide () const
 Returns the CSS float side.
virtual void setClearSides (WFlags< Side > sides)
 Sets the sides that should be cleared of floats.
virtual WFlags< SideclearSides () const
 Returns the sides that should remain empty.
virtual void setMargin (const WLength &margin, WFlags< Side > sides=All)
 Sets CSS margins around the widget.
virtual WLength margin (Side side) const
 Returns a CSS margin set.
virtual void setHiddenKeepsGeometry (bool enabled)
 Sets whether the widget keeps its geometry when hidden.
virtual bool hiddenKeepsGeometry () const
 Returns whether the widget keeps its geometry when hidden.
virtual void setHidden (bool hidden, const WAnimation &animation=WAnimation())
 Hides or shows the widget.
virtual bool isHidden () const
 Returns whether the widget is set hidden.
virtual bool isVisible () const
 Returns whether the widget is visible.
virtual void setDisabled (bool disabled)
 Sets whether the widget is disabled.
virtual bool isDisabled () const
 Returns whether the widget is set disabled.
virtual bool isEnabled () const
 Returns whether the widget is enabled.
virtual void setPopup (bool popup)
 Lets the widget overlay over other sibling widgets.
virtual bool isPopup () const
 Returns whether the widget is overlayed.
virtual void setInline (bool isInline)
 Sets whether the widget is displayed inline or as a block.
virtual bool isInline () const
 Returns whether the widget is displayed inline or as block.
virtual void setDecorationStyle (const WCssDecorationStyle &style)
 Sets a CSS decoration style.
virtual WCssDecorationStyledecorationStyle ()
 Returns the decoration style of this widget.
virtual void setStyleClass (const WString &styleClass)
 Sets (one or more) CSS style classes.
virtual WString styleClass () const
 Returns the CSS style class.
virtual void addStyleClass (const WString &styleClass, bool force=false)
 Adds a CSS style class.
virtual void removeStyleClass (const WString &styleClass, bool force=false)
 Removes a CSS style class.
virtual void setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto)
 Sets the vertical alignment.
virtual AlignmentFlag verticalAlignment () const
 Returns the vertical alignment.
virtual WLength verticalAlignmentLength () const
 Returns the fixed vertical alignment that was set.
virtual void setToolTip (const WString &text, TextFormat textFormat=PlainText)
 Sets a tooltip.
virtual WString toolTip () const
 Returns the tooltip.
virtual void refresh ()
 Refresh the widget.
virtual void setAttributeValue (const std::string &name, const WString &value)
 Sets an attribute value.
virtual WString attributeValue (const std::string &name) const
 Returns an attribute value.
virtual void setJavaScriptMember (const std::string &name, const std::string &value)
 Sets a JavaScript member.
virtual std::string javaScriptMember (const std::string &name) const
 Returns the value of a JavaScript member.
virtual void callJavaScriptMember (const std::string &name, const std::string &args)
 Calls a JavaScript member.
virtual void load ()
 Loads content just before the widget is used.
virtual bool loaded () const
 Returns whether this widget has been loaded.
virtual void setTabIndex (int index)
 Sets the tab index.
virtual int tabIndex () const
 Returns the tab index.
virtual void setId (const std::string &id)
 Sets the CSS Id.
virtual WWidgetfind (const std::string &name)
 Finds a descendent widget by name.
virtual void setSelectable (bool selectable)
 Sets as selectable.
virtual void doJavaScript (const std::string &js)
 Executes the given JavaScript statements when the widget is rendered or updated.
virtual void propagateSetEnabled (bool enabled)
 Propagates that a widget was enabled or disabled through children.

Protected Member Functions

virtual void enableAjax ()
 Progresses to an Ajax-enabled widget.
void setImplementation (WWidget *widget)
 Set the implementation widget.
WWidgetimplementation ()
 Get the implementation widget.
virtual int boxPadding (Orientation orientation) const
 Returns the widget's built-in padding.
virtual int boxBorder (Orientation orientation) const
 Returns the widget's built-in border width.

Detailed Description

A widget that hides the implementation of composite widgets.

Composite widgets, built on top of the WebWidgets, should derive from this class, and use setImplementation() to set the widget that implements the composite widget (which is typically a WContainerWidget or a WTable, or another widget that allows composition, including perhaps another WCompositeWidget).

Using this class you can completely hide the implementation of your composite widget, and provide access to only the standard WWidget methods.

Usage example:

 class MyWidget : public Wt::WCompositeWidget
 {
 public:
   MyWidget(WContainerWidget *parent = 0)
     : WCompositeWidget(parent)
       // initialize members ...
   {
     setImplementation(impl_ = new WContainerWidget());

     // further initialization code ...
   }

 private:
   Wt::WContainerWidget *impl_;
 };

CSS

Styling through CSS is propagated to its implementation.


Constructor & Destructor Documentation

Wt::WCompositeWidget::WCompositeWidget ( WContainerWidget parent = 0)

Creates a WCompositeWidget.

You need to set an implemetation using setImplementation().


Member Function Documentation

void Wt::WCompositeWidget::addStyleClass ( const WString styleClass,
bool  force = false 
) [virtual]

Adds a CSS style class.

When force = true, a JavaScript call will be used to add the style class to the DOM element (if JavaScript is available). This may be necessary when client-side JavaScript manipulates the same style class.

Implements Wt::WWidget.

WString Wt::WCompositeWidget::attributeValue ( const std::string &  name) const [virtual]

Returns an attribute value.

See also:
setAttributeValue()

Implements Wt::WWidget.

int Wt::WCompositeWidget::boxBorder ( Orientation  orientation) const [protected, virtual]

Returns the widget's built-in border width.

This is used by the layout managers to correct for a built-in border which interferes with setting a widget's width (or height) to 100%.

A layout manager needs to set the width to 100% only for form widgets (WTextArea, WLineEdit, WComboBox, etc...). Therefore, only for those widgets this needs to return the border width (the default implementation returns 0).

For form widgets, the border width depends on the specific browser/platform combination, unless an explicit border is set for the widget.

When setting an explicit border for the widget using a style class, you will want to reimplement this method to return this border width, in case you want to set the widget inside a layout manager.

See also:
boxPadding()

Reimplemented from Wt::WWidget.

int Wt::WCompositeWidget::boxPadding ( Orientation  orientation) const [protected, virtual]

Returns the widget's built-in padding.

This is used by the layout managers to correct for a built-in padding which interferes with setting a widget's width (or height) to 100%.

A layout manager needs to set the width to 100% only for form widgets (WTextArea, WLineEdit, WComboBox, etc...). Therefore, only for those widgets this needs to return the padding (the default implementation returns 0).

For form widgets, the padding depends on the specific browser/platform combination, unless an explicit padding is set for the widget.

When setting an explicit padding for the widget using a style class, you will want to reimplement this method to return this padding in case you want to set the widget inside a layout manager.

See also:
boxBorder()

Reimplemented from Wt::WWidget.

void Wt::WCompositeWidget::callJavaScriptMember ( const std::string &  name,
const std::string &  args 
) [virtual]

Calls a JavaScript member.

This calls a JavaScript member.

See also:
setJavaScriptMember()

Implements Wt::WWidget.

WFlags< Side > Wt::WCompositeWidget::clearSides ( ) const [virtual]

Returns the sides that should remain empty.

See also:
setClearSides(WFlags<Side>)

Implements Wt::WWidget.

WCssDecorationStyle & Wt::WCompositeWidget::decorationStyle ( ) [virtual]

Returns 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 may behave like extra margin around the widget).

When a decoration style has not been previously set, it returns a default decoration style object.

See also:
setDecorationStyle()

Implements Wt::WWidget.

void Wt::WCompositeWidget::doJavaScript ( const std::string &  js) [virtual]

Executes the given JavaScript statements when the widget is rendered or updated.

Calling WApplication::doJavaScript() with JavaScript code that refers to a widget using jsRef(), that is still to be rendered may cause JavaScript errors because the corresponding DOM node does not exist. This happens for example when a widget is created, but not yet inserted in the widget tree.

This method guarantees that the JavaScript code is only run when the corresponding DOM node (using jsRef()) resolves to a valid DOM object.

See also:
jsRef()

Implements Wt::WWidget.

void Wt::WCompositeWidget::enableAjax ( ) [protected, virtual]

Progresses to an Ajax-enabled widget.

This method is called when the progressive bootstrap method is used, and support for AJAX has been detected. The default behavior will upgrade the widget's event handling to use AJAX instead of full page reloads, and propagate the call to its children.

You may want to reimplement this method if you want to make changes to widget when AJAX is enabled. You should always call the base implementation.

See also:
WApplication::enableAjax()

Implements Wt::WWidget.

Reimplemented in Wt::WMenu, and Wt::WTreeView.

WWidget * Wt::WCompositeWidget::find ( const std::string &  name) [virtual]

Finds a descendent widget by name.

See also:
setObjectName()

Implements Wt::WWidget.

Side Wt::WCompositeWidget::floatSide ( ) const [virtual]

Returns the CSS float side.

See also:
setFloatSide(Side)

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::height ( ) const [virtual]

Returns the height.

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

This applies to CSS-based layout.

See also:
resize(const WLength&, const WLength&), width()

Implements Wt::WWidget.

bool Wt::WCompositeWidget::hiddenKeepsGeometry ( ) const [virtual]

Returns whether the widget keeps its geometry when hidden.

See also:
setHiddenKeepsGeometry()

Implements Wt::WWidget.

const std::string Wt::WCompositeWidget::id ( ) const [virtual]

Returns the (unique) identifier for this object.

For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely unique, since a composite widget shares the same id as its implementation.

By default, the id is auto-generated, unless a custom id is set for a widget using WWidget::setId(). The auto-generated id is created by concatenating objectName() with a unique number.

See also:
WWidget::jsRef()

Reimplemented from Wt::WObject.

WWidget* Wt::WCompositeWidget::implementation ( ) [protected]

Get the implementation widget.

This returns the widget that implements this compositeWidget.

bool Wt::WCompositeWidget::isDisabled ( ) const [virtual]

Returns whether the widget is set disabled.

A widget that is not set disabled may still be disabled when one of its ancestor widgets is set disabled. Use isEnabled() to find out whether a widget is enabled.

See also:
setDisabled(), isEnabled()

Implements Wt::WWidget.

bool Wt::WCompositeWidget::isEnabled ( ) const [virtual]

Returns whether the widget is enabled.

A widget is enabled if it is not disabled, and none of its ancestors are disabled. This method returns whether the widget is rendered as enabled, while isDisabled() returns whether a widget has been explicitly disabled.

Note that a widget may be at the same time not enabled, and not disabled, in case one of its ancestors was disabled.

See also:
isDisabled()

Implements Wt::WWidget.

bool Wt::WCompositeWidget::isHidden ( ) const [virtual]

Returns whether the widget is set hidden.

A widget that is not hidden may still be not visible when one of its ancestor widgets is hidden. Use isVisible() to check the visibility of a widget.

See also:
setHidden(), isVisible()

Implements Wt::WWidget.

bool Wt::WCompositeWidget::isInline ( ) const [virtual]

Returns whether the widget is displayed inline or as block.

See also:
setInline(bool)

Implements Wt::WWidget.

bool Wt::WCompositeWidget::isPopup ( ) const [virtual]

Returns whether the widget is overlayed.

This applies to CSS-based layout.

See also:
setPopup(bool)

Implements Wt::WWidget.

bool Wt::WCompositeWidget::isVisible ( ) const [virtual]

Returns whether the widget is visible.

A widget is visible if it is not hidden, and none of its ancestors are hidden. This method returns the true visibility, while isHidden() returns whether a widget has been explicitly hidden.

Note that a widget may be at the same time not hidden, and not visible, in case one of its ancestors was hidden.

See also:
isHidden()

Implements Wt::WWidget.

std::string Wt::WCompositeWidget::javaScriptMember ( const std::string &  name) const [virtual]

Returns the value of a JavaScript member.

See also:
setJavaScriptMember()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::lineHeight ( ) const [virtual]

Returns the CSS line height for contained text.

sa setLineHeight()

Implements Wt::WWidget.

void Wt::WCompositeWidget::load ( ) [virtual]

Loads content just before the widget is used.

When the widget is inserted in the widget hierarchy, this method is called. Widgets that get inserted in the widget hierarchy will be rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground (or not for a plain HTML session). 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 delay loading of resource-intensive contents.

During the life-time of a widget, this method may be called multiple times, so you should make sure that you do a deferred initializiation only once.

Implements Wt::WWidget.

Reimplemented in Wt::WPopupMenuItem.

bool Wt::WCompositeWidget::loaded ( ) const [virtual]

Returns whether this widget has been loaded.

See also:
load()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::margin ( Side  side) const [virtual]

Returns a CSS margin set.

This applies to CSS-based layout.

See also:
setMargin()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::maximumHeight ( ) const [virtual]

Returns the maximum height.

Returns the minmum height set for this widget with setMaximumSize().

See also:
setMaximumSize(), maximumWidth()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::maximumWidth ( ) const [virtual]

Returns the maximum width.

Returns the maximum width set for this widget with setMaximumSize().

See also:
setMaximumSize(), maximumHeight()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::minimumHeight ( ) const [virtual]

Returns the minimum height.

Returns the minmum height set for this widget with setMinimumSize().

See also:
setMinimumSize(), minimumWidth()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::minimumWidth ( ) const [virtual]

Returns the minimum width.

Returns the minimum width set for this widget with setMinimumSize().

See also:
setMinimumSize(), minimumHeight()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::offset ( Side  side) const [virtual]

Returns a CSS offset.

This applies to CSS-based layout.

See also:
setOffsets(const WLength&, WFlags<Side>)

Implements Wt::WWidget.

PositionScheme Wt::WCompositeWidget::positionScheme ( ) const [virtual]

Returns the CSS position scheme.

This applies to CSS-based layout.

See also:
Wt::PositionScheme, setPositionScheme(PositionScheme)

Implements Wt::WWidget.

void Wt::WCompositeWidget::propagateSetEnabled ( bool  enabled) [virtual]

Propagates that a widget was enabled or disabled through children.

When enabling or disabling a widget, you usually also want to disable contained children. This method is called by setDisabled() to propagate its state to all children.

You may want to reimplement this method if they wish to render differently when a widget is disabled. The default implementation will propagate the signal to all children.

Implements Wt::WWidget.

void Wt::WCompositeWidget::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.

Reimplemented from Wt::WWidget.

void Wt::WCompositeWidget::removeStyleClass ( const WString styleClass,
bool  force = false 
) [virtual]

Removes a CSS style class.

When force = true, a JavaScript call will be used to remove the style class from the DOM element (if JavaScript is available). This may be necessary when client-side JavaScript manipulates the same style class.

Implements Wt::WWidget.

void Wt::WCompositeWidget::resize ( const WLength width,
const WLength height 
) [virtual]

Resizes the widget.

Specifies a fixed size for this widget, setting CSS width and height properties. By default a widget has automatic width and height, which sets a size for the widget following CSS rules.

When the widget is not managed by a layout manager, the automatic (natural) size of a widget depends on whether they widget is a block or inline widget:

  • a block widget takes by default the width of the parent, and the height that it needs based on its contents
  • an inline widget takes the width and height that it needs based on its contents (possibly wrapping over multiple lines). The width and height of an inline widget cannot be changed (by the letter of CSS, although most browsers will react to it in varying ways).

When inserted in a layout manager, the size set will be used as a widget's preferred size, but the widget may be given a different size by the layout manager based on available space and stretch factors. The actual size given by a layout manager may be retrieved by making the widget "layout size aware", using setLayoutSizeAware(). If you have defined a "wtResize()" JavaScript method for the widget, then this method will also be called.

The default width and height of a widget is WLength::Auto.

See also:
width(), height()

Reimplemented from Wt::WWidget.

Reimplemented in Wt::WTreeView, and Wt::WTableView.

void Wt::WCompositeWidget::setAttributeValue ( const std::string &  name,
const WString value 
) [virtual]

Sets 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, doJavaScript()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setClearSides ( WFlags< Side sides) [virtual]

Sets the sides that should be cleared of floats.

This pushes the widget down until it is not surrounded by floats at the sides (which may be a combination of Wt::Left and Wt::Right).

This applies to CSS-based layout.

See also:
setFloatSide()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setDecorationStyle ( const WCssDecorationStyle style) [virtual]

Sets a CSS decoration style.

This copies the style over its current decorationStyle()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setDisabled ( bool  disabled) [virtual]

Sets whether the widget is disabled.

Enables or disables the widget (including all its descendant widgets). setDisabled(false) will enable this widget and all descendant widgets that are not disabled. A widget is only enabled if it and all its ancestors in the widget tree are disabled.

Typically, a disabled form widget will not allow changing the value, and disabled widgets will not react to mouse click events.

See also:
disable(), enable()

Implements Wt::WWidget.

Reimplemented in Wt::WPopupMenuItem, and Wt::WDatePicker.

void Wt::WCompositeWidget::setFloatSide ( Side  s) [virtual]

Specifies a CSS float side.

This only applies to widgets with a Wt::Static positionScheme().

This lets the widget float to one of the sides of the parent widget, at the current line. A typical use is to position images within text. Valid values for Side orWt::None java {javadoclink Side::None None}, Wt::Left or Wt::Right.

This applies to CSS-based layout.

Implements Wt::WWidget.

void Wt::WCompositeWidget::setHidden ( bool  hidden,
const WAnimation animation = WAnimation() 
) [virtual]

Hides or shows the widget.

Hides or show the widget (including all its descendant widgets). When setting hidden = false, this widget and all descendant widgets that are not hidden will be shown. A widget is only visible if it and all its ancestors in the widget tree are visible, which may be checked using isVisible().

Implements Wt::WWidget.

Reimplemented in Wt::WDialog, Wt::WPopupMenu, Wt::WDatePicker, and Wt::WTableView.

void Wt::WCompositeWidget::setHiddenKeepsGeometry ( bool  enabled) [virtual]

Sets whether the widget keeps its geometry when hidden.

Normally, a widget that is hidden will no longer occupy space, causing a reflow of sibling widgets. Using this method you may change this behavior to keep an (open) space when hidden.

Note:
Currently you can only set this before initial rendering.
See also:
setHidden()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setId ( const std::string &  id) [virtual]

Sets the CSS Id.

Sets a custom Id. Note that the Id must be unique across the whole widget tree, can only be set right after construction and cannot be changed. This is mostly useful for in tests using a test plan that manipulates DOM elements by Id.

By default, auto-generated id's are used.

Note:
An id must start with a letter ([A-Za-z]), followed by one or more letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
See also:
WObject::id()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setImplementation ( WWidget widget) [protected]

Set the implementation widget.

This sets the widget that implements this compositeWidget. Ownership of the widget is completely transferred (including deletion).

Note:
You cannot change the implementation of a composite widget after it has been rendered.
void Wt::WCompositeWidget::setInline ( bool  inlined) [virtual]

Sets whether the widget is displayed inline or as a block.

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 rendered as a rectangular block that stacks vertically with sibling widgets (unless a CSS float property is applied). Depending on the widget type, the default value is inline (such as for example for WText, or WPushButton), or block (such as for example for a WContainerWidget).

This applies to CSS-based layout.

Implements Wt::WWidget.

void Wt::WCompositeWidget::setJavaScriptMember ( const std::string &  name,
const std::string &  value 
) [virtual]

Sets a JavaScript member.

This binds a JavaScript member, which is set as a JavaScript property to the DOM object that implements this widget. The value may be any JavaScript expression, including a function.

Members that start with "wt" are reserved for internal use. You may define a member "wtResize(self, width, height)" method if your widget needs active layout management. If defined, this method will be used by layout managers and when doing resize() to set the size of the widget, instead of setting the CSS width and height properties.

Implements Wt::WWidget.

void Wt::WCompositeWidget::setMargin ( const WLength margin,
WFlags< Side sides = All 
) [virtual]

Sets CSS 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 Wt::Left, Wt::Right, Wt::Bottom, or Wt::Top.

This applies to CSS-based layout.

See also:
margin()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setMaximumSize ( const WLength width,
const WLength height 
) [virtual]

Sets a maximum size.

Specifies a maximum size for this widget, setting CSS max-width and max-height properties.

The default the maximum width and height are WLength::Auto, indicating no maximum size. A WLength::Percentage size should not be used, as this is (in virtually all cases) undefined behaviour.

When the widget is a container widget that contains a layout manager, then setting a maximum size will have the effect of letting the size of the container to reflect the preferred size of the contents (rather than constraining the size of the children based on the size of the container), up to the specified maximum size.

See also:
resize(), setMinimumSize()

Implements Wt::WWidget.

Reimplemented in Wt::WSuggestionPopup, Wt::WDialog, and Wt::WPopupMenu.

void Wt::WCompositeWidget::setMinimumSize ( const WLength width,
const WLength height 
) [virtual]

Sets a minimum size.

Specifies a minimum size for this widget, setting CSS min-width and min-height properties.

The default minimum width and height is 0. The special value WLength::Auto indicates that the initial width is used as minimum size. A WLength::Percentage size should not be used, as this is (in virtually all cases) undefined behaviour.

When the widget is inserted in a layout manager, then the minimum size will be taken into account.

See also:
resize(), minimumWidth(), minimumHeight()

Implements Wt::WWidget.

Reimplemented in Wt::WSuggestionPopup, and Wt::WPopupMenu.

void Wt::WCompositeWidget::setOffsets ( const WLength offset,
WFlags< Side sides = All 
) [virtual]

Sets CSS offsets for a non-statically positioned widget.

The argument sides may be a combination of Wt::Left, Wt::Right, Wt::Top, and Wt::Bottom.

This applies only to widgets that have a position scheme that is Wt::Relative, Wt::Absolute, or Wt::Fixed, and has a slightly different meaning for these three cases.

For a relatively positioned widget, an offset applies relative to the position the widget would have when layed-out using a static position scheme. The widget may be shifted to the left or right by specifying an offset for the left or right) side. The widget may be shifted vertically, by specifying an offset for the top or bottom side.

For an absolutely positioned widget, an offset specifies a distance of the corresponding side of the widget with respect to the corresponding side of the reference parent widget. Thus, setting all offsets to 0 result in a widget that spans the entire reference widget. The reference parent widget is the first ancestor widget that is a table cell, or a widget with a relative, absolute or fixed position scheme.

For an fixed positioned widget, an offset specifies a distance of the corresponding side of the widget with respect to the browser window, regardless of scrolling. Thus, setting all offsets to 0 result in a widget that spans the entire browser window.

This applies to CSS-based layout.

See also:
offset(Side) const

Implements Wt::WWidget.

void Wt::WCompositeWidget::setPopup ( bool  popup) [virtual]

Lets the widget overlay over other sibling widgets.

A widget that isPopup() will be rendered on top of any other sibling widget contained within the same parent (including other popup widgets previously added to the container).

This will only have an effect when the widgetis either Wt::Absolute or Wt::Fixed positionScheme().

This applies to CSS-based layout, and configures the z-index property.

Implements Wt::WWidget.

void Wt::WCompositeWidget::setPositionScheme ( PositionScheme  scheme) [virtual]

Sets the CSS position scheme.

Establishes how the widget must be layed-out relative to its siblings. The default position scheme is Static.

This applies to CSS-based layout.

See also:
Wt::PositionScheme, positionScheme()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setSelectable ( bool  selectable) [virtual]

Sets as selectable.

When a widget is made unselectable, a selection of text (or images) will not be visible (but may still be possible).

By default, the widget inherits this property from its parent, and this property propagates to all children. The top level container (WApplication::root()) selectable by default.

Implements Wt::WWidget.

Reimplemented in Wt::WTreeNode, and Wt::WPopupMenuItem.

void Wt::WCompositeWidget::setStyleClass ( const WString styleClass) [virtual]

Sets (one or more) CSS style classes.

You may set one or more space separated style classes. CSS style class works in conjunction with style sheet, and provides a flexible way to provide many widgets the same markup.

Setting an empty string removes the style class(es).

See also:
WApplication::styleSheet()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setTabIndex ( int  index) [virtual]

Sets the tab index.

For widgets that receive focus, focus is passed on to the next widget in the tabbing chain based on their tab index. When the user navigates through form widgets using the keyboard, widgets receive focus starting from the element with the lowest tab index to elements with the highest tab index.

A tab index only applies to widgets than can receive focus (which are WFormWidget, WAnchor, WPushButton), but setting a tab index on any other type of widget will propagate to its contained form widgets.

Widgets with a same tab index will receive focus in the same order as they are inserted in the widget tree.

The default tab index is 0.

See also:
setTabOrder()

Implements Wt::WWidget.

void Wt::WCompositeWidget::setToolTip ( const WString text,
TextFormat  textFormat = PlainText 
) [virtual]

Sets a tooltip.

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

When textFormat is XHTMLText, the tooltip may contain any valid XHTML snippet. The tooltip will then be rendered using JavaScript.

Implements Wt::WWidget.

void Wt::WCompositeWidget::setVerticalAlignment ( AlignmentFlag  alignment,
const WLength length = WLength::Auto 
) [virtual]

Sets the vertical alignment.

This only applies to inline widgets, and determines how to position itself on the current line, with respect to sibling inline widgets.

This applies to CSS-based layout.

Implements Wt::WWidget.

WString Wt::WCompositeWidget::styleClass ( ) const [virtual]

Returns the CSS style class.

See also:
setStyleClass()

Implements Wt::WWidget.

int Wt::WCompositeWidget::tabIndex ( ) const [virtual]

Returns the tab index.

See also:
setTabIndex()

Implements Wt::WWidget.

AlignmentFlag Wt::WCompositeWidget::verticalAlignment ( ) const [virtual]

Returns the vertical alignment.

This applies to CSS-based layout.

See also:
setVerticalAlignment()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::verticalAlignmentLength ( ) const [virtual]

Returns the fixed vertical alignment that was set.

This applies to CSS-based layout.

See also:
setVerticalAlignment()

Implements Wt::WWidget.

WLength Wt::WCompositeWidget::width ( ) const [virtual]

Returns the width.

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

This applies to CSS-based layout.

See also:
resize(const WLength&, const WLength&), height()

Implements Wt::WWidget.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator

Generated on Fri Jul 27 2012 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1