A CSS rule based on a template widget. More...
#include <Wt/WCssStyleSheet>
Public Member Functions | |
WCssTemplateRule (const std::string &selector) | |
Creates a CSS rule with a given selector. | |
WWidget * | templateWidget () |
Returns the widget that is used as a template. | |
const std::string | declarations () |
Returns the declarations. |
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);
Wt::WCssTemplateRule::WCssTemplateRule | ( | const std::string & | selector ) |
Creates a CSS rule with a given selector.
The selector should be a valid CSS selector.
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.