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

VCF::AbstractContainer Class Reference

AbstractContainer implements the basics of a container with the exception of actual layout rules, therefore resizeChildren is not implemented. More...

#include <vcf/ApplicationKit/AbstractContainer.h>

Inheritance diagram for VCF::AbstractContainer:

VCF::Container VCF::Component VCF::ObjectWithEvents VCF::Object VCF::StandardContainer VCF::ColumnLayoutContainer VCF::DesignTimeContainer VCF::HorizontalLayoutContainer List of all members.

Public Member Functions

 AbstractContainer ()
 AbstractContainer (Component *owner)
virtual ~AbstractContainer ()
void init ()
 This is going to be removed from the bext release.
virtual void add (Control *child)
 adds a child control to this container
virtual void add (Control *child, const AlignmentType &alignment)
 adds a child control using the specified AlignmentType.
virtual void remove (Control *child)
 removes the child control from the container - does NOT delete the control
virtual void paintChildren (GraphicsContext *context)
 Paints all children of this container.
virtual Enumerator< Control * > * getChildren ()
 returns an Enumerator of controls that represents all the children in this container.
virtual uint32 getChildCount ()
 returns the numer of child controls that this container has.
virtual ControlfindControl (const String &controlName)
 searches through all the child controls of this container.
virtual ControlgetControlAtIndex (const uint32 &index)
virtual int32 getControlIndex (Control *control)
virtual void updateTabOrder (Control *child, uint32 &newTabOrder)
virtual void getTabList (std::vector< Control * > &tabList)
virtual void insertBeforeControl (Control *child, const AlignmentType &alignment, Control *afterControl)
 inserts a child control into this container before the control specified in beforeControl.
virtual void insertAtIndex (Control *child, const AlignmentType &alignment, const uint32 &index)
 inserts a child control into this container after the specified index.
virtual void clear ()
 removes all child controls
virtual void sendControlToFront (Control *child)
 Sends the specified child to the first position in containers list.
virtual void sendControlToBack (Control *child)
 Sends the specified child to the last position in containers list.
virtual void setContainerControl (Control *control)
 Sets the control that this container is attached to and responds to events from.
virtual ControlgetContainerControl ()

Protected Member Functions

void containerResized (ControlEvent *event)
void onMouseEvent (MouseEvent *event)

Protected Attributes

std::vector< Control * > controls_
EnumeratorContainer< std::vector<
Control * >, Control * > 
controlsContainer_
std::map< int32, Control * > tabOrderMap_
int32 currentTabControlIndex_
ControlcontrolContainer_
EventHandlercontrolHandler_
EventHandlermouseHandler_

Detailed Description

AbstractContainer implements the basics of a container with the exception of actual layout rules, therefore resizeChildren is not implemented.

It is left to implementers to decide on their own what the layout rules for resizeChildren() are.

It responds to all mouse and paint events of the Control to which is attached to, and forwards them correctly to the child controls. This event forwarding only takes place if the child control is a lighweight control.

When the attached control is resized, the AbstractContainer will detect this as well and call resizeChildren() where appropriate.


Constructor & Destructor Documentation

VCF::AbstractContainer::AbstractContainer  ) 
 

VCF::AbstractContainer::AbstractContainer Component owner  ) 
 

virtual VCF::AbstractContainer::~AbstractContainer  )  [virtual]
 


Member Function Documentation

virtual void VCF::AbstractContainer::add Control child,
const AlignmentType alignment
[virtual]
 

adds a child control using the specified AlignmentType.

The child's alignment also will get set to this value.

Parameters:
Control* the control to add
AlignmentType the alignment type to add the child with
Value Meaning
ALIGN_NONE The default value for a control's alignment. The control's top, left, width, and height are what determine it's position, regardless of surrounding controls.
ALIGN_TOP The control moves to the top of the parent container and resizes to fill in the width of the parent control. The height of the control is not altered during parent dimension changes.
ALIGN_BOTTOM The control moves to the bottom of the parent container and resizes to fill in the width of the parent control. The height of the control is not altered during parent dimension changes.
ALIGN_LEFT The control moves to the left side of the parent container and resizes to fill in the height of the parent control. The width of the control is not altered during parent dimension changes.
ALIGN_RIGHT The control moves to the right side of the parent container and resizes to fill in the height of the parent control. The width of the control is not altered during parent dimension changes.
ALIGN_CLIENT The control resizes to fill in the remaining client area of a form (after all other alignment positions of other controls are calculated).

