Wt 3.1.10
Public Member Functions
Wt::WCssTemplateRule Class Reference

A CSS rule based on a template widget. More...

#include <Wt/WCssStyleSheet>

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

List of all members.

Public Member Functions

 WCssTemplateRule (const std::string &selector, WObject *parent=0)
 Creates a CSS rule with a given selector.
WWidgettemplateWidget ()
 Returns the widget that is used as a template.
const std::string declarations ()
 Returns the declarations.

Detailed Description

A CSS rule based on a template widget.

This is a CSS rule whose CSS style properties are defined based on properties of a template widget. When modifying the template widget, these changes are reflected on the CSS rule and thus all widgets that have this CSS rule.

Usage example:

 Wt::WCssTemplateRule *styleRule = new Wt::WCssTemplateRule("#" + id() + " .item");
 Wt::WApplication::instance()->styleSheet().addRule(styleRule);

 styleRule->templateWidget()->resize(100, WLength::Auto);
 styleRule->templateWidget()->decorationStyle().setCursor(PointingHandCursor);
See also:
Wt::WCssStyleSheet

Constructor & Destructor Documentation

Wt::WCssTemplateRule::WCssTemplateRule ( const std::string &  selector,
WObject parent = 0 
)

Creates a CSS rule with a given selector.

The selector should be a valid CSS selector.

Note:
If you want to update the rule, then the selector should be unique and not contain commas, since this is not supported by Microsoft Internet Explorer.

Member Function Documentation

const std::string Wt::WCssTemplateRule::declarations ( ) [virtual]

Returns the declarations.

This is a semi-colon separated list of CSS declarations.

Implements Wt::WCssRule.

WWidget * Wt::WCssTemplateRule::templateWidget ( )

Returns the widget that is used as a template.

Various properties of the widget are reflected in the CSS style:

When modifying one of these properties of the returned widget, the rule will be updated accordingly.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Mon Nov 14 2011 for the C++ Web Toolkit (Wt) by doxygen 1.7.4