RoundedWidget Class Reference
[Style example]

A widget with rounded corners. More...

#include <RoundedWidget.h>

Inherits Wt::WCompositeWidget.

Inheritance diagram for RoundedWidget:

Inheritance graph
[legend]
List of all members.

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.
WContainerWidgetcontents () 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.
WContainerWidgetcontents_
 The container widget in which to store the contents.
WContainerWidgetimpl_
 This composite widget is implemented as a WContainerWidget.
WContainerWidgettop_
 A container at the top which renders the top rounding.
WContainerWidgetbottom_
 A container at the bottom renders the bottom rounding.
CornerImageimages_ [4]
 Up to four CornerImages for each corner.

Detailed Description

A widget with rounded corners.

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.

See also:
CornerImage.

Definition at line 41 of file RoundedWidget.h.


Member Enumeration Documentation

enum RoundedWidget::Corner

One of the four corners of a widget.

Enumerator:
TopLeft  Top left.
TopRight  Top right.
BottomLeft  Bottom left.
BottomRight  Bottom right.
All 

Definition at line 46 of file RoundedWidget.h.


Constructor & Destructor Documentation

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 (  ) 

Destruct a RoundedWidget.

Definition at line 27 of file RoundedWidget.C.


Member Function Documentation

void RoundedWidget::adjust (  )  [private]

Adjust the image (colors and radius).

Definition at line 106 of file RoundedWidget.C.

WColor RoundedWidget::backgroundColor (  )  const [inline]

Get the widget background color.

Definition at line 71 of file RoundedWidget.h.

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]

Get the corner radius of the widget.

Definition at line 79 of file RoundedWidget.h.

void RoundedWidget::create (  )  [private]

Create the implementation.

Definition at line 35 of file RoundedWidget.C.

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  ) 

Set the corner radius of the widget.

Definition at line 100 of file RoundedWidget.C.

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]

Get the surrounding color of the widget.

Definition at line 90 of file RoundedWidget.h.


Member Data Documentation

WColor RoundedWidget::backgroundColor_ [private]

Background color.

Definition at line 101 of file RoundedWidget.h.

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]

Up to four CornerImages for each corner.

Definition at line 125 of file RoundedWidget.h.

WContainerWidget* RoundedWidget::impl_ [private]

This composite widget is implemented as a WContainerWidget.

Definition at line 116 of file RoundedWidget.h.

int RoundedWidget::radius_ [private]

Radius.

Definition at line 107 of file RoundedWidget.h.

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.


The documentation for this class was generated from the following files:
Generated on Sun Jul 1 19:37:24 2007 for Wt by doxygen 1.4.7