The button class provides a simple pushbutton.
The <button> tag provides a simple button. The
button is rectangular and typically displays a text label describing
its action. The button adjusts to fit the label.
<canvas height="30">
<button onclick="animate('x', 100, 1000, true)">
Move me
</button>
</canvas>
If you need to format the text using additional tags such as
<b>, add the text inside the button tags instead of
using the text attribute.
<canvas height="30">
<button onclick="animate('x', 100, 1000, true)">
Move <b>me</b>
</button>
</canvas>
A <button> may contain both XHTML markup, and
object tags such as <attribute> and
<method>.
<canvas height="30">
<button onclick="moveHoriz(5);">
Move <b>me</b>
<method name="moveHoriz" args="moveAmount">
this.setAttribute("x", this.x+moveAmount);
</method>
</button>
</canvas>
For details on how this component is constructed, see the Button section of the Component Design Guide.
| Attributes | |||||
| Name | Usage | Type (Tag) | Type (JS) | Default | Category |
| text_padding_x | Tag & JS | number | Number | 11 | setter |
|
the amount of space to add horizontally when sizing button to its text. default: 11 |
|||||
|
|
|||||
| text_padding_y | Tag & JS | number | Number | 4 | setter |
|
the amount of space to add vertically when sizing button to its text. default: 4 |
|||||
|
|
|||||
| text_x | Tag & JS | number | Number | setter | |
|
the x position of the button text. default: centered |
|||||
|
|
|||||
| text_y | Tag & JS | number | Number | setter | |
|
the y position of the button text. default: centered |
|||||
|
|
|||||
disabledResourceNumber, downResourceNumber, maxframes, normalResourceNumber, onresourceviewcount, overResourceNumber, reference, resourceviewcount, respondtomouseout
doesenter, enabled, hasdefault, isdefault, style, styleable, text
class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes
aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset
| doEnterDown() | ||
| button.doEnterDown() | ||
|
Called by the button manager when this button is the default |
||
|
|
| doEnterUp() | ||
| button.doEnterUp() | ||
|
Called by the button manager when this button is the default |
||
|
|
doSpaceDown, doSpaceUp, setResourceViewCount, showDown, showOver, showUp
animate, applyConstraint, applyData, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption
addProxyPolicy, addSubview, bringToFront, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, init, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisible, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize
| Events |
onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony
Copyright © 2002-2005 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.