#include <RoundedWidget.h>
Inherits Wt::WCompositeWidget.
Inheritance diagram for RoundedWidget:

Public Types | |
| TopLeft = CornerImage::TopLeft | |
| Top left. | |
| TopRight = CornerImage::TopRight | |
| Top right. | |
| BottomLeft = CornerImage::BottomLeft | |
| Bottom left. | |
| BottomRight = CornerImage::BottomRight | |
| Bottom right. | |
| All = 0xF | |
| enum | Corner { TopLeft = CornerImage::TopLeft, TopRight = CornerImage::TopRight, BottomLeft = CornerImage::BottomLeft, BottomRight = CornerImage::BottomRight, All = 0xF } |
| One of the four corners of a widget. More... | |
Public Member Functions | |
| RoundedWidget (int corners=All, WContainerWidget *parent=0) | |
| Construct a widget with any combination of its corners rounded. | |
| ~RoundedWidget () | |
| Destruct a RoundedWidget. | |
| void | setBackgroundColor (WColor color) |
| Set the widget background color. | |
| WColor | backgroundColor () const |
| Get the widget background color. | |
| void | setCornerRadius (int radius) |
| Set the corner radius of the widget. | |
| int | cornerRadius () const |
| Get the corner radius of the widget. | |
| void | setSurroundingColor (WColor color) |
| Set the surrounding color of the widget. | |
| WColor | surroundingColor () const |
| Get the surrounding color of the widget. | |
| WContainerWidget * | contents () const |
| Access the contents container. | |
Private Member Functions | |
| void | create () |
| Create the implementation. | |
| void | adjust () |
| Adjust the image (colors and radius). | |
Private Attributes | |
| WColor | backgroundColor_ |
| Background color. | |
| WColor | surroundingColor_ |
| "Surrounding" color -- maybe we can use a transparent color ? | |
| int | radius_ |
| Radius. | |
| int | corners_ |
| OR'ed specification of the corners which are to be rounded. | |
| WContainerWidget * | contents_ |
| The container widget in which to store the contents. | |
| WContainerWidget * | impl_ |
| This composite widget is implemented as a WContainerWidget. | |
| WContainerWidget * | top_ |
| A container at the top which renders the top rounding. | |
| WContainerWidget * | bottom_ |
| A container at the bottom renders the bottom rounding. | |
| CornerImage * | images_ [4] |
| Up to four CornerImages for each corner. | |
This widgets represents a widget for which any combination of its four corners may be rounded. Although rounded corners is not a standard part of the CSS specification, this widget will be rendered identical on all platforms.
The contents of the widget is managed inside a WContainerWidget, which is accessed using the contents() method.
The radius of the rounded corners, the background color of the image, and the surrounding color may be changed at all times.
The RoundedWidget is part of the Wt style example.
Definition at line 41 of file RoundedWidget.h.
One of the four corners of a widget.
| TopLeft | Top left. |
| TopRight | Top right. |
| BottomLeft | Bottom left. |
| BottomRight | Bottom right. |
| All |
Definition at line 46 of file RoundedWidget.h.
| RoundedWidget::RoundedWidget | ( | int | corners = All, |
|
| WContainerWidget * | parent = 0 | |||
| ) |
Construct a widget with any combination of its corners rounded.
Definition at line 14 of file RoundedWidget.C.
| RoundedWidget::~RoundedWidget | ( | ) |
| void RoundedWidget::adjust | ( | ) | [private] |
| WColor RoundedWidget::backgroundColor | ( | ) | const [inline] |
| WContainerWidget* RoundedWidget::contents | ( | ) | const [inline] |
Access the contents container.
The contents WContainerWidget represents the contents inside the rounded widget.
Definition at line 97 of file RoundedWidget.h.
| int RoundedWidget::cornerRadius | ( | ) | const [inline] |
| void RoundedWidget::create | ( | ) | [private] |
| void RoundedWidget::setBackgroundColor | ( | WColor | color | ) |
Set the widget background color.
Because the background color also affects the color of the corner images, the background color cannot be set using the WCssDecorationStyle() of the widget.
Definition at line 94 of file RoundedWidget.C.
| void RoundedWidget::setCornerRadius | ( | int | radius | ) |
| void RoundedWidget::setSurroundingColor | ( | WColor | color | ) |
Set the surrounding color of the widget.
This color will be used "outside" the corner, in each of the corner images.
| WColor RoundedWidget::surroundingColor | ( | ) | const [inline] |
WColor RoundedWidget::backgroundColor_ [private] |
WContainerWidget* RoundedWidget::bottom_ [private] |
A container at the bottom renders the bottom rounding.
Definition at line 122 of file RoundedWidget.h.
WContainerWidget* RoundedWidget::contents_ [private] |
The container widget in which to store the contents.
Definition at line 113 of file RoundedWidget.h.
int RoundedWidget::corners_ [private] |
OR'ed specification of the corners which are to be rounded.
Definition at line 110 of file RoundedWidget.h.
CornerImage* RoundedWidget::images_[4] [private] |
WContainerWidget* RoundedWidget::impl_ [private] |
This composite widget is implemented as a WContainerWidget.
Definition at line 116 of file RoundedWidget.h.
int RoundedWidget::radius_ [private] |
WColor RoundedWidget::surroundingColor_ [private] |
"Surrounding" color -- maybe we can use a transparent color ?
Definition at line 104 of file RoundedWidget.h.
WContainerWidget* RoundedWidget::top_ [private] |
A container at the top which renders the top rounding.
Definition at line 119 of file RoundedWidget.h.
1.4.7