Main Page | Packages | Class Tree | Index | Help

xp.controls

class Container

MovieClip
  |
  +--xp.system.UIControl
        |
        +--xp.controls.Container

Implemented Interfaces: IContainer
All Known Subclasses: Box, Canvas, DockPanel, Form, ItemPanel, ListItemsControl, MDController, RowPanel

class Container
extends UIControl

Base class for all component containers


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public
__showStatusBar: Boolean


public
__showTitleBar: Boolean


public
acceptButton: Object
Gets or sets the button control that is clicked when the user presses the ENTER key.

public
cancelButton: Object
Gets or sets the button control that is clicked when the user presses the ESC key.

public
children: Array
List of child controls index by number

public static
classInfo: Object
A static class information object

public
controlBar
internal reference to the controlbar clip

public
controls: Object
List of child controls index by id

public
dataSource
The dataSource this control is bound to.

public
enableBGMouseEvents: Boolean
Controls whether mouse event handlers are set on the background or foreground.

public
initialFocusControl: Object
The control to be focused when this form is displayed for the first time

public
isRoot: Boolean
Is this a root container

public
lastFocus: Object
The last control that had focus

public
layoutDescriptor: XMLNode
The layoutDescriptor associated with this class **/

public
layoutId: String
The layoutId associated with this class **/

public
layoutManager: ILayoutManager
The layout manager responsible for laying control in the container

public
rootContainer: Object
The container at the root of the container heirarchy

public
styleClass: String
The name of the style class this instance will use.

public
symbolId: String
The symbolId associated with this class **/

public
tabList: Array
List of tabable controls in tabOrder

public
tabModeWrap: Boolean
Controls the mode of tabbing

Fields inherited from class xp.system.UIControl

__layout, allowDrop, autoLayout, bindingDefaultValue, bindingFormatter, bindingPath, bindingSource, bindingType, bindingValidator, border, causesValidation, classInfo, clickOnENTER, clickOnSPACE, container, context, data, disableAcceptButton, disableCancelButton, enableBGMouseEvents, enableDblClickEvent, enableKeyDownEvents, enableKeyEvents, enableKeyUpEvents, enableMouseWheelEvents, formatterOptions, horizontalAlignment, index, isBinding, itemId, logEnabled, parent, parentContainer, parentForm, percentageHeight, percentageWidth, styleClass, tabIndex, tabStop, tooltip, tree, verticalAlignment

Property Summary

public
childCount: Number (read-only)
Count of child controls created in this container

public
footerHeight: Number (read, write)
footer of the container header section *

public
headerHeight: Number (read, write)
height of the container header section *

public
innerBackground (read, write)
Color of inner background area

public
innerBackgroundVisible: Boolean (read, write)
Indicates whether the inner background is visible or not

public
innerBorderBrush: Object (read, write)
A Brush object used to paint the controls border.

public
innerBorderRadius (read, write)
Sets or get the radius of the inner face

public
innerBorderStyle (read, write)
inner border style

public
innerBorderThickness (read, write)
Sets or get the radius of the inner face

