https://wiki.zimbra.com/api.php?action=feedcontributions&user=Rohitghatol&feedformat=atomZimbra :: Tech Center - User contributions [en]2024-03-28T08:13:59ZUser contributionsMediaWiki 1.39.0https://wiki.zimbra.com/index.php?title=DwtButton&diff=3878DwtButton2006-12-05T12:48:12Z<p>Rohitghatol: </p>
<hr />
<div>[[Zimbra AjaxTk]]->[[DHTML Widget Toolkit]]->[[Widgets]]<br />
----<br />
==Preview==<br />
[[Image:DwtButton.JPG]]<br />
==Usage==<br />
<code><br />
function createButton(name){<br />
var l = new AjxListener(null, buttonListener);<br />
var b = new DwtButton(shell);<br />
b.addSelectionListener(l);<br />
b.setText(name);<br />
}<br />
<br />
<br />
function buttonListener(ev) {<br />
alert("Button Pressed: " + ev.item.getText());<br />
}<br />
</code><br />
<br />
<br />
==Methods==<br />
=== <code>DwtButton(parent, style, className, posStyle, actionTiming) </code> ===<br />
This class represents a button, which is basically a smart label that can handle<br />
various UI events. It knows when it has been activated (the mouse is over it),<br />
when it has been triggered (mouse down), and when it has been pressed (mouse up).<br />
In addition to a label's image and/or text, a button may have a dropdown menu.<br />
;<code>parent</code> : the parent widget<br />
;<code>style</code> : the label style (see DwtLabel)<br />
;<code>className</code> : a CSS class for look and feel, defaults to "DwtButton" class<br />
;<code>posStyle</code> : HTML positioning style - Static, Absolute, Relative<br />
;<code>actionTiming</code>: Sets whether actions for this button should occur on mouse up or mouse down<br />
<br />
=== <code>setMenu(menuOrCallback, shouldToggle, followIconStyle)</code> ===<br />
<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
=== <code>addSelectionListener(listener)</code> ===<br />
<br />
=== <code>removeSelectionListener(listener)</code> ===<br />
Removes a selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>removeSelectionListeners()</code> ===<br />
Removes all the selection listeners.<br />
<br />
<br />
=== <code>addDropDownSelectionListener(listener)</code> ===<br />
Adds a listener to be notified when the dropdown arrow is pressed.<br />
;<code>listener</code> : a listener<br />
<br />
=== <code>removeDropDownSelectionListener(listener)</code> ===<br />
Removes a dropdown selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>setDropDownImages(enabledImg, disImg, hovImg, depImg)</code> ===<br />
<br />
<br />
=== <code>setEnabled(enabled)</code> ===<br />
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.<br />
;<code>enabled</code> : whether to enable the button<br />
<br />
=== <code>setHoverImage(hoverImageInfo)</code> ===<br />
;<code>hoverImageInfo</code> :<br />
<br />
setMenu(menuOrCallback, shouldToggle, followIconStyle)<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
<br />
getMenu()<br />
Returns the button's menu<br />
<br />
resetClassName()<br />
Returns the button display to normal (not activated or triggered).<br />
<br />
setActionTiming(actionTiming)<br />
Sets whether actions for this button should occur on mouse up or mouse down.<br />
;<code>actionTiming</code> : Currently supports DwtButton.ACTION_MOUSEDOWN and DwtButton.ACTION_MOUSEUP<br />
<br />
setActivated(activated)<br />
Activates/inactivates the button. A button is activated when the mouse is over it.<br />
;<code>activated</code> : whether the button is activated<br />
<br />
=== <code>setEnabledImage(imageInfo)</code> ===<br />
;<code>imageInfo</code> : <br />
<br />
setDepressedImage(imageInfo)<br />
<br />
setToggled(toggled)<br />
<br />
isToggled()<br />
<br />
popup()<br />
<br />
<br />
trigger()<br />
deactivate()</div>Rohitghatolhttps://wiki.zimbra.com/index.php?title=DwtButton&diff=3877DwtButton2006-12-05T12:46:51Z<p>Rohitghatol: /* <code>DwtButton(parent, style, className, posStyle, actionTiming) </code> */</p>
<hr />
<div>[[Zimbra AjaxTk]]->[[DHTML Widget Toolkit]]->[[Widgets]]<br />
----<br />
==Preview==<br />
[[Image:DwtButton.JPG]]<br />
==Usage==<br />
<code>function createButton(name){<br />
var l = new AjxListener(null, buttonListener);<br />
var b = new DwtButton(shell);<br />
b.addSelectionListener(l);<br />
b.setText(name);<br />
}</code><br />
<br />
<br />
<code>function buttonListener(ev) {<br />
alert("Button Pressed: " + ev.item.getText());<br />
}</code><br />
<br />
<br />
==Methods==<br />
=== <code>DwtButton(parent, style, className, posStyle, actionTiming) </code> ===<br />
This class represents a button, which is basically a smart label that can handle<br />
various UI events. It knows when it has been activated (the mouse is over it),<br />
when it has been triggered (mouse down), and when it has been pressed (mouse up).<br />
In addition to a label's image and/or text, a button may have a dropdown menu.<br />
;<code>parent</code> : the parent widget<br />
;<code>style</code> : the label style (see DwtLabel)<br />
;<code>className</code> : a CSS class for look and feel, defaults to "DwtButton" class<br />
;<code>posStyle</code> : HTML positioning style - Static, Absolute, Relative<br />
;<code>actionTiming</code>: Sets whether actions for this button should occur on mouse up or mouse down<br />
<br />
=== <code>setMenu(menuOrCallback, shouldToggle, followIconStyle)</code> ===<br />
<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
=== <code>addSelectionListener(listener)</code> ===<br />
<br />
=== <code>removeSelectionListener(listener)</code> ===<br />
Removes a selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>removeSelectionListeners()</code> ===<br />
Removes all the selection listeners.<br />
<br />
<br />
=== <code>addDropDownSelectionListener(listener)</code> ===<br />
Adds a listener to be notified when the dropdown arrow is pressed.<br />
;<code>listener</code> : a listener<br />
<br />
=== <code>removeDropDownSelectionListener(listener)</code> ===<br />
Removes a dropdown selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>setDropDownImages(enabledImg, disImg, hovImg, depImg)</code> ===<br />
<br />
<br />
=== <code>setEnabled(enabled)</code> ===<br />
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.<br />
;<code>enabled</code> : whether to enable the button<br />
<br />
=== <code>setHoverImage(hoverImageInfo)</code> ===<br />
;<code>hoverImageInfo</code> :<br />
<br />
setMenu(menuOrCallback, shouldToggle, followIconStyle)<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
<br />
getMenu()<br />
Returns the button's menu<br />
<br />
resetClassName()<br />
Returns the button display to normal (not activated or triggered).<br />
<br />
setActionTiming(actionTiming)<br />
Sets whether actions for this button should occur on mouse up or mouse down.<br />
;<code>actionTiming</code> : Currently supports DwtButton.ACTION_MOUSEDOWN and DwtButton.ACTION_MOUSEUP<br />
<br />
setActivated(activated)<br />
Activates/inactivates the button. A button is activated when the mouse is over it.<br />
;<code>activated</code> : whether the button is activated<br />
<br />
=== <code>setEnabledImage(imageInfo)</code> ===<br />
;<code>imageInfo</code> : <br />
<br />
setDepressedImage(imageInfo)<br />
<br />
setToggled(toggled)<br />
<br />
isToggled()<br />
<br />
popup()<br />
<br />
<br />
trigger()<br />
deactivate()</div>Rohitghatolhttps://wiki.zimbra.com/index.php?title=DwtButton&diff=3876DwtButton2006-12-05T12:45:32Z<p>Rohitghatol: </p>
<hr />
<div>[[Zimbra AjaxTk]]->[[DHTML Widget Toolkit]]->[[Widgets]]<br />
----<br />
==Preview==<br />
[[Image:DwtButton.JPG]]<br />
==Usage==<br />
<code>function createButton(name){<br />
var l = new AjxListener(null, buttonListener);<br />
var b = new DwtButton(shell);<br />
b.addSelectionListener(l);<br />
b.setText(name);<br />
}</code><br />
<br />
<br />
<code>function buttonListener(ev) {<br />
alert("Button Pressed: " + ev.item.getText());<br />
}</code><br />
<br />
<br />
==Methods==<br />
=== <code>DwtButton(parent, style, className, posStyle, actionTiming) </code> ===<br />
This class represents a button, which is basically a smart label that can handle<br />
various UI events. It knows when it has been activated (the mouse is over it),<br />
when it has been triggered (mouse down), and when it has been pressed (mouse up).<br />
In addition to a label's image and/or text, a button may have a dropdown menu.<br />
;<code>parent</code> : the parent widget<br />
;<code>style</code> : the label style (see DwtLabel)<br />
;<code>className</code> : a CSS class for look and feel, defaults to "DwtButton" class<br />
;<code>posStyle</code> : HTML positioning style - Static, Absolute, Relative<br />
<br />
=== <code>setMenu(menuOrCallback, shouldToggle, followIconStyle)</code> ===<br />
<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
=== <code>addSelectionListener(listener)</code> ===<br />
<br />
=== <code>removeSelectionListener(listener)</code> ===<br />
Removes a selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>removeSelectionListeners()</code> ===<br />
Removes all the selection listeners.<br />
<br />
<br />
=== <code>addDropDownSelectionListener(listener)</code> ===<br />
Adds a listener to be notified when the dropdown arrow is pressed.<br />
;<code>listener</code> : a listener<br />
<br />
=== <code>removeDropDownSelectionListener(listener)</code> ===<br />
Removes a dropdown selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>setDropDownImages(enabledImg, disImg, hovImg, depImg)</code> ===<br />
<br />
<br />
=== <code>setEnabled(enabled)</code> ===<br />
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.<br />
;<code>enabled</code> : whether to enable the button<br />
<br />
=== <code>setHoverImage(hoverImageInfo)</code> ===<br />
;<code>hoverImageInfo</code> :<br />
<br />
setMenu(menuOrCallback, shouldToggle, followIconStyle)<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
<br />
getMenu()<br />
Returns the button's menu<br />
<br />
resetClassName()<br />
Returns the button display to normal (not activated or triggered).<br />
<br />
setActionTiming(actionTiming)<br />
Sets whether actions for this button should occur on mouse up or mouse down.<br />
;<code>actionTiming</code> : Currently supports DwtButton.ACTION_MOUSEDOWN and DwtButton.ACTION_MOUSEUP<br />
<br />
setActivated(activated)<br />
Activates/inactivates the button. A button is activated when the mouse is over it.<br />
;<code>activated</code> : whether the button is activated<br />
<br />
=== <code>setEnabledImage(imageInfo)</code> ===<br />
;<code>imageInfo</code> : <br />
<br />
setDepressedImage(imageInfo)<br />
<br />
setToggled(toggled)<br />
<br />
isToggled()<br />
<br />
popup()<br />
<br />
<br />
trigger()<br />
deactivate()</div>Rohitghatolhttps://wiki.zimbra.com/index.php?title=DwtButton&diff=3875DwtButton2006-12-05T12:40:20Z<p>Rohitghatol: </p>
<hr />
<div>[[Zimbra AjaxTk]]->[[DHTML Widget Toolkit]]->[[Widgets]]<br />
----<br />
==Preview==<br />
[[Image:DwtButton.JPG]]<br />
==Usage==<br />
<code>function createButton(name){<br />
var l = new AjxListener(null, buttonListener);<br />
var b = new DwtButton(shell);<br />
b.addSelectionListener(l);<br />
b.setText(name);<br />
}</code><br />
<br />
<br />
<code>function buttonListener(ev) {<br />
alert("Button Pressed: " + ev.item.getText());<br />
}</code><br />
<br />
<br />
==Methods==<br />
=== <code>setMenu(menuOrCallback, shouldToggle, followIconStyle)</code> ===<br />
<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
=== <code>addSelectionListener(listener)</code> ===<br />
<br />
=== <code>removeSelectionListener(listener)</code> ===<br />
Removes a selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>removeSelectionListeners()</code> ===<br />
Removes all the selection listeners.<br />
<br />
<br />
=== <code>addDropDownSelectionListener(listener)</code> ===<br />
Adds a listener to be notified when the dropdown arrow is pressed.<br />
;<code>listener</code> : a listener<br />
<br />
=== <code>removeDropDownSelectionListener(listener)</code> ===<br />
Removes a dropdown selection listener.<br />
;<code>listener</code> : the listener to remove<br />
<br />
=== <code>setDropDownImages(enabledImg, disImg, hovImg, depImg)</code> ===<br />
<br />
<br />
=== <code>setEnabled(enabled)</code> ===<br />
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.<br />
;<code>enabled</code> : whether to enable the button<br />
<br />
=== <code>setHoverImage(hoverImageInfo)</code> ===<br />
;<code>hoverImageInfo</code> :<br />
<br />
setMenu(menuOrCallback, shouldToggle, followIconStyle)<br />
Adds a dropdown menu to the button, available through a small down-arrow.<br />
;<code>menuOrCallback</code> : 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.<br />
;<code>shouldToggle</code> : <br />
;<code>followIconStyle</code> : style of menu item (should be checked or radio style) for which the button icon should reflect the menu item icon<br />
<br />
<br />
getMenu()<br />
Returns the button's menu<br />
<br />
resetClassName()<br />
Returns the button display to normal (not activated or triggered).<br />
<br />
setActionTiming(actionTiming)<br />
Sets whether actions for this button should occur on mouse up or mouse down.<br />
;<code>actionTiming</code> : Currently supports DwtButton.ACTION_MOUSEDOWN and DwtButton.ACTION_MOUSEUP<br />
<br />
setActivated(activated)<br />
Activates/inactivates the button. A button is activated when the mouse is over it.<br />
;<code>activated</code> : whether the button is activated<br />
<br />
=== <code>setEnabledImage(imageInfo)</code> ===<br />
;<code>imageInfo</code> : <br />
<br />
setDepressedImage(imageInfo)<br />
<br />
setToggled(toggled)<br />
<br />
isToggled()<br />
<br />
popup()<br />
<br />
<br />
trigger()<br />
deactivate()</div>Rohitghatolhttps://wiki.zimbra.com/index.php?title=File:DwtButton.JPG&diff=3874File:DwtButton.JPG2006-12-05T12:33:25Z<p>Rohitghatol: DwtButton Sample Image file</p>
<hr />
<div>DwtButton Sample Image file</div>Rohitghatol