Wt  3.3.8
Public Member Functions | List of all members
Wt::WCssTemplateRule Class Reference

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

#include <Wt/WCssStyleSheet>

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

Public Member Functions

 WCssTemplateRule (const std::string &selector, WObject *parent=0)
 Creates a CSS rule with a given selector. More...
 
WWidgettemplateWidget ()
 Returns the widget that is used as a template. More...
 
std::string declarations ()
 Returns the declarations. More...
 
- Public Member Functions inherited from Wt::WCssRule
virtual ~WCssRule ()
 Destructor.
 
void setSelector (const std::string &selector)
 Sets the selector. More...
 
virtual std::string selector () const
 Returns the selector.
 
WCssStyleSheetsheet () const
 Returns the style sheet to which this rule belongs.
 
void modified ()
 Indicates that the rule has changed and needs updating.
 
- Public Member Functions inherited from Wt::WObject
 WObject (WObject *parent=0)
 Create a WObject with a given parent object. More...
 
virtual ~WObject ()
 Destructor. More...
 
virtual const std::string id () const
 Returns the (unique) identifier for this object. More...
 
virtual void setObjectName (const std::string &name)
 Sets an object name. More...
 
virtual std::string objectName () const
 Returns the object name. More...
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations. More...
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance. More...
 
void isNotStateless ()
 Marks the current function as not stateless. More...
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method. More...
 
void addChild (WObject *child)
 Adds a child object. More...
 
virtual void removeChild (WObject *child)
 Removes a child object. More...
 
const std::vector< WObject * > & children () const
 Returns the children.
 
WObjectparent () const
 Returns the parent object.
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 
- Protected Member Functions inherited from Wt::WCssRule
 WCssRule (const std::string &selector, WObject *parent=0)
 Creates a new CSS rule with given selector.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation. More...
 
- Static Protected Member Functions inherited from Wt::WObject
static WObjectsender ()
 Returns the sender of the current slot call. More...
 

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:

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

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.


Generated on Mon Sep 4 2017 for the C++ Web Toolkit (Wt) by doxygen 1.8.11