BiButton

A button that can contain both text and an icon

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

Constructor

new BiButton ( [ sText ] )

Parameters

NameTypeOptionalDefaultDescripton
sTextStringchecked"" The text to show on the button

Properties

NameTypegetsetDescripton
alignStringcheckedcheckedThe text alignment. Valid values are:

left
right
center
justify
fontBiFontcheckedcheckedThis is used to describe how to paint the text on the button label.
htmlStringcheckedcheckedThe HTML text shown on the button label
iconBiImagecheckedcheckedThe icon image to show on the button label. Note that changing the image object does not update the icon. You'll have to set the icon property to update the icon.
iconPositionStringcheckedcheckedThe position of the icon relative to the text. Valid values are:

left
right
top
bottom
iconTextGapNumbercheckedcheckedThe gap between the icon and the text (in pixels)
mnemonicStringcheckedcheckedA character used to give UI hints about the access key for the button
paddingBottomNumbercheckedcheckedThe bottom padding (in pixels)
paddingLeftNumbercheckedcheckedThe left padding (in pixels)
paddingRightNumbercheckedcheckedThe right padding (in pixels)
paddingTopNumbercheckedcheckedThe top padding (in pixels)
wrapBooleancheckedcheckedWhether to wrap the text if the button is not wide enough

Methods

NameDescription
setPaddingSets the padding on more than one side. This method can be 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

NameTypeBubblesDescripton
actionBiEventFires when the user presses the button (either using the mouse or the keyboard)

Static Methods

None.

Static Fields

None.

Remarks

None.

Method Details

setPadding

Sets the padding on more than one side. This method can be 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

NameTypeOptionalDefaultDescripton
nLeftNumberLeft padding
nRightNumbercheckedRight padding
nTopNumbercheckedTop padding
nBottomNumbercheckedBottom padding

Return Type

void