public
numChildren: Number (read-only)
/** Count of child controls created in this container

public
showStatusBar: Boolean (read, write)


public
showTitleBar: Boolean (read, write)


public
status: String (read, write)
Gets or sets the window status text

public
title: String (read, write)
Gets or sets the window title text

Properties inherited from class xp.system.UIControl

alpha, autosize, background, backgroundVisible, bindings, borderBrush, borderRadius, borderShadow, borderStyle, borderThickness, bottom, dataSource, enableMouseEvents, focusManager, height, id, isEnabled, isFocused, isMouseOver, isPressed, isSelected, isValid, layout, left, margin, maxHeight, maxWidth, measuredHeight, measuredMinHeight, measuredMinWidth, measuredWidth, minHeight, minWidth, padding, readOnly, resources, right, styleName, top, triggers, visible, width, x, y

Constructor

public
Container ( )
Constructor - This should not be called directly.


Method Summary

public
addChild ( compDesc: Object ): Object
Adds a child control to a container

public
addChildren ( compDesc: Array ): Void
Adds an array of children to a container

public
addControlBar ( compDesc: Object ): Object


public
clearAll ( ): Void
Remove all child components from the container Descripition Removes and destroys all child controls. Also clears the children and tabList arrays.

public
createChild ( className: Object, instanceName: String, initProps: Object ): Object
Adds a child control to a container

public
destroyChildAt ( index: Number ): Void
Destroys the child at the specified index

public
getChild ( index: Number ): Object
Deprecated. 

public
getChildAt ( index: Number ): Object
Returns a reference to the child specified by the index param in the container children array

public
getChildFromMouse ( ): Number
Figure out which control was clicked from the mouse position

public
getClass ( ): Function
Returns a reference to the components static class

public
getFooterHeight ( ): Number


public
getHeaderHeight ( ): Number


public
getNextControl ( index: Number, fwd: Boolean, wrap: Boolean ): Number
Retrieves the next control forward or back in the tab order of child controls.

public
getUIBuilder ( ): Object
Reference to the UIBuilder object

public
getViewMetrics ( ): Thickness
the margins or offsets for the body view used by the layout system*

public
initLayoutManager ( ): Void
Class of layout manager to create, string or class reference *

public
onChildFocus ( ctl: Object, focusCtl: Object ): Void
A callback from a child control when it gains focus*

public
processEnterKey ( )
Process enter key event

public
processEscapeKey ( )
Process escape key event

public
registerChild ( ctl ): Void
Register the ctl as a child of this container

public
selectNextControl ( ctl: Object, fwd: Boolean, tabStopOnly: Boolean, wrap: Boolean ): Object
Activates the next control.

public
setDataContext ( data: Object, context: Object ): Void
Updates a containers data context information

public
setFocus ( )
Overrides the ancestor method to find the first focusable control on a form

public
setMeasuredMinSize ( w: Number, h: Number )
Called by the LayoutManger to set the measured size of the container*

public
setMeasuredSize ( w: Number, h: Number )
Called by the LayoutManger to set the measured size of the container*

public
unregisterChild ( ctl ): Void
Unregister the ctl as a child of this container

Methods inherited from class xp.system.UIControl

addBinding, addBindings, addEventListener, addPropertyTrigger, applyStyle, beginDeferUpdate, canUpdate, centerContent, checkState, containsFocus, destroy, destroyObject, drawFocus, endDeferUpdate, findFocusFromObject, findFocusInChildren, getBinding, getBounds, getCenter, getClass, getFocus, getFocusManager, getFocusRect, getLocation, getPropertyValue, getSize, getStateName, getTrigger, globalToLocalPoint, invalidate, invalidateLayout, invalidateSize, invalidateSizeAndLayout, invalidChild, isChild, isMouseDirectlyOver, isParent, localToGlobalPoint, localToLocalPoint, measure, mouseWheel, move, onChildFocus, onKillFocus, onSetFocus, processEnterKey, processEscapeKey, processTabKey, redraw, refresh, removeEventListener, routeEvent, setBounds, setFocus, setLocation, setPropertyValue, setSize, setValueChanged, update, validate



Field Documentation

__showStatusBar

public var __showStatusBar: Boolean

__showTitleBar

public var __showTitleBar: Boolean

acceptButton

public var acceptButton: Object
Gets or sets the button control that is clicked when the user presses the ENTER key.

This property allows you to designate a default action to occur when the user presses the ENTER key in your application. The button assigned to this property must be on the current form or located within a container on the current form. You can use this property to allow the user to quickly navigate a simple form by allowing them to simply press the ENTER key when they are finished instead of manually clicking the accept button with their mouse. `* The accept button might not be activated if the currently selected control on the form intercepts the ENTER key and processes it. For example, a multiline text control allows the ENTER key to be pressed when it is selected to insert a new line character in the control.

cancelButton

public var cancelButton: Object
Gets or sets the button control that is clicked when the user presses the ESC key.

The cancel button for a form is the button control that is clicked whenever the user presses the ESC key. The button assigned to this property must be on the current form or located within a container on the current form. This property allows you to designate a default action to occur when the user presses the ESC key in your application. You can use this property to allow the user to quickly navigate a simple form by allowing them to simply press the ESC key to close a window without committing changes instead of manually clicking the cancel button with their mouse. CancelButton may not work if another control on the form intercepts the ESC key. For example, if you have a ComboBox open on your form, ESC will close the ComboBox instead of closing the Form. The Button control object assigned to CancelButton must be visible on the form, or else pressing the ESC key will have no effect.

children

public var children: Array
List of child controls index by number

classInfo

public static var classInfo: Object
A static class information object

Every class has an associated classInfo object that holds the version and other static information. The classInfo can be accessed either directly by referencing the static class or by calling getClass() on any class instance.

controlBar

public var controlBar
internal reference to the controlbar clip

controls

public var controls: Object
List of child controls index by id

dataSource

public var dataSource
The dataSource this control is bound to.

if not explicitly set will bind to the parents dataSource

enableBGMouseEvents

public var enableBGMouseEvents: Boolean
Controls whether mouse event handlers are set on the background or foreground.

Containers by default set event handlers on their background

initialFocusControl

public var initialFocusControl: Object
The control to be focused when this form is displayed for the first time

isRoot

public var isRoot: Boolean
Is this a root container

lastFocus

public var lastFocus: Object
The last control that had focus

The last control that had focus. This may differ from lastFocus if the user clicks into a focusable control that is not a tabStop

layoutDescriptor

public var layoutDescriptor: XMLNode
The layoutDescriptor associated with this class **/

