BiComponent

This is the core class for all visual components in Bindows.

This class extends BiEventTarget and therefore all methods and fields available for BiEventTarget are also available for BiComponent .

Constructor

new BiComponent ( [ sName ] )

Parameters

Name Type Optional Default Descripton
sName String checked The argument is optional and can be used to describe the component.

Properties

Name Type get set Descripton
accessKey String checked checked The key, in combination with the Alt key, that will activate the component.
activeComponent BiComponent checked This is the descendant that currently is active/focused.
anonymous Boolean checked An anonymous component is not included in the default object model (children, firstChild, lastChild, nextSibling, previousSibling nor parent).
appearance String checked checked Sets the appearance on the component. This allows a theme to do custom styling of the component.
backColor String checked checked The background color name. The supported color names follows CSS2.1
backgroundImage BiUri checked checked The URI of the image file to use as background image.
border BiBorder checked checked The border property describes how to paint the border on the component
bottom Number checked checked The bottom position relative to the parent inner edge. When using bottom a height should also be set. When using get the return value is always a number representing the pixel value.
canFocus Boolean checked Whether the component can take focus. To be able to be focusable the component must be enabled and have a tabIndex greater than or equal to 0.
canSelect Boolean checked checked Whether textual content is selectable
capture Boolean checked checked This is true when the component is set to capture all mouse events even if the mouse pointer is outside the component.
changeDescription String checked The change description of the component. This is used in accessibility mode to give a description when the component changes in some way. See accessibility documentation for more information.
children BiComponent[] checked checked The components added to the current component. This does not include anonymous children.

When setting this all the old children are first removed and disposed.
clientHeight Number checked The height inside possible borders and scrollbar
clientLeft Number checked The left position of the component relative to the browser window viewport.
clientTop Number checked The top position of the component relative to the browser window viewport.
clientWidth Number checked The width inside possible borders and scrollbar
clipHeight Number checked checked This is the height of the shown region when the component is clipped. A value of null means the entire (remaining) height is shown.
clipLeft Number checked checked This is the clip left value. When this is set the shown region of the component starts this many pixels from the left.
clipTop Number checked checked This is the clip top value. When this is set the shown region of the component starts this many pixels from the top.
clipWidth Number checked checked This is the width of the shown region when the component is clipped. A value of null means the entire (remaining) width is shown.
command BiCommand checked checked Commands are used to make more than one component trigger the same action. Commands also synchronize different properties on the components using the command. BiComponent only synchronizes the enabled property with the command. Sub classes that have a value property usually synchronizes that as well.
containsFocus Boolean checked Whether the component or any of its descendants has focus
contextMenu BiMenu checked checked If set then this is the menu that will be shown when the user right clicks (or uses some other UI mechanism) to bring up a context menu. Set this to null when no contex menu is desired.
created Boolean checked This becomes true when the HTML element representing the component gets created. From a pure UI perspective this can be seen as when there is a visual representation created and available on the screen.
cssClassName String checked checked The CSS class name for the element representing the component. This should be used with caution since in some cases this might give unrespected results.
cursor String checked checked The name of the cursor to show when the mouse pointer is over the component. This is any valid CSS2 cursor name.
description String checked The description of the component. This is used in accessibility mode to give a description of the component changes in some way. See accessibility documentation for more information.
dropDataTypes String[] checked checked The data type that are supported when dropping on the component
enabled Boolean checked checked Whether the component is enabled or not. When this is changed the component fires the enabledchanged event. A disabled component cannot recieve focus.
firstChild BiComponent checked Returns the first child component. If the current component has no children then this returns null. This is the first non anonymous child.
focused Boolean checked checked If the component can be focused then this makes the component focused (if set to true). If the component was focused and this is set to false then the component is blurred. Changing this fires the focus and blur events (depending on the previous state).

A disabled component cannot recieve focus.

