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
| Name | Type | Optional | Default | Descripton |
sText | String | ![]() | "" | The text to show on the button |
Properties
| Name | Type | get | set | Descripton |
align | String | ![]() | ![]() | The text alignment. Valid values are:left right center justify |
font | | ![]() | ![]() | This is used to describe how to paint the text on the button label. |
html | String | ![]() | ![]() | The HTML text shown on the button label |
icon | | ![]() | ![]() | The 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. |
iconPosition | String | ![]() | ![]() | The position of the icon relative to the text. Valid values are:left right top bottom |
iconTextGap | Number | ![]() | ![]() | The gap between the icon and the text (in pixels) |
mnemonic | String | ![]() | ![]() | A character used to give UI hints about the access key for the button |
paddingBottom | Number | ![]() | ![]() | The bottom padding (in pixels) |
paddingLeft | Number | ![]() | ![]() | The left padding (in pixels) |
paddingRight | Number | ![]() | ![]() | The right padding (in pixels) |
paddingTop | Number | ![]() | ![]() | The top padding (in pixels) |
wrap | Boolean | ![]() | ![]() | Whether to wrap the text if the button is not wide enough |
Methods
| Name | Description |
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. |
Events
| Name | Type | Bubbles | Descripton |
action | | Fires 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
| Name | Type | Optional | Default | Descripton |
nLeft | Number | Left padding | ||
nRight | Number | ![]() | Right padding | |
nTop | Number | ![]() | Top padding | |
nBottom | Number | ![]() | Bottom padding |
Return Type
void