layoutId

public var layoutId: String
The layoutId associated with this class **/

layoutManager

public var layoutManager: ILayoutManager
The layout manager responsible for laying control in the container

The layout manger lays out the containers content and also calculates its preferred size. By default there is no layout manager and control are placed at there original x,y coordinates.

rootContainer

public var rootContainer: Object
The container at the root of the container heirarchy

styleClass

public var styleClass: String
The name of the style class this instance will use.

symbolId

public var symbolId: String
The symbolId associated with this class **/

tabList

public var tabList: Array
List of tabable controls in tabOrder

tabModeWrap

public var tabModeWrap: Boolean
Controls the mode of tabbing

if true tabbing will wrap around the ends of the tab list


Property Documentation

childCount

public childCount: Number (read-only)
Count of child controls created in this container

footerHeight

public footerHeight: Number (read, write)
footer of the container header section *

headerHeight

public headerHeight: Number (read, write)
height of the container header section *

innerBackground

public innerBackground (read, write)
Color of inner background area

innerBackgroundVisible

public innerBackgroundVisible: Boolean (read, write)
Indicates whether the inner background is visible or not

innerBorderBrush

public innerBorderBrush: Object (read, write)
A Brush object used to paint the controls border.

innerBorderRadius

public innerBorderRadius (read, write)
Sets or get the radius of the inner face

An object with properties topLeft,topRight,bottomRight,bottomLeft corresponding to the topLeft,topRight,bottomRight,bottomLeft radii

innerBorderStyle

public innerBorderStyle (read, write)
inner border style

innerBorderThickness

public innerBorderThickness (read, write)
Sets or get the radius of the inner face

An object with properties topLeft,topRight,bottomRight,bottomLeft corresponding to the topLeft,topRight,bottomRight,bottomLeft radii

numChildren

