<basecomponent>

an abstract class which all components subclass

JavaScript: basecomponent

Extends View

An abstract base class that handles focus, the text attribute, and style.

Attributes
Name Usage Type (Tag) Type (JS) Default Category
doesenter Tag & JS boolean Boolean false setter
 

if set to true, the component manager will call this component with doEnterDown and doEnterUp when the enter key goes up or down if it is focussed.


enabled Tag & JS expression any true setter
 

when false the component should appear as its disabled state and not respond to user events (default: true) The component is automatically set to clickable when enabled, and not clickable when disabled.


hasdefault Tag & JS expression any false setter
 

set to true when this component will receive enter key events


isdefault Tag & JS expression any   setter
 

If set to true, this component will be the default (and will therefore receive the enter key) if it is nearest to the focussed view, and if that focussed view does not have doesenter set to true. "Nearness" is defined to mean the closest common parent with the focussed view that is not excluded from the mode, and which is visible onscreen.


style Tag & JS expression any   setter
 

if null, the style is set to the inherited style from the parent component, if no parent component the style will be the canvas 'defaultstyle' attribute


styleable Tag & JS expression any true setter
 

whether style should be applied to this component


text Tag & JS html any   setter
 

the label or title of the component: instead of using this attribute text may instead be placed withing the tag, for example: <button>OK</button>



Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes

Attributes inherited from View

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


Methods

doEnterDown()
basecomponent.doEnterDown()

Called if this component has the focus and the component has doesenter set to true and the enter key goes down



doEnterUp()
basecomponent.doEnterUp()

Called if this component has the focus and the component has doesenter set to true and the enter key goes up



doSpaceDown()
basecomponent.doSpaceDown()

Called if this component has the focus and the space bar goes down



doSpaceUp()
basecomponent.doSpaceUp()

Called if this component has the focus and the space bar goes up



setStyle()
basecomponent.setStyle(s)

Sets this component's style

Parameters
Name Type Desc
s None


setTint()
basecomponent.setTint(v, color, brightness)

colorizes a view, such that 50% gray appears as the given color with shades of color darker and lighter. This will not tint the background color (unless its a swatchview) but will tint any resources and all subviews.
param LzView v: the view to colorize
param Number color: the color to use for tinting (e.g. 0xddddff)
param Number brightness: -255 to 255, optional parameter will lighten or darken everything that is colorized

Parameters
Name Type Desc
v None
color None
brightness None


updateDefault()
basecomponent.updateDefault()

this method can be called to force the default button to update



Methods inherited from LzNode

animate, applyConstraint, applyData, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption

Methods inherited from LzView

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

Events inherited from LzNode

onconstruct, ondata, oninit

Events inherited from LzView

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