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
Details
Properties (15)
-
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.
-
_focusable
-
<attribute name="_focusable" type="boolean" value="true" />
private var _focusable : boolean;
keeps the original focusable value set by user.
-
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.
-
_otherstyledel
-
<attribute name="_otherstyledel" value="null" />
private var _otherstyledel;
when we're dependent on someone else's style
-
_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
-
_style
-
<attribute name="_style" value="null" />
-
styleable
-
<attribute name="styleable" value="true" />
whether style should be applied to this component
-
_styledel
-
<attribute name="_styledel" value="null" />
-
text
-
<attribute name="text" type="html" value="" />
public var text : lz.html;
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 (22)
-
applyData()
-
<method name="applyData" args="d" />
private function applyData(d);
when using databinding, this will interpret data supplied to this
component as the text for the component
-
_applystyle()
-
<method name="_applystyle" args="s" />
protected function _applystyle(s);
this method applies the style object's attributes to this
component
-
construct()
-
<method name="construct" args="parent, args" />
private function construct(parent, args);
event: when isdefault changes
-
destroy()
-
<method name="destroy" />
private function destroy();
-
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
-
_doMousedown()
-
<method name="_doMousedown" />
private function _doMousedown();
-
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
-
init()
-
-
_setDoesEnter()
-
<method name="_setDoesEnter" args="doe" />
private function _setDoesEnter(doe);
-
_setEnabled()
-
<method name="_setEnabled" args="isEnabled" />
private function _setEnabled(isEnabled);
-
_setFocusable()
-
<method name="_setFocusable" args="isFocusable" />
private function _setFocusable(isFocusable);
-
_setIsDefault()
-
<method name="_setIsDefault" args="def" />
private function _setIsDefault(def);
setter for the isdefault property : changes the look of the
button to its default look in the upstate
-
setStyle()
-
<method name="setStyle" args="s" />
public function setStyle(s);
Sets this component's style
-
_setstyle()
-
<method name="_setstyle" args="s" />
private function _setstyle(s);
-
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
-
_showEnabled()
-
<method name="_showEnabled" />
private function _showEnabled();
the value of _enabled is set via a constraint that is dependent
on the component's 'enabled' property and whether the parent
component is enabled this method allows subclasses to display
themselves differently when disabled
-
toString()
-
<method name="toString" />
private function toString();
-
updateData()
-
<method name="updateData" />
private function updateData();
when using databinding, this will update data when the
component's value changes (from user interaction or setAttribute)
-
updateDefault()
-
<method name="updateDefault" />
public function updateDefault();
this method can be called to force the default
button to update
-
_usestyle()
-
<method name="_usestyle" />
private function _usestyle();
Events (4)
-
on_enabled
-
<attribute name="on_enabled" />
private event on_enabled;
-
onfocusable
-
<attribute name="onfocusable" />
private event onfocusable;
-
onisdefault
-
<attribute name="onisdefault" />
private event onisdefault;
event: when isdefault changes
-
onstyle
-
<attribute name="onstyle" />
LZX Synopsis
<class name="
lz.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="
_focusable
" type="
boolean" value="
true" />
<attribute name="
style
" value="
null" />
<attribute name="
_style
" value="
null" />
<attribute name="
styleable
" value="
true" />
<attribute name="
_styledel
" value="
null" />
<attribute name="
text
" type="
html" value="
" />
<method name="
construct
" args="
parent,
args" />
<method name="
setTint
" args="
v,
color,
brightness" />
</class>
JavaScript Synopsis
public
lz.basecomponent extends
LzView
{
public var
text
:
lz.html;
prototype private function
construct
(
parent,
args);
prototype private function
destroy
();
prototype private function
init
();
prototype public function
setTint
(
v,
color,
brightness);
}