DwtButton
Zimbra AjaxTk->DHTML Widget Toolkit->Widgets
Methods
setMenu(menuOrCallback, shouldToggle, followIconStyle)
Adds a dropdown menu to the button, available through a small down-arrow.
menuOrCallback
- The dropdown menu or an AjxCallback object. If a callback is given, it is called the first time the menu is requested. The callback must return a valid DwtMenu object.
shouldToggle
followIconStyle
- style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon
addSelectionListener(listener)
removeSelectionListener(listener) Removes a selection listener.
listener
- the listener to remove
removeSelectionListeners() Removes all the selection listeners.
addDropDownSelectionListener(listener)
Adds a listener to be notified when the dropdown arrow is pressed.
listener
- a listener
removeDropDownSelectionListener(listener) Removes a dropdown selection listener.
listener
- the listener to remove
setDropDownImages(enabledImg, disImg, hovImg, depImg)
DwtButton.prototype.setEnabled(enabled)
Sets the enabled/disabled state of the button. A disabled button may have a different image, and greyed out text. The button (and its menu) will only have listeners if it is enabled.
enabled
- whether to enable the button
setHoverImage(hoverImageInfo)
setMenu(menuOrCallback, shouldToggle, followIconStyle) Adds a dropdown menu to the button, available through a small down-arrow.
menuOrCallback
- The dropdown menu or an AjxCallback object. If a callback is given, it is called the first time the menu is requested. The callback must return a valid DwtMenu object.
shouldToggle
followIconStyle
- style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon
getMenu()
Returns the button's menu
resetClassName() Returns the button display to normal (not activated or triggered).
setActionTiming(actionTiming) Sets whether actions for this button should occur on mouse up or mouse down.
actionTiming
- Currently supports DwtButton.ACTION_MOUSEDOWN and DwtButton.ACTION_MOUSEUP
setActivated(activated) Activates/inactivates the button. A button is activated when the mouse is over it.
activated
- whether the button is activated
setEnabledImage
setDepressedImage(imageInfo)
setToggled(toggled)
isToggled()
popup()
trigger()
deactivate()