Class
zebkit.ui.Button
mixed with <zebkit.ui.FireEventRepeatedly> <zebkit.ui.DrawFocusMarker> extends <zebkit.ui.EvStatePan> |
<zebkit.ui> |
Button UI component. Button is composite component whose look and feel can be easily customized:
// create image button
var button = new zebkit.ui.Button(new zebkit.ui.ImagePan("icon1.gif"));
// create image + caption button
var button = new zebkit.ui.Button(new zebkit.ui.ImageLabel("Caption", "icon1.gif"));
// create multilines caption button
var button = new zebkit.ui.Button("Line1\nLine2");
zebkit.ui.Button
([t]
)
Parameters:
-
[t]
<String | zebkit.ui.Panel | zebkit.draw.View>a button label. The label can be a simple text or an UI component.
Inherited methods:
$setConstraints(c)
add(constr, d)
byConstraints([p], c)
byPath(path, [cb])
calcPreferredSize(t)
doLayout( )
fire(name, [path], [params])
focused( )
getBottom( )
getCanvas( )
getComponentAt(x, y)
getHorPadding( )
getLeft( )
getPreferredSize( )
getRight( )
getTop( )
getVerPadding( )
hasFocus( )
indexOf(c)
insert(i, constr, d)
invalidate( )
invalidateLayout( )
keyPressed(e)
keyReleased(e)
kidAdded(index, constr, l)
kidRemoved(i, l, ctr)
laidout( )
load(JSON)
off([eventName], [path], [cb])
on([eventName], [path], cb)
paintChildComponents(g, clipChild)
paintComponent(g)
paintViewAt(g, ax, ay, v)
pointerDragged(e)
pointerEntered(e)
pointerExited(e)
pointerPressed(e)
pointerReleased(e)
properties([path], props)
property([path], name, value)
recalc( )
relocated(px, py)
remove(c)
removeAll( )
removeAt(i)
removeByConstraints(ctr)
removeMe([after])
repaint([x], [y], [w], [h])
replaceMe([ctr], c)
requestFocus( )
requestFocusIn([timeout])
resized(pw, ph)
setAt(i, d)
setBackground(v)
setBorder([v])
setBorderLayout([gap])
setBottomPadding(bottom)
setBounds(x, y, w, h)
setByConstraints(constr, c)
setCanHaveFocus(b)
setConstraints(ctr)
setEnabled(b)
setFireParams(b, firePeriod, [startIn])
setFlowLayout([ax], [ay], [dir], [gap])
setFocusAnchorComponent(c)
setFocusMarkerView(c)
setGrisLayout( )
setId(id)
setKids(a)
setLayout(m)
setLeftPadding(left)
setListLayout([ax], [gap])
setLocation(xx, yy)
setPadding(v)
setParent(o)
setPreferredHeigh(h)
setPreferredSize(w, h)
setPreferredWidth(w)
setProperties([path], props)
setRasterLayout([usePsSize])
setRightPadding(right)
setSize(w, h)
setStackLayout([gap])
setState(s)
setTopPadding(top)
setView(v)
setVisible(b)
stateUpdated(o, n)
syncState( )
toBack( )
toFront( )
toPreferredHeight( )
toPreferredSize( )
toPreferredWidth( )
toView(target)
toViewId(s)
validate( )
validateMetric( )
vrp( )
Inherited attributes:
protected
Function
$matchPath
private
zebkit.util.Task
$repeatTask
public
zebkit.draw.View
bg
public
zebkit.draw.View
border
public
Object
constraints
public
Integer
firePeriod
public
zebkit.ui.Panel
focusComponent
public
Integer
focusMarkerGaps
public
zebkit.draw.View
focusMarkerView
public
Integer
height
public
Boolean
isEnabled
public
Boolean
isFireByPress
public
Boolean
isValid
public
Boolean
isVisible
public
Array
kids
public
zebkit.layout.Layout
layout
public
zebkit.layout.Layoutable
parent
public
Integer
startIn
public
Object
state
public
zebkit.draw.View
view
public
Integer
width
public
Integer
x
public
Integer
y



















public
<Boolean>
canHaveFocus
/* Overwritten from canHaveFocus */
Indicates the component can have focus |
Inherited events:
childEventName(e)
clipCopy()
clipPaste(s)
compAdded(e)
compEnabled(e)
compMoved(e)
compRemoved(e)
compShown(e)
compSized(e)
focusGained(e)
focusLost(e)
keyPressed(e)
keyReleased(e)
keyTyped(e)
pointerClicked(e)
pointerDragEnded(e)
pointerDragged(e)
pointerDragStarted(e)
pointerEntered(e)
pointerExited(e)
pointerMoved(e)
pointerPressed(e)
pointerReleased(e)
fired
Fired when a button has been pressed
Button can be adjusted in respect how it generates the pressed event. Event can be triggered by pressed or clicked even. Also event can be generated periodically if the button is kept in pressed state. Parameters:
|