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

NameTypeOptionalDefaultDescripton
sNameStringThe argument is optional and can be used to describe the component.

Properties

NameTypegetsetDescripton
acceptsEnterBooleancheckedWhether the component handles (accepts) the ENTER key. If the active window has an accept-button it will be activated by enter unless the focused component handles it.
acceptsEscBooleancheckedWhether the component handles (accepts) the ESCAPE key. If the active window has a cancel-button it will be activated by escape unless the focused component handles it.
accessibilityLinkBooleancheckedcheckedActivates a BiAccessibilityLink object which is a hidden html link that triggers the BiCommand set for this component. The command can then be triggered via the link by e.g. Jaws. A command must be set for this to work.
accessKeyStringcheckedcheckedThe key, in combination with the Alt key, that will activate the component.
activeComponentBiComponentcheckedThis is the descendant that currently is active/focused.
anonymousBooleancheckedAn anonymous component is not included in the default object model (children, firstChild, lastChild, nextSibling, previousSibling nor parent).
appearanceStringcheckedcheckedSets the appearance on the component. This allows a theme to do custom styling of the component.
backColorStringcheckedcheckedThe background color name. The supported color names follows CSS2.1
backgroundFillerBiAbstractFillercheckedSets a background filler for this component. Note any previous filler will be deleted. A filler is used to paint a background for the component, usually this is set by a theme.
backgroundImageBiUricheckedcheckedThe URI of the image file to use as background image.
borderBiBordercheckedcheckedThe border property describes how to paint the border on the component
bottomNumbercheckedcheckedThe 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.
canFocusBooleancheckedWhether 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.
canSelectBooleancheckedcheckedWhether textual content is selectable
captureBooleancheckedcheckedThis is true when the component is set to capture all mouse events even if the mouse pointer is outside the component.
changeDescriptionStringcheckedThe 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.
childrenBiComponent[]checkedcheckedThe components added to the current component. This does not include anonymous children.

