Class zwt.ui.Button
Extends
zwt.ui.Widget.
A basic button widget.
CSS rules
.zwt_button {}
.zwt_button .zwt_button-element {}
.zwt_button.zwt_button-disabled .zwt_button-element {}
.zwt_button .zwt_button-bg {}
.zwt_button .zwt_button-bg .zwt_button-left {}
.zwt_button .zwt_button-bg .zwt_button-left .zwt_button-topLeft {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-left .zwt_button-topLeft {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-left .zwt_button-topLeft {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-left .zwt_button-topLeft {}
.zwt_button .zwt_button-bg .zwt_button-left .zwt_button-middleLeft {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-left .zwt_button-middleLeft {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-left .zwt_button-middleLeft {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-left .zwt_button-middleLeft {}
.zwt_button .zwt_button-bg .zwt_button-left .zwt_button-bottomLeft {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-left .zwt_button-bottomLeft {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-left .zwt_button-bottomLeft {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-left .zwt_button-bottomLeft {}
.zwt_button .zwt_button-bg .zwt_button-center {}
.zwt_button .zwt_button-bg .zwt_button-center .zwt_button-topCenter {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-center .zwt_button-topCenter {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-center .zwt_button-topCenter {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-center .zwt_button-topCenter {}
.zwt_button .zwt_button-bg .zwt_button-center .zwt_button-middleCenter {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-center .zwt_button-middleCenter {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-center .zwt_button-middleCenter {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-center .zwt_button-middleCenter {}
.zwt_button .zwt_button-bg .zwt_button-center .zwt_button-bottomCenter {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-center .zwt_button-bottomCenter {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-center .zwt_button-bottomCenter {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-center .zwt_button-bottomCenter {}
.zwt_button .zwt_button-bg .zwt_button-right {}
.zwt_button .zwt_button-bg .zwt_button-right .zwt_button-topRight {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-right .zwt_button-topRight {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-right .zwt_button-topRight {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-right .zwt_button-topRight {}
.zwt_button .zwt_button-bg .zwt_button-right .zwt_button-middleRight {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-right .zwt_button-middleRight {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-right .zwt_button-middleRight {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-right .zwt_button-middleRight {}
.zwt_button .zwt_button-bg .zwt_button-right .zwt_button-bottomRight {}
.zwt_button.zwt_button-over .zwt_button-bg .zwt_button-right .zwt_button-bottomRight {}
.zwt_button.zwt_button-click .zwt_button-bg .zwt_button-right .zwt_button-bottomRight {}
.zwt_button.zwt_button-toggled .zwt_button-bg .zwt_button-right .zwt_button-bottomRight {}
Defined in: Button.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Construct a button.
|
Method Attributes | Method Name and Description |
---|---|
Return the click event manager attached to the button.
|
|
getHTML()
Return the button HTML text.
|
|
Return the mouse event manager attached to the button.
|
|
getText()
Return the button text.
|
|
Determine whether this button is disabled.
|
|
Return true if the button is focusable and not disabled.
|
|
Determine whether this button is a "toggle button" that retains its state.
|
|
Determine whether this button is toggled.
|
|
processClickEvent(zwt_event_ClickEvent_event)
Process the specified click event.
|
|
processEvent(zwt_event_Event_event)
Process the specified event.
|
|
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
|
|
processMouseEvent(zwt_event_MouseEvent_event)
Process the specified mouse event.
|
|
setDisabled(boolean_disabled)
Disable or enable the button.
|
|
setHTML(string_html)
Set the button HTML text.
|
|
setText(string_text)
Set the text of the button.
|
|
setToggleButton(boolean_toggle)
Configure this button as a "toggle button".
|
|
setToggled(boolean_toggled)
Toggle the button if this is a "toggle button".
|
- Methods borrowed from class zwt.ui.Widget:
- addStyle, draw, getContextFill, getDimension, getElement, getElementDimension, getFill, getFocusEventManager, getId, getKeyboardEventManager, getParent, getRelativeLeft, getRelativeTop, getStyle, getWheelEventManager, hasFocus, hasStyle, isVisible, onEvent, processContentEvent, processKeyboardEvent, processWheelEvent, redraw, removeStyle, replaceStyle, setFill, setFocusable, setId, setStyle, setVisible
Method Detail
{zwt.event.ClickEventManager}
getClickEventManager()
Return the click event manager attached to the button.
- Returns:
- The click event manager
{String}
getHTML()
Return the button HTML text.
- Returns:
- The button HTML text
{zwt.event.MouseEventManager}
getMouseEventManager()
Return the mouse event manager attached to the button.
- Returns:
- The mouse event manager
{String}
getText()
Return the button text.
- Returns:
- The button text
{Boolean}
isDisabled()
Determine whether this button is disabled. A disabled button can't respond to user input and generate events. The button is enabled initially by default.
- Returns:
- true if the button is disabled, false otherwise
{Boolean}
isFocusable()
Return true if the button is focusable and not disabled.
- Returns:
- true if the button is focusable
{Boolean}
isToggleButton()
Determine whether this button is a "toggle button" that retains its state.
- Returns:
- true if the button is a "toggle button", false otherwise
{Boolean}
isToggled()
Determine whether this button is toggled.
- Returns:
- true if the button is a toggled, false otherwise
processClickEvent(zwt_event_ClickEvent_event)
Process the specified click event.
- Parameters:
- {zwt.event.ClickEvent} zwt_event_ClickEvent_event
- The click event to process
processEvent(zwt_event_Event_event)
Process the specified event.
- Parameters:
- {zwt.event.Event} zwt_event_Event_event
- The event to process
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
- Parameters:
- {zwt.event.FocusEvent} zwt_event_FocusEvent_event
- The focus event to process
processMouseEvent(zwt_event_MouseEvent_event)
Process the specified mouse event.
- Parameters:
- {zwt.event.MouseEvent} zwt_event_MouseEvent_event
- The mouse event to process
setDisabled(boolean_disabled)
Disable or enable the button.
- Parameters:
- {Boolean} boolean_disabled
- true to disable the button, otherwise false
setHTML(string_html)
Set the button HTML text.
- Parameters:
- {String} string_html
- The button HTML text
setText(string_text)
Set the text of the button.
- Parameters:
- {String} string_text
- The button text
setToggleButton(boolean_toggle)
Configure this button as a "toggle button". This mean that the button will retain its state.
- Parameters:
- {Boolean} boolean_toggle
- true to set the button as a "toggle button", otherwise false
setToggled(boolean_toggled)
Toggle the button if this is a "toggle button".
- Parameters:
- {Boolean} boolean_toggled
- true to toggle the button, otherwise false