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

VCF::UIComponent Class Reference

#include <vcf/ApplicationKit/UIComponent.h>

Inheritance diagram for VCF::UIComponent:

VCF::Component VCF::ObjectWithCallbacks VCF::Object VCF::Control VCF::ImageComponent VCF::Item VCF::ListSubItem VCF::Menu VCF::TreeSubItem VCF::CommandButton VCF::CustomControl VCF::Frame VCF::HTMLBrowserControl VCF::ListControl VCF::TextControl VCF::Toolbar VCF::TreeControl VCF::ColumnItem VCF::ListItem VCF::MenuItem VCF::TableCellItem VCF::TabPage VCF::ToolbarItem VCF::TreeItem VCF::MenuBar VCF::PopupMenu List of all members.

Public Member Functions

 UIComponent ()
 UIComponent (Component *owner)
 UIComponent (const String &name, Component *owner)
 UIComponent (const String &name)
virtual ~UIComponent ()
 This is protected - you should call free, or release to destroy the component.
ActiongetAction () const
 Returns the Action associated with this component.
void setAction (Action *action)
 Set's the action for the component.
virtual bool updateAction ()
 Calling this triggers an update event to be fired.
void addToUpdateList ()
 Adds the component to the framework's update list.
void removeFromUpdateList ()
 Removes the component from the framework's update list.
virtual void handleEvent (Event *event)
 generic handler method for events.

Protected Member Functions

virtual void destroy ()
 called by the free() method.

Protected Attributes

Actionaction_

Constructor & Destructor Documentation

VCF::UIComponent::UIComponent  ) 
 

VCF::UIComponent::UIComponent Component owner  ) 
 

VCF::UIComponent::UIComponent const String name,
Component owner
 

VCF::UIComponent::UIComponent const String name  ) 
 

virtual VCF::UIComponent::~UIComponent  )  [virtual]
 

This is protected - you should call free, or release to destroy the component.


Member Function Documentation

void VCF::UIComponent::addToUpdateList  ) 
 

Adds the component to the framework's update list.

This list will be traversed periodically, during idle time, and the framework will create a COMPONENT_NEEDS_UPDATING event and pass it to the component. The component can specialize this functionality by customizing the behaviour of the handleEvent() method.

virtual void VCF::UIComponent::destroy  )  [protected, virtual]
 

called by the free() method.

Should be overriden and any clean up code performed here

Reimplemented from VCF::Component.

Reimplemented in VCF::ComboBoxControl, VCF::Control, VCF::Frame, VCF::ListBoxControl, VCF::Menu, VCF::MenuBar, VCF::PopupMenu, and VCF::Window.

Action* VCF::UIComponent::getAction  )  const [inline]
 

Returns the Action associated with this component.

Any component can have an action associated with it. This allows multiple component components (like a menu item, and a push button) to share the same action and to respond in a coordinated manner to changes in state.

virtual void VCF::UIComponent::handleEvent Event event  )  [virtual]
 

generic handler method for events.

All UI events are sent here and then dispatched accordingly to a more specific event handler. If an Application class is present, then it is given a chance to "see" the event first before delegating it to the Component.

All events are dispatched by their type so it is important to correctly identify the event objects type if you would like it to be dispatched correctly. The method will call the appropriate component method, like afterCreate(), beforeDestroy(), etc.

Parameters:
Event based on the value returned by Event::getType(),

Reimplemented from VCF::Component.

Reimplemented in VCF::Control, VCF::DefaultMenuItem, VCF::HeaderControl, VCF::ListBoxControl, VCF::ListControl, VCF::ListItem, VCF::ListViewControl, VCF::Menu, VCF::MenuBar, VCF::TabbedPages, VCF::TableControl, VCF::TextControl, VCF::ToolbarItem, VCF::Toolbar, VCF::TreeControl, VCF::TreeItem, VCF::TreeListControl, and VCF::Window.

void VCF::UIComponent::removeFromUpdateList  ) 
 

Removes the component from the framework's update list.

void VCF::UIComponent::setAction Action action  ) 
 

Set's the action for the component.

virtual bool VCF::UIComponent::updateAction  )  [virtual]
 

Calling this triggers an update event to be fired.

The default behaviour is to see if the component has an action associated with it, and then calls the action's update() method.

Returns:
bool the method returns true if the component has an action and the action's update() method is called. Otherwise it returns false.
See also:
Action::update()

Reimplemented in VCF::ToolbarItem.


Member Data Documentation

Action* VCF::UIComponent::action_ [protected]
 


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