When setting this all the old children are first removed and disposed.
clientHeightNumbercheckedThe height inside possible borders and scrollbar
clientLeftNumbercheckedThe left position of the component relative to the browser window viewport.
clientTopNumbercheckedThe top position of the component relative to the browser window viewport.
clientWidthNumbercheckedThe width inside possible borders and scrollbar
clipHeightNumbercheckedcheckedThis is the height of the shown region when the component is clipped. A value of null means the entire (remaining) height is shown.
clipLeftNumbercheckedcheckedThis is the clip left value. When this is set the shown region of the component starts this many pixels from the left.
clipTopNumbercheckedcheckedThis is the clip top value. When this is set the shown region of the component starts this many pixels from the top.
clipWidthNumbercheckedcheckedThis is the width of the shown region when the component is clipped. A value of null means the entire (remaining) width is shown.
commandBiCommandcheckedcheckedCommands 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.
containsFocusBooleancheckedWhether the component or any of its descendants has focus
contentBoxObjectcheckedReturns the content box (x, y, width and height) of the component in viewport coordinates.
contextMenuBiMenucheckedcheckedIf 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.
createdBooleancheckedThis 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.
cssClassNameStringcheckedcheckedThe CSS class name for the element representing the component. This should be used with caution since in some cases this might give unexpected results.
cursorStringcheckedcheckedThe name of the cursor to show when the mouse pointer is over the component. This is any valid CSS2 cursor name.
descriptionStringcheckedThe 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.
dropDataTypesString[]checkedcheckedThe data type that are supported when dropping on the component
enabledBooleancheckedcheckedWhether the component is enabled or not. When this is changed the component fires the enabledchanged event. A disabled component cannot recieve focus.
firstChildBiComponentcheckedReturns the first child component. If the current component has no children then this returns null. This is the first non anonymous child.
firstFocusableBiComponentcheckedThis component if focusable or first (depth first) focusable descendant.
focusedBooleancheckedcheckedIf 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.
focusRootBiComponentcheckedThis is the component that is the container for the focus. One cannot use the tab key to focus out of a focus root.
foreColorStringcheckedcheckedThe foreground color name. The supported color names follows CSS2.1
forLabelBiLabelcheckedIf a label sets the labelFor attribute to this component this property will point to that label.
hasFixedHeightBooleancheckedThis is true if the component has a fixed height. This usually happens if height is set or if both top and bottom are set.
hasFixedWidthBooleancheckedThis is true if the component has a fixed width. This usually happens if width is set or if both left and right are set.
heightNumbercheckedcheckedThe height of the component. When using get the return value is always a number representing the pixel value.
hideFocusBooleancheckedcheckedWhether to hide the dotted outline that the OS usually draws around focused components.
insetBottomNumbercheckedBorder bottom width plus scroll bar if any.
insetLeftNumbercheckedBorder left width plus scroll bar if any.
insetRightNumbercheckedBorder right width plus scroll bar if any.
insetTopNumbercheckedBorder top width plus scroll bar if any.
isEnabledBooleancheckedThis is true when the component is enabled and all its ancestors are also enabled.
isVisibleBooleancheckedWhether 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.
lastChildBiComponentcheckedReturns the last child component. If the current component has no children then this returns null. This is the last non anonymous child.
leftNumbercheckedcheckedThe left position relative to the parent inner edge. When using get the return value is always a number representing the pixel value.
marginBottomNumbercheckedcheckedThe bottom margin for the component. Margins are used by some layout managers
marginLeftNumbercheckedcheckedThe left margin for the component. Margins are used by some layout managers
marginRightNumbercheckedcheckedThe right margin for the component. Margins are used by some layout managers
marginTopNumbercheckedcheckedThe top margin for the component. Margins are used by some layout managers
maximumHeightNumbercheckedcheckedReturns the desired maximum height of the component. This does not limit the size but is used by some components as a layout hint.
maximumWidthNumbercheckedcheckedReturns the desired maximum width of the component. This does not limit the size but is used by some components as a layout hint.
minimumHeightNumbercheckedcheckedReturns the desired minimum height of the component. This does not limit the size but is used by some components as a layout hint.
minimumWidthNumbercheckedcheckedReturns the desired minimum width of the component. This does not limit the size but is used by some components as a layout hint.
nameStringcheckedcheckedA name for the object. Names are accessible within the name scope of the object. Be careful when changing the name because it might have undesired side effects.
nextSiblingBiComponentcheckedReturns 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.
opacityNumbercheckedcheckedSets 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.
overflowStringcheckedcheckedDescribes 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.
overflowXStringcheckedcheckedThis 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.
overflowYStringcheckedcheckedThis 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.
parentBiComponentcheckedcheckedReturns 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
preferredHeightNumbercheckedcheckedReturns the desired height of the component. This is usually the size of the content plus the borders.
preferredWidthNumbercheckedcheckedReturns the desired width of the component. This is usually the size of the content plus the borders.
previousSiblingBiComponentcheckedReturns 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.
rightNumbercheckedcheckedThe 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.
rightToLeftBooleancheckedcheckedDescribes 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.
screenLeftNumbercheckedThe left position of the component relative to screen
screenTopNumbercheckedThe top position of the component relative to screen
scrollHeightNumbercheckedThe height of the content of the component.
scrollLeftNumbercheckedcheckedThe position of the content relative to the view port of the component. This is the distance the view port has scrolled horizontally.
scrollTopNumbercheckedcheckedThe position of the content relative to the view port of the component. This is the distance the view port has scrolled vertically.
scrollWidthNumbercheckedThe width of the content of the component.
tabChildrenBiComponent[]checkedThis returns an array containing the BiComponent objects that should be accessible by the focus manager when navigating focusable objects using the tab key.
tabIndexNumbercheckedcheckedSetting 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.
toolTipBiToolTipcheckedcheckedSets 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.
toolTipTextStringcheckedcheckedSets 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.
topNumbercheckedcheckedThe top position relative to the parent inner edge. When using get the return value is always a number representing the pixel value.
topLevelComponentBiComponentcheckedReturns the top level ancestor component. This is usually the application window hosting the application.
widthNumbercheckedcheckedThe width of the component. When using get the return value is always a number representing the pixel value.
visibleBooleancheckedWhether 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.
zIndexNumbercheckedcheckedThe 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