To be able to recieve focus the tabIndex must be greater or equal to 0.
focusManager BiFocusManager checked checked The focus manager that handles focus inside the component. This is usually null for BiComponent and the focus is usually handled by some ancestor.
focusRoot BiComponent checked This is the component that is the container for the focus. One cannot use the tab key to focus out of a focus root.
foreColor String checked checked The foreground color name. The supported color names follows CSS2.1
forLabel BiLabel checked If a label sets the labelFor attribute to this component this property will point to that label.
hasFixedHeight Boolean checked This is true if the component has a fixed height. This usually happens if height is set or if both top and bottom are set.
hasFixedWidth Boolean checked This is true if the component has a fixed width. This usually happens if width is set or if both left and right are set.
height Number checked checked The height of the component. When using get the return value is always a number representing the pixel value.
hideFocus Boolean checked checked Whether to hide the dotted outline that the OS usually draws around focused components.
insetBottom Number checked Border bottom width plus scroll bar if any.
insetLeft Number checked Border left width plus scroll bar if any.
insetRight Number checked Border right width plus scroll bar if any.
insetTop Number checked Border top width plus scroll bar if any.
isEnabled Boolean checked This is true when the component is enabled and all its ancestors are also enabled.
isVisible Boolean checked Whether the component is shown on the screen. This can be false if the component is not visible or any of the parents are not visible.
lastChild BiComponent checked Returns the last child component. If the current component has no children then this returns null. This is the last non anonymous child.
left Number checked checked The left position relative to the parent inner edge. When using get the return value is always a number representing the pixel value.
marginBottom Number checked checked The bottom margin for the component. Margins are used by some layout managers
marginLeft Number checked checked The left margin for the component. Margins are used by some layout managers
marginRight Number checked checked The right margin for the component. Margins are used by some layout managers
marginTop Number checked checked The top margin for the component. Margins are used by some layout managers
maximumHeight Number checked checked Returns the desired maximum height of the component. This does not limit the size but is used by some components as a layout hint.
maximumWidth Number checked checked Returns the desired maximum width of the component. This does not limit the size but is used by some components as a layout hint.
minimumHeight Number checked checked Returns the desired minimum height of the component. This does not limit the size but is used by some components as a layout hint.
minimumWidth Number checked checked Returns the desired minimum width of the component. This does not limit the size but is used by some components as a layout hint.
name String checked checked The name does not have any real meaning except that it can be useful to identify the component
nextSibling BiComponent checked Returns the component after the current in the parent children collection. If the current component has no parent or no component comes after the current this returns null. This is the first non anonymous next sibling.
opacity Number checked checked Sets the opacity for the component. Any child component inside the component will also become transparent. The value should be a number between 0 and 1 where 1 means totally opaque and 0 invisible.
overflow String checked checked Describes how to handle content that is too large to fit inside the component.

hidden - The content is clipped
auto - Scroll bars are shown as needed
scroll - Scroll bars are always shown. Even if there is enough room for the content inside the component.
overflowX String checked checked This describes how to handle content that is too large to fit inside the component. This only covers the horizontal overflow.

hidden - The content is clipped
auto - Scroll bars are shown as needed
scroll - Scroll bars are always shown. Even if there is enough room for the content inside the component.
overflowY String checked checked This describes how to handle content that is too large to fit inside the component. This only covers the vertical overflow

hidden - The content is clipped
auto - Scroll bars are shown as needed
scroll - Scroll bars are always shown. Even if there is enough room for the content inside the component.
parent BiComponent checked checked Returns the parent component. This is the component that the current component was added to. If the current component has not been added to any component this returns null. If the real parent component is anonymous then this returns the first non anonymous ancestor.

