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

VCF::CustomControl Class Reference

This is the base class for custom controls that are not based on existing native controls. More...

#include <vcf/ApplicationKit/CustomControl.h>

Inheritance diagram for VCF::CustomControl:

VCF::Control VCF::Component VCF::AbstractView VCF::ObjectWithEvents VCF::View VCF::Object VCF::ActiveXControlHost VCF::ComboBoxControl VCF::ControlContainer VCF::HeaderControl VCF::ImageControl VCF::Label VCF::ListBoxControl VCF::OpenGLControl VCF::ProgressControl VCF::PushButton VCF::SliderControl VCF::Splitter VCF::TabbedPages VCF::TableControl VCF::ToggledButton VCF::ToolbarDock VCF::TreeListControl List of all members.

Public Member Functions

 CustomControl ()
virtual ~CustomControl ()
 CustomControl (const bool &useHeavyweightPeer)
virtual void paint (GraphicsContext *context)
 Paints the control.
void init ()
 This is going to be removed from the bext release.
virtual bool isLightWeight ()
 identifies the control as a lightweight control.
bool isTransparent ()
 does this control allow the background of it's parent to show through ? Currently only applicable to lightweight controls
void setTransparent (const bool &transparent)
 sets whether or not the controls paints a background and covers it's parent
void setUseColorForBackground (const bool &val)
 sets if we want to use the control's color to draw the control's background; otherwise the theme background is drawn.
bool getUseColorForBackground ()
 gets if we use the control's color to draw the control's background

Protected Attributes

bool isLightweight_
bool isTransparent_
bool useColorForBackground_

Detailed Description

This is the base class for custom controls that are not based on existing native controls.

For example if you were going to make a clock control, you'd probably start with deriving a new class from this one and overriding the paint() to draw your clock.


Constructor & Destructor Documentation

VCF::CustomControl::CustomControl  ) 
 

virtual VCF::CustomControl::~CustomControl  )  [virtual]
 

VCF::CustomControl::CustomControl const bool &  useHeavyweightPeer  ) 
 


Member Function Documentation

bool VCF::CustomControl::getUseColorForBackground  )  [inline]
 

gets if we use the control's color to draw the control's background

Returns:
bool, true if we use the control's color, false if it uses the theme background.

void VCF::CustomControl::init  ) 
 

This is going to be removed from the bext release.

Deprecated:

Reimplemented from VCF::Object.

Reimplemented in VCF::ComboBoxControl, VCF::ControlContainer, VCF::ListBoxControl, VCF::Panel, VCF::Splitter, VCF::TabbedPages, VCF::TableControl, and VCF::TreeListControl.

virtual bool VCF::CustomControl::isLightWeight  )  [virtual]
 

identifies the control as a lightweight control.

Lightweight control's do not take up windowing system resources, instead, they rely on all events and paint notification be sent to them via their parents. The default return for this is false, so only those controls specifically actign as light weight Controls need to return true

Reimplemented from VCF::Control.

bool VCF::CustomControl::isTransparent  ) 
 

does this control allow the background of it's parent to show through ? Currently only applicable to lightweight controls

virtual void VCF::CustomControl::paint GraphicsContext context  )  [virtual]
 

Paints the control.

Called by the underlying windowing system whenever the control needs to be painted. Note that in some cases the GraphicsContext passed in to this method may not be the same pointer as the GraphicsContext that the control holds itself. During the paint() method you should only use the context value for all your drawing and not the one returned in getContext(). The value returned by getContext() should be used for drawing that takes place outside of the paint() method.

If the control allows paint notification, then the framework will fire an event to the BeforeControlPainted delegate prior to calling the control's paint() method. After the paint() method has returned, if the control allows paint notification, the framework will fire an event to the AfterControlPainted delegate. This allows outside observers to take part in the paint cycle, but beware that this does come at a bit of a cost, so use this feature sparingly.

Note: This should NEVER be called by programmers using the VCF, it will be called for you during the course of your applications native event loop, and is only here for providing custom drawing routines for controls. In other words: you implement it, you never call it yourself.

See also:
getAllowPaintNotification

Implements VCF::Control.

Reimplemented in VCF::CheckBoxControl, VCF::ComboBoxControl, VCF::ControlContainer, VCF::HeaderControl, VCF::ImageControl, VCF::Label, VCF::ListBoxControl, VCF::Panel, VCF::ProgressControl, VCF::PushButton, VCF::RadioButtonControl, VCF::SliderControl, VCF::Splitter, VCF::TabbedPages, VCF::TabbedPages::ScrollButton, VCF::TableControl, VCF::ToolbarDock, VCF::TreeListControl, and VCF::OpenGLControl.

void VCF::CustomControl::setTransparent const bool &  transparent  ) 
 

sets whether or not the controls paints a background and covers it's parent

Reimplemented in VCF::ImageControl.

void VCF::CustomControl::setUseColorForBackground const bool &  val  )  [inline]
 

sets if we want to use the control's color to draw the control's background; otherwise the theme background is drawn.

Parameters:
const bool&, true if we use the control's color, false if we draw the theme background.


Member Data Documentation

bool VCF::CustomControl::isLightweight_ [protected]
 

bool VCF::CustomControl::isTransparent_ [protected]
 

bool VCF::CustomControl::useColorForBackground_ [protected]
 


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