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

VCF::CommandButton Class Reference

The CommandButton is a native push button that fires an event when pressed, or "clicked". More...

#include <vcf/ApplicationKit/CommandButton.h>

Inheritance diagram for VCF::CommandButton:

VCF::Control VCF::Button VCF::UIComponent VCF::AbstractView VCF::Component VCF::View VCF::ObjectWithCallbacks VCF::Object List of all members.

Public Member Functions

 CommandButton ()
virtual ~CommandButton ()
virtual void addButtonClickHandler (EventHandler *handler)
 This macro creates a method for adding a listener to the CommandButton's events.
virtual void removeButtonClickHandler (EventHandler *handler)
 This macro creates a method for removing a listener to the CommandButton's events.
virtual void click ()
 This represents the user pressing the button, which then invokes whatever command is associated with the button.
virtual void setDefault (const bool &defaultButton)
 sets this button as the default button.
virtual bool isDefault ()
virtual void setName (const String &name)
 sets the name of the component.
void setCaption (const String &caption)
 sets the caption for the button.
String getCaption ()
ButtonCommandType getCommandType ()
 The command type the button represents.
void setCommandType (const ButtonCommandType &commandType)
 sets the
virtual void paint (GraphicsContext *context)
 Paints the control.
void setIsPressed (const bool &pressed)
bool isPressed ()
virtual void mnemonicActivate ()
 Pressing the accelerator character will cause the control's mnemonicActivate() method to be fired, which by default sets focus to the control.
virtual double getPreferredHeight ()
 returns the preferred height for this control.
virtual double getPreferredWidth ()
 returns the preferred width for this control.
virtual bool generatePropertyValue (const String &fullPropertyName, Property *property, VariantData *value, String &strValue)

Public Attributes

VCF::Delegate ButtonDelegate
VCF::Delegate ButtonClicked

Protected Member Functions

void onFocusGained (FocusEvent *event)
void onFocusLost (FocusEvent *event)

Protected Attributes

bool isPressed_
ButtonPeerbuttonPeer_
String caption_
ButtonCommandType commandType_

Detailed Description

The CommandButton is a native push button that fires an event when pressed, or "clicked".

Event Delegates for this class:


Constructor & Destructor Documentation

VCF::CommandButton::CommandButton  ) 
 

virtual VCF::CommandButton::~CommandButton  )  [virtual]
 


Member Function Documentation

virtual void VCF::CommandButton::addButtonClickHandler EventHandler handler  )  [inline, virtual]
 

This macro creates a method for adding a listener to the CommandButton's events.

virtual void VCF::CommandButton::click  )  [virtual]
 

This represents the user pressing the button, which then invokes whatever command is associated with the button.

It should be called in the implementing controls class whenever the control is "clicked" on (see Control::mouseClick() ), it can also be called programmatically as well.

Implements VCF::Button.

virtual bool VCF::CommandButton::generatePropertyValue const String fullPropertyName,
Property property,
VariantData value,
String strValue
[virtual]
 

Reimplemented from VCF::Control.

String VCF::CommandButton::getCaption  ) 
 

ButtonCommandType VCF::CommandButton::getCommandType  ) 
 

The command type the button represents.

Certain command types will automatically send the event to the dialog they belong to when used on modal dialogs.

virtual double VCF::CommandButton::getPreferredHeight  )  [virtual]
 

returns the preferred height for this control.

This is used when determing the height of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size.

Reimplemented from VCF::Control.

virtual double VCF::CommandButton::getPreferredWidth  )  [virtual]
 

returns the preferred width for this control.

This is used when determing the width of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size.

Reimplemented from VCF::Control.

virtual bool VCF::CommandButton::isDefault  )  [virtual]
 

Implements VCF::Button.

bool VCF::CommandButton::isPressed  )  [inline]
 

virtual void VCF::CommandButton::mnemonicActivate  )  [virtual]
 

Pressing the accelerator character will cause the control's mnemonicActivate() method to be fired, which by default sets focus to the control.

Reimplemented from VCF::Control.

void VCF::CommandButton::onFocusGained FocusEvent event  )  [protected]
 

void VCF::CommandButton::onFocusLost FocusEvent event  )  [protected]
 

virtual void VCF::CommandButton::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.

virtual void VCF::CommandButton::removeButtonClickHandler EventHandler handler  )  [inline, virtual]
 

This macro creates a method for removing a listener to the CommandButton's events.

void VCF::CommandButton::setCaption const String caption  ) 
 

sets the caption for the button.

The is the text that is displayed on the button's face

void VCF::CommandButton::setCommandType const ButtonCommandType commandType  ) 
 

sets the

virtual void VCF::CommandButton::setDefault const bool &  defaultButton  )  [virtual]
 

sets this button as the default button.

A default button will have it's click() event called whenever the enter key is hit.

Implements VCF::Button.

void VCF::CommandButton::setIsPressed const bool &  pressed  )  [inline]
 

virtual void VCF::CommandButton::setName const String name  )  [virtual]
 

sets the name of the component.

For naming conventions/rules please see getName().

Reimplemented from VCF::Component.


Member Data Documentation

VCF::Delegate VCF::CommandButton::ButtonClicked
 

VCF::Delegate VCF::CommandButton::ButtonDelegate
 

Event Delegate:
ButtonClicked this is fired when the button is clicked, either in response to events sent by the native windowing system, or in response to calling the click() method.
event class: ButtonEvent
See also:
click()

ButtonPeer* VCF::CommandButton::buttonPeer_ [protected]
 

String VCF::CommandButton::caption_ [protected]
 

ButtonCommandType VCF::CommandButton::commandType_ [protected]
 

bool VCF::CommandButton::isPressed_ [protected]
 


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