Name
basecomponent — an abstract class which all components subclass
Description
An abstract base class that handles focus, the text attribute, and style.
an abstract class which all components subclass
Known Subclasses
Known Direct Subclasses: basebutton, basedatepicker, basegrid, basescrollbar, basescrollthumb, basetabpane, basetabs, basetabscontent, basetree, basevaluecomponent, basewindow, chart, menu, menubar, menuseparator, roundrectbutton
Details
Properties (11)
-
doesenter
-
<attribute name="doesenter" type="boolean" value="false" />
public var doesenter : Boolean;
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
-
<attribute name="enabled" value="true" />
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.
-
_enabled
-
<attribute name="_enabled" value="${this.enabled && (this._parentcomponent ? this._parentcomponent._enabled : true)}" />
used by the component to determine whether
to display its disabled state. A component is enabled if its
"parent component" is enabled and its 'enabled' attribute
evaluates to 'true' (its "parent component" is the first
component above it in the view hierarchy)
-
focusable
-
<attribute name="focusable" type="boolean" value="true" />
public var focusable : Boolean;
when true, the component can be focused.
-
hasdefault
-
<attribute name="hasdefault" value="false" />
set to true when this component will receive enter key events
-
_initcomplete
-
<attribute name="_initcomplete" value="false" />
protected var _initcomplete;
set to true in init method,
after subviews have been created and initialized
-
isdefault
-
<attribute name="isdefault" />
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.
-
_parentcomponent
-
<attribute name="_parentcomponent" value="null" />
protected read-only var _parentcomponent;
-
style
-
<attribute name="style" value="null" />
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
-
<attribute name="styleable" value="true" />
whether style should be applied to this component
-
text
-
<attribute name="text" type="html" value="" />
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>
Methods (8)
-
_applystyle()
-
<method name="_applystyle" args="s" />
protected function _applystyle(s);
this method applies the style object's attributes to this
component
-
doEnterDown()
-
<method name="doEnterDown" />
public function doEnterDown();
Called if this component has the focus and the component
has doesenter set to true and the enter key goes down
-
doEnterUp()
-
<method name="doEnterUp" />
public function doEnterUp();
Called if this component has the focus and the component
has doesenter set to true and the enter key goes up
-
doSpaceDown()
-
<method name="doSpaceDown" />
public function doSpaceDown();
Called if this component has the focus and the space bar goes
down
-
doSpaceUp()
-
<method name="doSpaceUp" />
public function doSpaceUp();
Called if this component has the focus and the space bar goes
up
-
setStyle()
-
<method name="setStyle" args="s" />
public function setStyle(s);
Sets this component's style
-
setTint()
-
<method name="setTint" args="v, color, brightness" />
public function 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
-
updateDefault()
-
<method name="updateDefault" />
public function updateDefault();
this method can be called to force the default
button to update
LZX Synopsis
<class name="
basecomponent" extends="
LzView
">
<attribute name="
doesenter
" type="
boolean" value="
false" />
<attribute name="
enabled
" value="
true" />
<attribute name="
_enabled
" value="
${this.enabled && (this._parentcomponent ? this._parentcomponent._enabled : true)}" />
<attribute name="
focusable
" type="
boolean" value="
true" />
<attribute name="
style
" value="
null" />
<attribute name="
styleable
" value="
true" />
<attribute name="
text
" type="
html" value="
" />
<method name="
setTint
" args="
v,
color,
brightness" />
</class>
JavaScript Synopsis
public
basecomponent extends
LzView
{
prototype public function
setTint
(
v,
color,
brightness);
}