Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Border Class Reference

A Border component is responsible for drawing the border of a control. More...

#include <vcf/ApplicationKit/Border.h>

Inheritance diagram for VCF::Border:

VCF::Component VCF::ObjectWithCallbacks VCF::Object VCF::Basic3DBorder VCF::EtchedBorder VCF::Light3DBorder VCF::ThemeBorder VCF::TitledBorder VCF::ColorEtchedBorder List of all members.

Public Member Functions

 Border ()
 Border (Component *owner)
virtual ~Border ()
virtual void paint (Control *control, GraphicsContext *context)=0
 Draw the border, using the passed in context to draw on.
virtual void paint (Rect *bounds, GraphicsContext *context)=0
 paints a border in the given bounds on the context
virtual Rect getClientRect (Rect *initialBounds, Control *control)=0
 Returns a client rect in which contained components may live.

Detailed Description

A Border component is responsible for drawing the border of a control.

The border is used to produce effects like a 3D border or bevel, or a border with a text/caption area. How this is made to look is entirely up to the implementer of the component. In addition to painting the control's border, the Border instance is also responsible for correctly calculating the effect the border would have on a rectangle bounds. The getClientRect() method is used to determine, given an initial set of rectangular bounds, what effect (if any) the presence of the border would have on the initial bounds, and adjusting it if neccessary. For example, a border that paints an edge 2 pixels thick, would adjust the initial bounds by reducing it's width and height by 2 pixels on either side by calling the rect's inflate( -2, -2 ) method. Since a Border is derived from a Component, the owning component will clean up any memory for the component.


Constructor & Destructor Documentation

VCF::Border::Border  )  [inline]
 

VCF::Border::Border Component owner  )  [inline]
 

virtual VCF::Border::~Border  )  [inline, virtual]
 


Member Function Documentation

virtual Rect VCF::Border::getClientRect Rect initialBounds,
Control control
[pure virtual]
 

Returns a client rect in which contained components may live.

Thus if a particular implementation required a 3 pixel border at the edges to draw itself, then it would retrieve the component's border and then reduce it by 3 pixels. This new value is the available area that the component could use to place child components

Parameters:
Rect* - the initial bounds to calculate a new client rectangle from.
Control* - a control that may provide additional information
Returns:
Rect the new (possibly adjusted) client rectangle

Implemented in VCF::Basic3DBorder, VCF::ColorEtchedBorder, VCF::EtchedBorder, VCF::Light3DBorder, VCF::ThemeBorder, and VCF::TitledBorder.

virtual void VCF::Border::paint Rect bounds,
GraphicsContext context
[pure virtual]
 

paints a border in the given bounds on the context

Parameters:
Rect the rectangle that makes up the outer most region of the border
GraphicsContext the context on which to paint the border

Implemented in VCF::Basic3DBorder, VCF::ColorEtchedBorder, VCF::EtchedBorder, VCF::Light3DBorder, VCF::ThemeBorder, and VCF::TitledBorder.

virtual void VCF::Border::paint Control control,
GraphicsContext context
[pure virtual]
 

Draw the border, using the passed in context to draw on.

The control argument may be used for specific purposes, but typically it's just used to get the initial bounds for the border to draw within.

Implemented in VCF::Basic3DBorder, VCF::ColorEtchedBorder, VCF::EtchedBorder, VCF::Light3DBorder, VCF::ThemeBorder, and VCF::TitledBorder.


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information