When setting this the component is added last to the new parent. If you set this to null the component is removed from its current parent
preferredHeight Number checked checked Returns the desired height of the component. This is usually the size of the content plus the borders.
preferredWidth Number checked checked Returns the desired width of the component. This is usually the size of the content plus the borders.
previousSibling BiComponent checked Returns the component before the current in the parent children collection. If the current component has no parent or no component comes before the current this returns null. This is the first non anonymous previous sibling.
right Number checked checked The right position relative to the parent inner edge. When using right a width should also be set. When using get the return value is always a number representing the pixel value.
rightToLeft Boolean checked checked Describes whether the component should be be layed out to support locales using right-to-left fonts. If this is set to null then the rightToLeft property for the parent component is used.
screenLeft Number checked The left position of the component relative to screen
screenTop Number checked The top position of the component relative to screen
scrollHeight Number checked The height of the content of the component.
scrollLeft Number checked checked The position of the content relative to the view port of the component. This is the distance the view port has scrolled horizontally.
scrollTop Number checked checked The position of the content relative to the view port of the component. This is the distance the view port has scrolled vertically.
scrollWidth Number checked The width of the content of the component.
tabChildren BiComponent[] checked This returns an array containing the BiComponent objects that should be accessible by the focus manager when navigating focusable objects using the tab key.
tabIndex Number checked checked Setting this to less than 0 prevents the component from becoming focusable. The tab index is used to tell in what order to focus the components when naviagting between components using the tab key.
toolTip BiToolTip checked checked Sets the tool tip to show when the user hovers the component. Setting this to null prevents a tooltip from beeing shown (unless toolTipText is set.
toolTipText String checked checked Sets the tool tip text to show when the user hovers the component. This allows a simple plain text tool tip to be shown. This property is preferred over the toolTip property when the extra functionality provided by the BiToolTip instance is not needed.
top Number checked checked The top position relative to the parent inner edge. When using get the return value is always a number representing the pixel value.
topLevelComponent BiComponent checked Returns the top level ancestor component. This is usually the application window hosting the application.
width Number checked checked The width of the component. When using get the return value is always a number representing the pixel value.
visible Boolean checked Whether the component is visible or not. Note that all the ancestors must be visible for the component to be actually shown. Use isVisible to check that the component is shown.
zIndex Number checked checked The z index of the component. A higher z index means that the component will cover components with lower z index and therefore appear to be closer to the user.

Methods

Name Description
add Adds a component to the current component. The added component becomes a child of the current component. If the component is child of another component it is first removed from that component. The second, optional, argument can be used to insert the new component before an existing child. This raises exception if oBefore is not a child of this.
contains Returns true if the component contains another component. This means that the current component is an ancestor of the descendant. Note that the current component contains itself so calling component.contains(component) will return true.
getHtmlProperty Returns the HTML property value for the HTML element represented by the component.
getStyleProperty Returns the CSS style property value for the HTML element represented by the component. This should be used with caution since in some cases this might give unrespected results.
hasChildren Returns true if the component has any child components. This does not include anonymous children so if all children are anonymous then this will return false.
initAccessibility This is used in accessibility mode to initialize accessibility for the component. This is called from the constructor and should be overridden by all accessible components to add event handlers. See accessibility documentation for more information.
invalidateChild This method is called when a child component no longer has valid size and/or position. For the known hints see invalidateParentLayout.
invalidateLayout This method is called when a component is changed so that its internal layout is no longer valid. This schedules a call to layoutAllChildren
invalidateParentLayout This is called when the size and/or position of the component is changed and therefore the layout needs to be updated
The hint can be used by layout components to be more efficient and ignore hints that does not affect the layout. Known hints are:
"size"
"preferred"
"minimum"
"maximum"
"margin"
isFocusRoot Whether the component is acting as a focus root or not
layoutAllChildren This does a layout of all the children. This is the method where layout is done and you can override this to do your own layout. If the size of a child is changed the child will in its turn call layoutAllChildren.
layoutAllChildrenX Depreciated. Use layoutAllChildren instead
layoutAllChildrenY Depreciated. Use layoutAllChildren instead
layoutChild This handles the layout of the child. If the child changes its size and it has any children this will also call layoutAllChildren on the child.
layoutChildX Deprecated. Use layoutChild instead.
layoutChildY Depreciated. Use layoutChild instead.
layoutComponent Handles the size and position of the current component. Most components ask their parent to do the actual layout but this can be overridden to allow the component to take care of its own size and position.
pack Changes the size of the component so that the size is set to the preferred width and height.
remove Removes an existing child from the component.
removeAll Removes and disposes all children.
removeHtmlProperty Removes the HTML DOM property value for the HTML element represented by the component. This should be used with caution since in some cases this might give unexpected results.
removeStyleProperty Removes the CSS style property value for the HTML element represented by the component. This should be used with caution since in some cases this might give unexpected results.
scrollIntoView Scrolls the parent component view port so that the current component becomes inside the view port if possible. The argument can be used to tell what edge of the viewport the component should be aligned to.
scrollIntoViewX Scrolls the parent component view port horizontally so that the current component becomes inside the view port if possible. The argument can be used to tell what edge of the viewport the component should be aligned to.
scrollIntoViewY Scrolls the parent component view port vertically so that the current component becomes inside the view port if possible. The argument can be used to tell what edge of the viewport the component should be aligned to.
setBounds Sets the left and top position as well as the width and height for the component.
setClip Sets the clip rectangle for the component. This allows you to show just a part of the component
setHtmlProperty Sets a certain HTML DOM property to the HTML element represented by the component. This should be used with caution since in some cases this might give unexpected results.
setLocation Sets the left and top position for the component.
setMargin Sets the margin on all sides of the component. What side the arguments of this method applies to depends on the number of arguments.

setMargin(nAllSides)
setMargin(nLeftAndRight, nTopAndBottom)
setMargin(nLeft, nRight, nTop, nBottom)
setPreferredSize Sets both the preferred width and preferred height for the component.
setSize Sets both width and height for the component.
setStyleProperty Adds a certain style property to the HTML element represented by the component. This should be used with caution since in some cases this might give unrespected results.

Events

Name Type Bubbles Descripton
blur BiFocusEvent This is fired by a focused compinent when it loses focus.
click BiMouseEvent checked When the user clicks on a component it fires this event. This event bubbles to the ancestors.
contextmenu BiMouseEvent checked This event is fired when the user wants to show the context menu. This is usually done by right clicking on the component but can be done in several different ways depending on the users operating system. This event bubbles to the ancestors.
create BiEvent This event is fired when the component has been created and inserted into the document. When it is fired it is quaranteed that the component has been inserted into a application window and at that time it has a visual representation.
dblclick BiMouseEvent checked When the user double clicks on a component it fires this event. This event bubbles to the ancestors.
dragdrop BiDragEvent checked This is fired when the user drops something on the component. This is only fired by valid drop targets for the drag'n drop session. The relatedTarget points to the source of the drag'n drop session. This event bubbles to the ancestors.
dragend BiDragEvent checked This is fired on the component that the user started the drag on when the drag and drop session ends. If the drag'n drop was successful then the relatedTarget is the component where the drag'n drop started. If the drag'n drop failed the relatedTarget is null. This event bubbles to the ancestors.
dragmove BiDragEvent checked When doing drag'n drop this is fired when the mouse pointer moves over the component. This is similar to mousemove except that it only happens on valid drop targets during a drag'n drop sessions. This event bubbles to the ancestors.
dragout BiDragEvent checked When doing drag'n drop this is fired when the mouse pointer leaves the component. This is similar to mouseout except that it only happens on valid drop targets during a drag'n drop sessions. The relatedTarget points to the component of the drag'n drop session that was entered (if any). This event bubbles to the ancestors.
dragover BiDragEvent checked When doing drag'n drop this is fired when the user drags over the component. This is similar to mouseover except that it only happens on valid drop targets during a drag'n drop sessions. The relatedTarget points to the component of the drag'n drop session that was left (if any). This event bubbles to the ancestors.
dragstart BiDragEvent checked This event is fired when the user starts to drag a component. Call startDrag on the event object to initiate a drag'n drop session. This event bubbles to the ancestors.
enabledchanged BiEvent This is fired when the enabled property is changed.
focus BiFocusEvent This is fired when the component becomes focused.
focusin BiFocusEvent checked This event is fired when the component becomes focused. This event is fired before the focus event and unlike the focus event it bubbles up to the parent component.
focusout BiFocusEvent checked This event is fired when the component loses focus. This event is fired before the blur event and unlike the blur event it bubbles up to the parent component.
keydown BiKeyboardEvent checked This event is fired by the component when it is focused and the user presses down a key on the keyboard. This event then bubbles up to ancestors.
keypress BiKeyboardEvent checked This event is continuously fired by the component when it is focused and the user holds down a key on the keyboard. This event then bubbles up to ancestors.
keyup BiKeyboardEvent checked This event is fired by the component when it is focused and the user releases a key on the keyboard. This event then bubbles up to ancestors.
losecapture BiEvent This event is fired if the component has taken the capture but for some reason lost it.
mousedown BiMouseEvent checked This is fired when the user presses down a mouse button on a component. This event bubbles to the ancestors.
mousemove BiMouseEvent checked This is fired when the user moves the mouse and the pointer is over the current component. This event bubbles to the ancestors.
mouseout BiMouseEvent checked This event is fired when the mouse pointer leaves the component. relatedTarget can be used to find the component that was entered. This event bubbles to the ancestors.
mouseover BiMouseEvent checked This is fired when the mouse pointer enters a component. relatedTarget can be used to find the component that was left. This event bubbles to the ancestors.
mouseup BiMouseEvent checked This is fired when the user releases a mouse button on the component. This event bubbles to the ancestors.
mousewheel BiMouseEvent checked This event is fired when the user scrolls the mouse wheel over the component. This event bubbles to the ancestors.
resize BiEvent This event is fired when a created component changes its size.
scroll BiEvent When the user scrolls the component scroll events are continuously fired.

Static Methods

Name Description
enqueueLayout This adds a component to the layout queue. This will make the layout system update the size and location of the component (if needed) the next time it updates the layout.
findComponentFor Looks at the element and its ancestors to try and find an associated BiComponent.
flushLayoutComponent This updates the layout for the component and all its ancestors (if needed)
flushLayoutQueue This goes through the entire layout queue and calls layoutComponent and layoutAllChildren (if needed) for the enqued components.
invalidateAll This goes through all the exisiting components and invalidates them

Static Fields

None.

Remarks

Method Details

add

Adds a component to the current component. The added component becomes a child of the current component. If the component is child of another component it is first removed from that component. The second, optional, argument can be used to insert the new component before an existing child. This raises exception if oBefore is not a child of this.

Syntax

object.add
 (
 oChild
 [
 ,oBefore,bAnonymous
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
oChild BiComponent The component to add
oBefore BiComponent checked The existing child do add the new component before
bAnonymous Boolean Whether the added component should be anonymous.

Return Type

void

contains

Returns true if the component contains another component. This means that the current component is an ancestor of the descendant. Note that the current component contains itself so calling component.contains(component) will return true.

Syntax

object.contains
 (
 oDescendant
 )
 

Parameters

Name Type Optional Default Descripton
oDescendant BiComponent The component to test whether the current component contains it.

Return Type

Boolean

getHtmlProperty

Returns the HTML property value for the HTML element represented by the component.

Syntax

object.getHtmlProperty
 (
 sProp
 )
 

Parameters

Name Type Optional Default Descripton
sProp String The HTML property name

Return Type

String

getStyleProperty

Returns the CSS style property value for the HTML element represented by the component. This should be used with caution since in some cases this might give unrespected results.

Syntax

object.getStyleProperty
 (
 sProp
 )
 

Parameters

Name Type Optional Default Descripton
sProp String The CSS property name

Return Type

String

hasChildren

Returns true if the component has any child components. This does not include anonymous children so if all children are anonymous then this will return false.

Syntax

object.hasChildren
 (
 
 )
 

Parameters

No arguments.

Return Type

Boolean

initAccessibility

This is used in accessibility mode to initialize accessibility for the component. This is called from the constructor and should be overridden by all accessible components to add event handlers. See accessibility documentation for more information.

Syntax

object.initAccessibility
 (
 
 )
 

Parameters

No arguments.

Return Type

void

invalidateChild

This method is called when a child component no longer has valid size and/or position. For the known hints see invalidateParentLayout.

Syntax

object.invalidateChild
 (
 oChild,sHint
 )
 

Parameters

Name Type Optional Default Descripton
oChild BiComponent The component to invalidate
sHint String A string giving a hint that the layout manager can use

Return Type

void

invalidateLayout

This method is called when a component is changed so that its internal layout is no longer valid. This schedules a call to layoutAllChildren

Syntax

object.invalidateLayout
 (
 
 )
 

Parameters

No arguments.

Return Type

void

invalidateParentLayout

This is called when the size and/or position of the component is changed and therefore the layout needs to be updated
The hint can be used by layout components to be more efficient and ignore hints that does not affect the layout. Known hints are:
"size"
"preferred"
"minimum"
"maximum"
"margin"

Syntax

object.invalidateParentLayout
 (
 sHint
 )
 

Parameters

Name Type Optional Default Descripton
sHint String A hint string that the layout manager can use

Return Type

void

isFocusRoot

Whether the component is acting as a focus root or not

Syntax

object.isFocusRoot
 (
 
 )
 

Parameters

No arguments.

Return Type

Boolean

layoutAllChildren

This does a layout of all the children. This is the method where layout is done and you can override this to do your own layout. If the size of a child is changed the child will in its turn call layoutAllChildren.

Syntax

object.layoutAllChildren
 (
 
 )
 

Parameters

No arguments.

Return Type

void

layoutAllChildrenX

Depreciated. Use layoutAllChildren instead

Syntax

object.layoutAllChildrenX
 (
 
 )
 

Parameters

No arguments.

Return Type

void

layoutAllChildrenY

Depreciated. Use layoutAllChildren instead

Syntax

object.layoutAllChildrenY
 (
 
 )
 

Parameters

No arguments.

Return Type

void

layoutChild

This handles the layout of the child. If the child changes its size and it has any children this will also call layoutAllChildren on the child.

Syntax

object.layoutChild
 (
 oChild
 )
 

Parameters

Name Type Optional Default Descripton
oChild BiComponent The child to layout

Return Type

void

layoutChildX

Deprecated. Use layoutChild instead.

Syntax

object.layoutChildX
 (
 oChild
 )
 

Parameters

Name Type Optional Default Descripton
oChild BiComponent The child to layout

Return Type

void

layoutChildY

Depreciated. Use layoutChild instead.

Syntax

object.layoutChildY
 (
 oChild
 )
 

Parameters

Name Type Optional Default Descripton
oChild BiComponent The child to layout

Return Type

void

layoutComponent

Handles the size and position of the current component. Most components ask their parent to do the actual layout but this can be overridden to allow the component to take care of its own size and position.

Syntax

object.layoutComponent
 (
 
 )
 

Parameters

No arguments.

Return Type

void

pack

Changes the size of the component so that the size is set to the preferred width and height.

Syntax

object.pack
 (
 
 )
 

Parameters

No arguments.

Return Type

void

remove

Removes an existing child from the component.

Syntax

object.remove
 (
 oChild
 )
 

Parameters

Name Type Optional Default Descripton
oChild BiComponent The component to remove

Return Type

BiComponent

removeAll

Removes and disposes all children.

Syntax

object.removeAll
 (
 
 )
 

Parameters

No arguments.

Return Type

void

removeHtmlProperty

Removes the HTML DOM property value for the HTML element represented by the component. This should be used with caution since in some cases this might give unexpected results.

Syntax

object.removeHtmlProperty
 (
 sProp
 )
 

Parameters

Name Type Optional Default Descripton
sProp String The HTML DOM property name

Return Type

void

removeStyleProperty

Removes the CSS style property value for the HTML element represented by the component. This should be used with caution since in some cases this might give unexpected results.

Syntax

object.removeStyleProperty
 (
 sProp
 )
 

Parameters

Name Type Optional Default Descripton
sProp String The CSS property name

Return Type

void

scrollIntoView

Scrolls the parent component view port so that the current component becomes inside the view port if possible. The argument can be used to tell what edge of the viewport the component should be aligned to.

Syntax

object.scrollIntoView
 (
 
 [
 bTopLeft
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
bTopLeft Boolean checked This describes the value to align the component to relative to the view port of the parent.

null - Scroll as little as possible to make the component visible in the parent view port.
true - try to align the component with the upper left edge of the parent view port.
false - try to align the component with the lower right edge of the parent view port.

Return Type

void

scrollIntoViewX

Scrolls the parent component view port horizontally so that the current component becomes inside the view port if possible. The argument can be used to tell what edge of the viewport the component should be aligned to.

Syntax

object.scrollIntoViewX
 (
 
 [
 bLeft
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
bLeft Boolean checked This describes the value to align the component to relative to the view port of the parent.

null - Scroll as little as possible to make the component visible in the parent view port.
true - try to align the component with the left edge of the parent view port.
false - try to align the component with the right edge of the parent view port.

Return Type

void

scrollIntoViewY

Scrolls the parent component view port vertically so that the current component becomes inside the view port if possible. The argument can be used to tell what edge of the viewport the component should be aligned to.

Syntax

object.scrollIntoViewY
 (
 
 [
 bTop
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
bTop Boolean checked This describes the value to align the component to relative to the view port of the parent.

null - Scroll as little as possible to make the component visible in the parent view port.
true - try to align the component with the upper edge of the parent view port.
false - try to align the component with the lower edge of the parent view port.

Return Type

void

setBounds

Sets the left and top position as well as the width and height for the component.

Syntax

object.setBounds
 (
 nLeft,nTop,nWidth,nHeight
 )
 

Parameters

Name Type Optional Default Descripton
nLeft Number The new left location for the component
nTop Number The new top locatin for the component
nWidth Number The new width of the component
nHeight Number The new height of the component

Return Type

void

setClip

Sets the clip rectangle for the component. This allows you to show just a part of the component

Syntax

object.setClip
 (
 nLeft,nTop,nWidth,nHeight
 )
 

Parameters

Name Type Optional Default Descripton
nLeft Number The left clip value
nTop Number The top clip value
nWidth Number The width of the shown region
nHeight Number The height of the shown region

Return Type

void

setHtmlProperty

Sets a certain HTML DOM property to the HTML element represented by the component. This should be used with caution since in some cases this might give unexpected results.

Syntax

object.setHtmlProperty
 (
 sProp,oValue
 )
 

Parameters

Name Type Optional Default Descripton
sProp String The HTML DOM property name
oValue Object The HTML DOM property value

Return Type

void

setLocation

Sets the left and top position for the component.

Syntax

object.setLocation
 (
 nLeft,nTop
 )
 

Parameters

Name Type Optional Default Descripton
nLeft Number The new left location for the component
nTop Number The new top locatin for the component

Return Type

void

setMargin

Sets the margin on all sides of the component. What side the arguments of this method applies to depends on the number of arguments.

setMargin(nAllSides)
setMargin(nLeftAndRight, nTopAndBottom)
setMargin(nLeft, nRight, nTop, nBottom)

Syntax

object.setMargin
 (
 nLeft
 [
 ,nRight
 [
 ,nTop
 [
 ,nBottom
 ]
 
 ]
 
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
nLeft Number The left margin
nRight Number checked The right margin
nTop Number checked The top margin
nBottom Number checked The bottom margin

Return Type

void

setPreferredSize

Sets both the preferred width and preferred height for the component.

Syntax

object.setPreferredSize
 (
 nWidth,nHeight
 )
 

Parameters

Name Type Optional Default Descripton
nWidth Number The new preferred width of the component
nHeight Number The new preferred height of the component

Return Type

void

setSize

Sets both width and height for the component.

Syntax

object.setSize
 (
 nWidth,nHeight
 )
 

Parameters

Name Type Optional Default Descripton
nWidth Number The new width of the component
nHeight Number The new height of the component

Return Type

void

setStyleProperty

Adds a certain style property to the HTML element represented by the component. This should be used with caution since in some cases this might give unrespected results.

Syntax

object.setStyleProperty
 (
 sProp,sValue
 )
 

Parameters

Name Type Optional Default Descripton
sProp String The CSS property name
sValue String The CSS value

Return Type

void

Static Method Details

enqueueLayout

This adds a component to the layout queue. This will make the layout system update the size and location of the component (if needed) the next time it updates the layout.

Syntax

BiComponent
 .
 enqueueLayout
 (
 c
 )
 

Parameters

Name Type Optional Default Descripton
c BiComponent The component to enqueue

Return Type

void

findComponentFor

Looks at the element and its ancestors to try and find an associated BiComponent.

Syntax

BiComponent
 .
 findComponentFor
 (
 oElement
 )
 

Parameters

Name Type Optional Default Descripton
oElement HTML-Element an element which may be part of a Bindows component.

Return Type

BiComponent

flushLayoutComponent

This updates the layout for the component and all its ancestors (if needed)

Syntax

BiComponent
 .
 flushLayoutComponent
 (
 c
 )
 

Parameters

Name Type Optional Default Descripton
c BiComponent The component to update the layout for

Return Type

void

flushLayoutQueue

This goes through the entire layout queue and calls layoutComponent and layoutAllChildren (if needed) for the enqued components.

Syntax

BiComponent
 .
 flushLayoutQueue
 (
 
 )
 

Parameters

No arguments.

Return Type

void

invalidateAll

This goes through all the exisiting components and invalidates them

Syntax

BiComponent
 .
 invalidateAll
 (
 
 )
 

Parameters

No arguments.

Return Type

void