BiLabel

This class is used to show text

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

Constructor

new BiLabel ( [ sText ] )

Parameters

Name Type Optional Default Descripton
sText String checked "" The text to show on the label

Properties

Name Type get set Descripton
align String checked checked The text alignment. Valid values are:

left
right
center
justify
font BiFont checked checked This is used to describe how to paint the text on the label.
html String checked checked The HTML text shown on the label
icon BiImage checked checked The icon image to show on the label. Note that changing the image object does not update the label icon. You'll have to set the icon property to update the label icon.
iconPosition String checked checked The position of the icon relative to the text. Valid values are:

left
right
top
bottom
iconTextGap Number checked checked The gap between the icon and the text (in pixels)
labelFor BiComponent checked checked If this is set then focusing on the current label moves the focus to another component
mnemonic String checked checked A character used to give UI hints about the access key for the label
paddingBottom Number checked checked The bottom padding (in pixels)
paddingLeft Number checked checked The left padding (in pixels)
paddingRight Number checked checked The right padding (in pixels)
paddingTop Number checked checked The top padding (in pixels)
text String checked checked The plain text shown on the label
verticalAlign String checked checked NOT IMPLEMENTED

The vertical text alignment. Valid values are:

top
middle
bottom
wrap Boolean checked checked Whether to wrap the text if the label is not wide enough

Methods

Name Description
setPadding Sets the padding on more than one side. This method can ba called with 1, 2 or 4 arguments. In case of 1 argument it sets the padding on all sides. If 2 arguments are used then the padding on the left/right and top/bottom are set to the same. And if called with 4 all 4 sides can have different padding,

setPadding(nPadding) - Sets the padding on all sides to nPadding
setPadding(nLeftRight, nTopBottom) - Sets the padding on the left and right to nLeftRight and the padding on the top and bottom to nTopBottom
setPadding(nLeft, nRight, nTop, nBottom) - Sets the padding on all sides to nLeft, nRight, nTop and nBottom respectively.

Events

None.

Static Methods

Name Description
addMnemonic Changes an HTML string to designate a character as a mnemonic
htmlToText Strips HTML markup from an HTML string and returns a plain text string
textToHtml Converts a plain text string to HTML. This includes adding line breaks and entities.

Static Fields

None.

Remarks

To change the font of the component you have to use setFont(). Changing the font object without calling setFont() will not update the component. To change the icon of the component you have to use setIcon(). Changing the image object without calling setIcon() will not update the component.

Method Details

setPadding

Sets the padding on more than one side. This method can ba called with 1, 2 or 4 arguments. In case of 1 argument it sets the padding on all sides. If 2 arguments are used then the padding on the left/right and top/bottom are set to the same. And if called with 4 all 4 sides can have different padding,

setPadding(nPadding) - Sets the padding on all sides to nPadding
setPadding(nLeftRight, nTopBottom) - Sets the padding on the left and right to nLeftRight and the padding on the top and bottom to nTopBottom
setPadding(nLeft, nRight, nTop, nBottom) - Sets the padding on all sides to nLeft, nRight, nTop and nBottom respectively.

Syntax

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

Parameters

Name Type Optional Default Descripton
nLeft Number Left padding
nRight Number checked Right padding
nTop Number checked Top padding
nBottom Number checked Bottom padding

Return Type

void

Static Method Details

addMnemonic

Changes an HTML string to designate a character as a mnemonic

Syntax

BiLabel
 .
 addMnemonic
 (
 sHtml,sMnemonic
 )
 

Parameters

Name Type Optional Default Descripton
sHtml String The HTML text to add the mnemonic to
sMnemonic String The mnemonic character

Return Type

String

htmlToText

Strips HTML markup from an HTML string and returns a plain text string

Syntax

BiLabel
 .
 htmlToText
 (
 sHtml
 )
 

Parameters

Name Type Optional Default Descripton
sHtml String The HTML string to convert

Return Type

String

textToHtml

Converts a plain text string to HTML. This includes adding line breaks and entities.

Syntax

BiLabel
 .
 textToHtml
 (
 sText
 )
 

Parameters

Name Type Optional Default Descripton
sText String The plain text string to convert

Return Type

String