public numChildren: Number (read-only)
/** Count of child controls created in this container

showStatusBar

public showStatusBar: Boolean (read, write)

showTitleBar

public showTitleBar: Boolean (read, write)

status

public status: String (read, write)
Gets or sets the window status text

title

public title: String (read, write)
Gets or sets the window title text


Constructor Documentation

Container

public function Container()
Constructor - This should not be called directly.


Method Documentation

addChild

public function addChild(compDesc: Object): Object
Adds a child control to a container

Adds a child as defined in the component descriptor parameter to this container.

Parameters:
compDesc
A descriptor object defining the component to be added xp.system.CompDesc
Returns:
The newly added child

addChildren

public function addChildren(compDesc: Array): Void
Adds an array of children to a container

Iterates over the compDesc array and calls addChild

Parameters:
compDesc
An array of component descriptor objects

addControlBar

public function addControlBar(compDesc: Object): Object

clearAll

public function clearAll(): Void
Remove all child components from the container Descripition Removes and destroys all child controls. Also clears the children and tabList arrays.

createChild

public function createChild(className: Object,
 instanceName: String,
 initProps: Object): Object
Adds a child control to a container

Adds a child as defined in the component descriptor parameter to this container.

Parameters:
className
The fully qualified className string or a class reference i.e. "xp.controls.Label" or Label
instanceName
The name or id of the control
initProps
An object with the properties to set on the control when it is instanciated
Returns:
The newly added child

destroyChildAt

public function destroyChildAt(index: Number): Void
Destroys the child at the specified index

Parameters:
index
The index of the child in the children array

getChild

public function getChild(index: Number): Object
Deprecated. 

Returns a reference to the child specified by the index param in the container children array

Parameters:
index
The index of the child in the children array
Returns:
The specified child

getChildAt

public function getChildAt(index: Number): Object
Returns a reference to the child specified by the index param in the container children array

Parameters:
index
The index of the child in the children array
Returns:
The specified child

getChildFromMouse

public function getChildFromMouse(): Number
Figure out which control was clicked from the mouse position

getClass

public function getClass(): Function
Returns a reference to the components static class

Overrides:

getFooterHeight

public function getFooterHeight(): Number

getHeaderHeight

public function getHeaderHeight(): Number

getNextControl

public function getNextControl(index: Number,
 fwd: Boolean,
 wrap: Boolean): Number
Retrieves the next control forward or back in the tab order of child controls.

Search through the target forms tablist to find the next tab target.

Parameters:
index
ctl The Control to start the search with.
fwd
true to search forward in the tab order; false to search backward.
wrap
Returns:
The next Control in the tab order.

getUIBuilder

public function getUIBuilder(): Object
Reference to the UIBuilder object

getViewMetrics

public function getViewMetrics(): Thickness
the margins or offsets for the body view used by the layout system*

initLayoutManager

public function initLayoutManager(): Void
Class of layout manager to create, string or class reference *

onChildFocus

public function onChildFocus(ctl: Object,
 focusCtl: Object): Void
A callback from a child control when it gains focus*

This event bubbles up the logical hierarchy

Overrides:

Parameters:
ctl
The immediate child calling this focus
focusCtl
focusControl The child component gaining focus

processEnterKey

public function processEnterKey()
Process enter key event

Called when the control or its children has focus bubbles up the logical hierarchy

Overrides:

processEscapeKey

public function processEscapeKey()
Process escape key event

Called when the control or its children has focus bubbles up the logical hierarchy

Overrides:

registerChild

public function registerChild(ctl): Void
Register the ctl as a child of this container

Registers the control as a child for layout,focus,tabbing management purposes. This is called automatically for all XPComponents. You should call this manually for all focusable MM Components

Parameters:
ctl
The component to register

selectNextControl

public function selectNextControl(ctl: Object,
 fwd: Boolean,
 tabStopOnly: Boolean,
 wrap: Boolean): Object
Activates the next control.

Activates the next control.

Parameters:
ctl
The Control at which to start the search.
fwd
true to move forward in the tab order; false to move backward in the tab order.
tabStopOnly
true to ignore the controls with the TabStop property set to false; otherwise, false.
wrap
true to continue searching from the first control in the tab order after the last control has been reached; otherwise, false.
Returns:
true if a control was activated; otherwise, false.

setDataContext

public function setDataContext(data: Object,
 context: Object): Void
Updates a containers data context information

setFocus

public function setFocus()
Overrides the ancestor method to find the first focusable control on a form

If the true focus control is an internal object this will set focus to that object. This function will be called by the FocusManger when tabbing.

Overrides:

setMeasuredMinSize

public function setMeasuredMinSize(w: Number,
 h: Number)
Called by the LayoutManger to set the measured size of the container*

setMeasuredSize

public function setMeasuredSize(w: Number,
 h: Number)
Called by the LayoutManger to set the measured size of the container*

unregisterChild

public function unregisterChild(ctl): Void
Unregister the ctl as a child of this container

Unregisters the control as a child for layout,focus,tabbing management purposes. This is called automatically whne the component is destroyed for all XPComponents. You should call this manually for all focusable MM Components

Parameters:
ctl
The component to unregister

The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc