Button

出自OpenFace

跳转到: 导航, 搜索

目录

<button>

--Xuhb 2008年3月29日 (六) 10:49 (CST)

A button is usually used to interact with users like respond to a keyboard event to accomplish a particular action. Buttons can get focus and indicates as different appearance. Meanwhile buttons have other states. You can add a text label for the button and it will be displayed in the center of the button as default. You can manually adjust the spacing between the text and the button edge. Also you can make the button automatically resize itself to fit the text.

Attributes

Name        Usage      Type(Tag)    Type (JS)    Default    Category

autoresize      Tag & JS     boolean     Boolean     true     setter

If the button will automatically resize to fit the text.


text         Tag & JS     string      String      ""      setter

The content of button text label.


textPaddingX     Tag & JS     number     Number     11      setter

The padding spacing between the text label and the button edges on x-axis. This value will be used for button auto resizing.


textPaddingY     Tag & JS     number     Number     4       setter

The padding spacing between the text label and the button edges on y-axis. This value will be used for button auto resizing.


textX         Tag & JS     number     Number     11      setter

The x-axis coordinate of the text label. If it is not set, the text label will automatically adjusted to be center aligned.


textY         Tag & JS     number     Number     4      setter

The y-axis coordinate of the text label. If it is not set, the text label will automatically adjusted to be center aligned.


--Xuhb 2008年3月29日 (六) 10:59 (CST) [这部分和laszlo不同,组件直接继承自相对应的java类,具体的继承关系请参考API文档]

Attributes inherited from BaseButton

Attributes inherited from Component

align, bgcolor, clip, cloneManager, datapath, enabled, fgcolor, focusable, fontsize, frame, hassetheight, hassetwidth, height, ignorelayout, ignorex, ignorey, mask, opacity, resource, resourceheight, resourcewidth, rotation, source, totalframes, valign, visible, width, x, y

Attributes inherited from Node

id, name, parent, subnodes


Methods

--Xuhb 2008年3月29日 (六) 11:00 (CST) [这部分和laszlo不同,组件直接继承自相对应的java类,具体的继承关系请参考API文档]

Methods inherited from BaseButton

Methods inherited from Component

applyData, containsPt, converseToRelativeX, converseToRelativeY, dataBind, destroy, getAbsoluteX, getAbsoluteY, getAttribute, getBounds, getBGColor, getColor, getFontSize, getHeight, getParent, getResource, getRotation, getSource, getTotalFrames, getVisible, getWidth, getX, getY, getWidth, hasSetFGColor, hasSetFontSize, instantiateDone, isEnabled, isFocusable, sendBehind, sendInFrontOf, sendToBack, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setDatapath, setHeight, setOpacity, setResource, setResourceNumber, setRotation, setSource, setValign, setVisible, setWidth, setX, setY, stretchResource

Methods inherited from Node

getAttribute, setAttribute,applyConstraint


Events

--Xuhb 2008年3月29日 (六) 10:59 (CST) [这部分和laszlo不同,组件直接继承自相对应的java类,具体的继承关系请参考API文档]

Events inherited from Component

onenabled, onerror, onfocus, onwidth, onheight, onopacity, onvisible, onwidth, onx, ony, onpathready, oncloneend, onclonenumber

Events inherited from Node

ondata, oninit