Implements VCF::Container.

virtual void VCF::AbstractContainer::add Control child  )  [virtual]
 

adds a child control to this container

Parameters:
Control the child control to add Note: the child is added with the alignment type that is already set on the child.

Implements VCF::Container.

virtual void VCF::AbstractContainer::clear  )  [virtual]
 

removes all child controls

Implements VCF::Container.

void VCF::AbstractContainer::containerResized ControlEvent event  )  [protected]
 

virtual Control* VCF::AbstractContainer::findControl const String controlName  )  [virtual]
 

searches through all the child controls of this container.

The first child control whose name matches the name passed in is returned as a result of the search. If the container ahs no children, or none of the child controls have a name that matches then NULL is returned.

Parameters:
String the name of the child control to find
Returns:
Control the result of the search, NULL if nothing nothing was found, otherwise a valid pointer to a child control of this container.

Implements VCF::Container.

virtual uint32 VCF::AbstractContainer::getChildCount  )  [virtual]
 

returns the numer of child controls that this container has.

Implements VCF::Container.

virtual Enumerator<Control*>* VCF::AbstractContainer::getChildren  )  [virtual]
 

returns an Enumerator of controls that represents all the children in this container.

Returns:
Enumerator<Control*> an enunerator of all the child controls that this container has.

Implements VCF::Container.

virtual Control* VCF::AbstractContainer::getContainerControl  )  [inline, virtual]
 

Implements VCF::Container.

virtual Control* VCF::AbstractContainer::getControlAtIndex const uint32 index  )  [virtual]
 

Implements VCF::Container.

virtual int32 VCF::AbstractContainer::getControlIndex Control control  )  [virtual]
 

Implements VCF::Container.

virtual void VCF::AbstractContainer::getTabList std::vector< Control * > &  tabList  )  [virtual]
 

Implements VCF::Container.

void VCF::AbstractContainer::init  ) 
 

This is going to be removed from the bext release.

Deprecated:

Reimplemented from VCF::Object.

virtual void VCF::AbstractContainer::insertAtIndex Control child,
const AlignmentType alignment,
const uint32 index
[virtual]
 

inserts a child control into this container after the specified index.

If the child is already present then it's order in the container list is modified accordingly. If the index specified is not within the container list's bounds then the child is added at the end of the list

Implements VCF::Container.

virtual void VCF::AbstractContainer::insertBeforeControl Control child,
const AlignmentType alignment,
Control afterControl
[virtual]
 

inserts a child control into this container before the control specified in beforeControl.

If the child is already present then it's order in the container list is modified accordingly. If the beforeControl control is not found in the list of children then the child is added at the beginning of the list

Implements VCF::Container.

void VCF::AbstractContainer::onMouseEvent MouseEvent event  )  [protected]
 

virtual void VCF::AbstractContainer::paintChildren GraphicsContext context  )  [virtual]
 

Paints all children of this container.

Implements VCF::Container.

virtual void VCF::AbstractContainer::remove Control child  )  [virtual]
 

removes the child control from the container - does NOT delete the control

Parameters:
Control the control to remove from this container

Implements VCF::Container.

virtual void VCF::AbstractContainer::sendControlToBack Control child  )  [virtual]
 

Sends the specified child to the last position in containers list.

Implements VCF::Container.

virtual void VCF::AbstractContainer::sendControlToFront Control child  )  [virtual]
 

Sends the specified child to the first position in containers list.

Implements VCF::Container.

virtual void VCF::AbstractContainer::setContainerControl Control control  )  [virtual]
 

Sets the control that this container is attached to and responds to events from.

Implements VCF::Container.

virtual void VCF::AbstractContainer::updateTabOrder Control child,
uint32 newTabOrder
[virtual]
 

Implements VCF::Container.


Member Data Documentation

Control* VCF::AbstractContainer::controlContainer_ [protected]
 

EventHandler* VCF::AbstractContainer::controlHandler_ [protected]
 

std::vector<Control*> VCF::AbstractContainer::controls_ [protected]
 

EnumeratorContainer<std::vector<Control*>, Control*> VCF::AbstractContainer::controlsContainer_ [protected]
 

int32 VCF::AbstractContainer::currentTabControlIndex_ [protected]
 

EventHandler* VCF::AbstractContainer::mouseHandler_ [protected]
 

std::map<int32,Control*> VCF::AbstractContainer::tabOrderMap_ [protected]
 


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