Class bbq.gui.button.GUIButton

Extends bbq.gui.GUIWidget.
Defined in: GUIButton.js.

This class creates a link which can be used to receive onclick events.

var button = new bbq.gui.button.GUIButton({
    text: "Click me",
    onClick: function() {
        Log.info("The button was clicked!");
    }
});

Class Summary
Constructor Attributes Constructor Name and Description
 
This class creates a link which can be used to receive onclick events.
Fields borrowed from class bbq.lang.Delegator:
options
Method Summary
Method Attributes Method Name and Description
 
Button clicked handler function
 
Clears button down state.
 
 
Checks if button is down.
 
mouseDown(event)
Mouse down handler function
 
mouseOut(event)
Mouse out handler function
 
mouseOver(event)
Mouse over handler function
 
mouseUp(event)
Mouse up handler function
 
setDisabled(disabled)
Button disabled status setter.
 
setDown(down)
Down state setter
 
setText(text)
Sets the text displayed on the button.
Methods borrowed from class bbq.gui.GUIWidget:
addClass, appendBefore, appendChild, appendTo, blur, empty, focus, getAttribute, getID, getStyle, hide, insertAtTop, insertBefore, isClass, registerObject, removeChild, removeClass, render, replaceChild, resize, setAttribute, setID, setRootNode, setStyle, show
Methods borrowed from class bbq.lang.Delegator:
delegateMethod
Methods borrowed from class bbq.lang.Watchable:
deRegisterListener, notifyListener, notifyListeners, registerListener, registerOneTimeListener

Constructor Detail

bbq.gui.button.GUIButton(options)

Parameters:
Name Type Comment
options {Object}
options.text {String} This text will be displayed on the button.
options.toolTip
Optional
{String} Will be displayed as a tooltip when the user hovers their mouse over the button.
options.anchor
Optional
{String} The anchor will be set as the href value of the root node.
options.startDisabled
Optional
{boolean} If true the button will not respond to clicks.
options.startDown
Optional
{boolean} If true the button will start in the down state.
options.rememberDownState
Optional
{boolean} If true the button will toggle on and off.
options.onClick
Optional
{Function} Will be invoked when onclick events occur.
options.onMouseOut
Optional
{Function} Will be invoked when onmouseout events occur.
options.onMouseOver
Optional
{Function} Will be invoked when onmouseover events occur.
options.onMouseDown
Optional
{Function} Will be invoked when onmousedown events occur.
options.onMouseUp
Optional
{Function} Will be invoked when onmouseup events occur.
options.onButtonDown
Optional
{Function} Will be invoked when the button enters the down state.
options.onButtonUp
Optional
{Function} Will be invoked when the button enters the up state.

Method Detail

buttonClicked(event)

Button clicked handler function
Parameters:
Name Type Comment
event {Event}

clearDown()

Clears button down state.

{boolean} isDisabled()

Returns:
{boolean} True if the button is in the disabled state.

{boolean} isDown()

Checks if button is down.
Returns:
{boolean}

mouseDown(event)

Mouse down handler function
Parameters:
Name Type Comment
event {Event}

mouseOut(event)

Mouse out handler function
Parameters:
Name Type Comment
event {Event}

mouseOver(event)

Mouse over handler function
Parameters:
Name Type Comment
event {Event}

mouseUp(event)

Mouse up handler function
Parameters:
Name Type Comment
event {Event}

setDisabled(disabled)

Button disabled status setter.
Parameters:
Name Type Comment
disabled {boolean}

setDown(down)

Down state setter
Parameters:
Name Type Comment
down {boolean}

setText(text)

Sets the text displayed on the button.
Parameters:
Name Type Comment
text {String}