#include <Wt/WCssDecorationStyle>
Public Types | |
enum | Repeat { RepeatXY, RepeatX, RepeatY, NoRepeat } |
How a background image must be repeated. More... | |
enum | TextDecoration { Underline = 0x1, Overline = 0x2, LineThrough = 0x4, Blink = 0x8 } |
Text decoration options. More... | |
Public Member Functions | |
WCssDecorationStyle () | |
Creates a default style. | |
WCssDecorationStyle & | operator= (const WCssDecorationStyle &other) |
Assignment operator. | |
void | setCursor (Cursor c) |
Sets the cursor style. | |
Cursor | cursor () const |
Returns the cursor style. | |
void | setCursor (std::string cursorImage, Cursor fallback=ArrowCursor) |
Sets a custom cursor image URI, with optionally a fallback cursor. | |
std::string | cursorImage () const |
Returns the cursor image. | |
void | setBackgroundColor (WColor color) |
Sets the background color. | |
WColor | backgroundColor () const |
Returns the background color. | |
void | setBackgroundImage (const std::string &imageHRef, Repeat repeat=RepeatXY, WFlags< Side > sides=0) |
Sets a background image URL. | |
void | setBackgroundImage (WResource *resource, Repeat repeat=RepeatXY, WFlags< Side > sides=0) |
Sets a background image URL. | |
const std::string & | backgroundImage () const |
Returns the background image URL. | |
Repeat | backgroundImageRepeat () const |
Returns the background image repeat. | |
void | setForegroundColor (WColor color) |
Sets the foreground color. | |
WColor | foregroundColor () const |
Returns the foreground color. | |
void | setBorder (WBorder border, WFlags< Side > sides=All) |
Sets the border style. | |
WBorder | border () const |
Returns the border style. | |
void | setFont (const WFont &font) |
Sets the font. | |
WFont & | font () |
Returns a reference to the font. | |
void | setTextDecoration (WFlags< TextDecoration > decoration) |
Sets the text decoration options. | |
WFlags< TextDecoration > | textDecoration () const |
Returns the text decoration options. |
You can manipulate the decoration style of a single widget using WWidget::decorationStyle() or you can use a WCssDecorationStyle to add a rule to the inline style sheet using WCssStyleSheet::addRule(const std::string&, const WCssDecorationStyle& style, const std::string&).
Usage example:
Wt::WWidget *widget = ... widget->decorationStyle().setCursor(PointingHandCursor);
void WCssDecorationStyle::setCursor | ( | std::string | cursorImage, | |
Cursor | fallback = ArrowCursor | |||
) |
Sets a custom cursor image URI, with optionally a fallback cursor.
The URI should point to a .cur file (this shoul be a real .cur file, renaming an .ico is not enough for Internet Explorer).
void WCssDecorationStyle::setBackgroundImage | ( | const std::string & | imageHRef, | |
Repeat | repeat = RepeatXY , |
|||
WFlags< Side > | sides = 0 | |||
) |
Sets a background image URL.
The image may be placed in a particular location by specifying sides by OR'ing Wt::Side values together, e.g. (Right | Top).
void WCssDecorationStyle::setBackgroundImage | ( | WResource * | resource, | |
Repeat | repeat = RepeatXY , |
|||
WFlags< Side > | sides = 0 | |||
) |
Sets a background image URL.
The image may be placed in a particular location by specifying sides by OR'ing Wt::Side values together, e.g. (Right | Top).
Sets the border style.
A border may be placed in a particular location by specifying sides by OR'ing WWidget::Side values together, e.g. (Right | Top).
void WCssDecorationStyle::setTextDecoration | ( | WFlags< TextDecoration > | decoration | ) |
Sets the text decoration options.
You may logically or together any of the options of the TextDecoration enumeration.
The default is 0.