Class wtAnchor
Object
|
+--wtObject
|
+--wtWidget
|
+--wtAnchor
- class
wtAnchor
- extends wtWidget
A wtAnchor can be used in two ways:
It can be used as a traditional HTML anchor (i.e. a hyperlink) by setting a href attribute to it via
setHref()
Or, it can be used as a text-only button by setting an event handler to it via
setHandler()
Defined in wt_widget.js
Constructor Summary |
wtAnchor(<wtWidget|DOM_Node> _parent, <String> _desc)
Constructs a text-only link which can be used to invoke event handlers or act as simple hyperlinks.
|
Method Summary |
Object
|
base(<wtWidget> _parent, <String> _tagName)
Constructs a widget based on a DOM node
|
Boolean
|
isEnabled()
Tells whether the anchor is currently enabled or not
|
void
|
resetHandler()
Removes the click handler of the anchor
|
void
|
resetHref()
Removes the href attribute of the anchor
|
void
|
setEnabled(<Boolean> yes)
Sets whether the anchor is enabled or not.
|
void
|
setHandler(<Function> handler)
Sets the click handler of the anchor for use as a text-only button
|
void
|
setHref(<String> href)
Sets the href attribute of the anchor for use as a traditional hyperlink
|
Methods inherited from class wtWidget |
setStaticPosition, setRelativePosition, setAbsolutePosition, getAbsolutePosition, getScreenPosition, setPosition, setSize, setVisible, setDisplay, setAlpha, setDraggable, setDragArea, unsetDragArea, setSelectable, isInside, removeSelf, clearAll, setLevel, addWidget, linkSignal, isAncestorOf, getStyle, setStyle
|
Methods inherited from class wtObject |
startProxy, endProxy, toString, connect, disconnect, emit, setSlot, removeSlot, setSignal, removeSignal, get, set, addDependency, clearLapsedListeners
|
wtAnchor
wtAnchor(<wtWidget|DOM_Node> _parent, <String> _desc)
Constructs a text-only link which can be used to invoke event handlers or act as simple hyperlinks.
Parameters:
_parent
- The parent container for adding this widget to. Can also be a DOM node or null.
_desc
- The caption text of the anchor
base
Object base(<wtWidget> _parent, <String> _tagName)
Constructs a widget based on a DOM node
Parameters:
_parent
- The container widget to add this widget to. Can also be a DOM node like document.body. Fill in null if you don't want to immediately add this widget to a container.
_tagName
- The new DOM node's HTML tag
isEnabled
Boolean isEnabled()
Tells whether the anchor is currently enabled or not
Returns:
Whether the anchor is currently enabled or not
resetHandler
void resetHandler()
Removes the click handler of the anchor
resetHref
void resetHref()
Removes the href attribute of the anchor
setEnabled
void setEnabled(<Boolean> yes)
Sets whether the anchor is enabled or not. A disabled anchor appears grayed and is unresponsive to user events such as clicks and
mouse overs.
Parameters:
yes
- Whether the anchor is enabled or not
setHandler
void setHandler(<Function> handler)
Sets the click handler of the anchor for use as a text-only button
Parameters:
handler
- The click handler. Input arguments of the handler follow the universal event handler format in WT Toolkit.
setHref
void setHref(<String> href)
Sets the href attribute of the anchor for use as a traditional hyperlink
Documentation generated by
JSDoc on Sun May 13 11:26:24 2007