NameDescription
addAdds 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.
containsReturns 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.
getHtmlPropertyReturns the HTML property value for the HTML element represented by the component.
getStylePropertyReturns 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.
hasChildrenReturns 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.
initAccessibilityThis 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.
invalidateChildThis method is called when a child component no longer has valid size and/or position. For the known hints see invalidateParentLayout.
invalidateLayoutThis method is called when a component is changed so that its internal layout is no longer valid. This schedules a call to layoutAllChildren
invalidateParentLayoutThis 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"
isFocusRootWhether the component is acting as a focus root or not
layoutAllChildrenThis 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.
layoutAllChildrenXDepreciated. Use layoutAllChildren instead
layoutAllChildrenYDepreciated. Use layoutAllChildren instead
layoutChildThis 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.
layoutChildXDeprecated. Use layoutChild instead.
layoutChildYDepreciated. Use layoutChild instead.
layoutComponentHandles 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.
makeThemeAwareMakes the component aware of theme changes. Also applies the current theme to the component. Whenever the theme changes the onThemeChanged event listener will be called.
onThemeChangedListener method for themechanged event.
packChanges the size of the component so that the size is set to the preferred width and height.
removeRemoves an existing child from the component.
removeAllRemoves and disposes all children.
removeHtmlPropertyRemoves 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.
removeStylePropertyRemoves 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.
scrollIntoViewScrolls 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.
scrollIntoViewXScrolls 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.
scrollIntoViewYScrolls 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.
setBoundsSets the left and top position as well as the width and height for the component.
setClipSets the clip rectangle for the component. This allows you to show just a part of the component
setHtmlPropertySets 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.
setLocationSets the left and top position for the component.
setMarginSets 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)
setPreferredSizeSets both the preferred width and preferred height for the component.
setSizeSets both width and height for the component.
setStylePropertyAdds 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

NameTypeBubblesDescripton
blurBiFocusEventThis is fired by a focused component when it loses focus.
clickBiMouseEventWhen the user clicks on a component it fires this event. This event bubbles to the ancestors.
contextmenuBiMouseEventThis 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.
createBiEventThis 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.
dblclickBiMouseEventWhen the user double clicks on a component it fires this event. This event bubbles to the ancestors.
dragdropBiDragEventThis 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.
dragendBiDragEventThis 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.
dragmoveBiDragEventWhen 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.
dragoutBiDragEventWhen 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.
dragoverBiDragEventWhen 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.
dragstartBiDragEventThis 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.
enabledchangedBiEventThis is fired when the enabled property is changed.
focusBiFocusEventThis is fired when the component becomes focused.
focusinBiFocusEventThis 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.
focusoutBiFocusEventThis 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.
keydownBiKeyboardEventThis 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.
keypressBiKeyboardEventThis 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.
keyupBiKeyboardEventThis 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.
losecaptureBiEventThis event is fired if the component has taken the capture but for some reason lost it.
mousedownBiMouseEventThis is fired when the user presses down a mouse button on a component. This event bubbles to the ancestors.
mousemoveBiMouseEventThis is fired when the user moves the mouse and the pointer is over the current component. This event bubbles to the ancestors.
mouseoutBiMouseEventThis 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.
mouseoverBiMouseEventThis 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.
mouseupBiMouseEventThis is fired when the user releases a mouse button on the component. This event bubbles to the ancestors.
mousewheelBiMouseEventThis event is fired when the user scrolls the mouse wheel over the component. This event bubbles to the ancestors.
resizeBiEventThis event is fired when a created component changes its size.
scrollBiEventWhen the user scrolls the component scroll events are continuously fired.

Static Methods

NameDescription
enqueueLayoutThis 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.
findComponentForLooks at the element and its ancestors to try and find an associated BiComponent.
flushLayoutComponentThis updates the layout for the component and all its ancestors (if needed)
flushLayoutQueueThis goes through the entire layout queue and calls layoutComponent and layoutAllChildren (if needed) for the enqued components.
invalidateAllThis goes through all the exisiting components and invalidates them

