CornerImage Class Reference
[Style example]

The CornerImage is an image to draw a rounded corner. More...

#include <CornerImage.h>

Inherits Wt::WImage.

Inheritance diagram for CornerImage:

Inheritance graph
[legend]
List of all members.

Public Types

 TopLeft = Top | Left
 Top left.
 TopRight = Top | Right
 Top right.
 BottomLeft = Bottom | Left
 Bottom left.
 BottomRight = Bottom | Right
 Bottom right.
enum  Corner { TopLeft = Top | Left, TopRight = Top | Right, BottomLeft = Bottom | Left, BottomRight = Bottom | Right }
 One of the four corners of a widget. More...

Public Member Functions

 CornerImage (Corner corner, WColor fg, WColor bg, int radius, WContainerWidget *parent=0)
 Construct a new CornerImage.
 ~CornerImage ()
 CornerImage destructor.
void setRadius (int radius)
 Change the corner radius (and image dimensions).
int radius () const
 Get the corner radius.
void setForeground (WColor color)
 Change the foreground color.
WColor foreground () const
 Get the foreground color.
void setBackground (WColor color)
 Change the background color.
WColor background () const
 Get the background color.

Private Member Functions

void compute ()
 Regenerate the image.

Private Attributes

Corner corner_
 One of the four corners, which this image represents.
WColor fg_
 Foreground color.
WColor bg_
 Background color.
int radius_
 Radius.
WMemoryResourceresource_
 The resource which contains the generated image.

Detailed Description

The CornerImage is an image to draw a rounded corner.

The CornerImage is a dynamically generated WImage, which draws an arc of 90°, to represent one of the four corners of a widget.

The CornerImage is part of the Wt style example.

See also:
RoundedWidget

Definition at line 33 of file CornerImage.h.


Member Enumeration Documentation

enum CornerImage::Corner

One of the four corners of a widget.

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

Definition at line 38 of file CornerImage.h.


Constructor & Destructor Documentation

CornerImage::CornerImage ( Corner  corner,
WColor  fg,
WColor  bg,
int  radius,
WContainerWidget parent = 0 
)

Construct a new CornerImage.

Construct a corner image, to draw the specified corner, with the given foreground and background color, and the specified radius.

The colors must be constructed using red/green/blue values, using WColor::WColor(int, int, int).

Definition at line 13 of file CornerImage.C.

CornerImage::~CornerImage (  ) 

CornerImage destructor.

Definition at line 25 of file CornerImage.C.


Member Function Documentation

WColor CornerImage::background (  )  const [inline]

Get the background color.

Definition at line 81 of file CornerImage.h.

void CornerImage::compute (  )  [private]

Regenerate the image.

Definition at line 48 of file CornerImage.C.

WColor CornerImage::foreground (  )  const [inline]

Get the foreground color.

Definition at line 73 of file CornerImage.h.

int CornerImage::radius (  )  const [inline]

Get the corner radius.

Definition at line 65 of file CornerImage.h.

void CornerImage::setBackground ( WColor  color  ) 

Change the background color.

void CornerImage::setForeground ( WColor  color  ) 

Change the foreground color.

Definition at line 40 of file CornerImage.C.

void CornerImage::setRadius ( int  radius  ) 

Change the corner radius (and image dimensions).

Definition at line 32 of file CornerImage.C.


Member Data Documentation

WColor CornerImage::bg_ [private]

Background color.

Definition at line 91 of file CornerImage.h.

Corner CornerImage::corner_ [private]

One of the four corners, which this image represents.

Definition at line 85 of file CornerImage.h.

WColor CornerImage::fg_ [private]

Foreground color.

Definition at line 88 of file CornerImage.h.

int CornerImage::radius_ [private]

Radius.

Definition at line 94 of file CornerImage.h.

WMemoryResource* CornerImage::resource_ [private]

The resource which contains the generated image.

Definition at line 98 of file CornerImage.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