Static Fields

None.

Remarks

None.

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

NameTypeOptionalDefaultDescripton
oChildBiComponentThe component to add
oBeforeBiComponentcheckedThe existing child do add the new component before
bAnonymousBooleanWhether 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

NameTypeOptionalDefaultDescripton
oDescendantBiComponentThe 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

NameTypeOptionalDefaultDescripton
sPropStringThe 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

NameTypeOptionalDefaultDescripton
sPropStringThe 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

NameTypeOptionalDefaultDescripton
oChildBiComponentThe component to invalidate
sHintStringA 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

NameTypeOptionalDefaultDescripton
sHintStringA 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

NameTypeOptionalDefaultDescripton
oChildBiComponentThe child to layout

Return Type

void

layoutChildX

Deprecated. Use layoutChild instead.

Syntax

object.layoutChildX ( oChild )

Parameters

NameTypeOptionalDefaultDescripton
oChildBiComponentThe child to layout

Return Type

void

layoutChildY

Depreciated. Use layoutChild instead.

Syntax

object.layoutChildY ( oChild )

Parameters

NameTypeOptionalDefaultDescripton
oChildBiComponentThe 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

makeThemeAware

Makes the component aware of theme changes. Also applies the current theme to the component. Whenever the theme changes the onThemeChanged event listener will be called.

Syntax

object.makeThemeAware ( )

Parameters

No arguments.

Return Type

void

onThemeChanged

Listener method for themechanged event.

Syntax

object.onThemeChanged ( e )

Parameters

NameTypeOptionalDefaultDescripton
eBiEventEvent

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

NameTypeOptionalDefaultDescripton
oChildBiComponentThe 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

NameTypeOptionalDefaultDescripton
sPropStringThe 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

NameTypeOptionalDefaultDescripton
sPropStringThe 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

NameTypeOptionalDefaultDescripton
bTopLeftBooleancheckedThis 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 (upper right in RTL mode) of the parent view port.
false - try to align the component with the lower right edge (lower left in RTL mode) 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

NameTypeOptionalDefaultDescripton
bLeftBooleancheckedThis 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 (right in RTL mode) of the parent view port.
false - try to align the component with the right edge (left in RTL mode) 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

NameTypeOptionalDefaultDescripton
bTopBooleancheckedThis 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

NameTypeOptionalDefaultDescripton
nLeftNumberThe new left location for the component
nTopNumberThe new top locatin for the component
nWidthNumberThe new width of the component
nHeightNumberThe 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

NameTypeOptionalDefaultDescripton
nLeftNumberThe left clip value
nTopNumberThe top clip value
nWidthNumberThe width of the shown region
nHeightNumberThe 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

NameTypeOptionalDefaultDescripton
sPropStringThe HTML DOM property name
oValueObjectThe HTML DOM property value

Return Type

void

setLocation

Sets the left and top position for the component.

Syntax

object.setLocation ( nLeft,nTop )

Parameters

NameTypeOptionalDefaultDescripton
nLeftNumberThe new left location for the component
nTopNumberThe 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

NameTypeOptionalDefaultDescripton
nLeftNumberThe left margin
nRightNumbercheckedThe right margin
nTopNumbercheckedThe top margin
nBottomNumbercheckedThe bottom margin

Return Type

void

setPreferredSize

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

Syntax

object.setPreferredSize ( nWidth,nHeight )

Parameters

NameTypeOptionalDefaultDescripton
nWidthNumberThe new preferred width of the component
nHeightNumberThe new preferred height of the component

Return Type

void

setSize

Sets both width and height for the component.

Syntax

object.setSize ( nWidth,nHeight )

Parameters

NameTypeOptionalDefaultDescripton
nWidthNumberThe new width of the component
nHeightNumberThe 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

NameTypeOptionalDefaultDescripton
sPropStringThe CSS property name
sValueStringThe 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

NameTypeOptionalDefaultDescripton
cBiComponentThe 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

NameTypeOptionalDefaultDescripton
oElementHTMLElementan 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

NameTypeOptionalDefaultDescripton
cBiComponentThe 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