Name

basecomponent — an abstract class which all components subclass

Synopsis

LZX: basecomponent
JavaScript: lz.basecomponent
Type: Class
Access: public
Topic: Components.Base Components
Declared in: lps/components/base/basecomponent.lzx

Description

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

an abstract class which all components subclass

Superclass Chain

node (LzNode) » view (LzView) » basecomponent

Known Subclasses

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" />
public var enabled;
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)}" />
protected var _enabled;
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" />
public var hasdefault;
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" />
public var 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" />
public var style;
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" />
private var _style;
styleable
<attribute name="styleable" value="true" />
public var styleable;
whether style should be applied to this component
_styledel
<attribute name="_styledel" value="null" />
private var _styledel;
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()
<method name="init" />
private function 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" />
private event 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=" hasdefault " value="false" />
  <attribute name=" _initcomplete " value="false" />
  <attribute name=" isdefault " />
  <attribute name=" _otherstyledel " value="null" />
  <attribute name=" _parentcomponent " value="null" />
  <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=" applyData " args="d" />
  <method name=" _applystyle " args="s" />
  <method name=" construct " args="parent, args" />
  <method name=" destroy " />
  <method name=" doEnterDown " />
  <method name=" doEnterUp " />
  <method name=" _doMousedown " />
  <method name=" doSpaceDown " />
  <method name=" doSpaceUp " />
  <method name=" init " />
  <event name=" on_enabled " />
  <event name=" onfocusable " />
  <event name=" onisdefault " />
  <event name=" onstyle " />
  <method name=" _setDoesEnter " args="doe" />
  <method name=" _setEnabled " args="isEnabled" />
  <method name=" _setFocusable " args="isFocusable" />
  <method name=" _setIsDefault " args="def" />
  <method name=" setStyle " args="s" />
  <method name=" _setstyle " args="s" />
  <method name=" setTint " args="v, color, brightness" />
  <method name=" _showEnabled " />
  <method name=" toString " />
  <method name=" updateData " />
  <method name=" updateDefault " />
  <method name=" _usestyle " />
</class>

JavaScript Synopsis

public lz.basecomponent extends  LzView  {
  public var doesenter  : boolean;
  public var enabled ;
  protected var _enabled ;
  public var focusable  : boolean;
  private var _focusable  : boolean;
  public var hasdefault ;
  protected var _initcomplete ;
  public var isdefault ;
  private var _otherstyledel ;
  protected read-only var _parentcomponent ;
  public var style ;
  private var _style ;
  public var styleable ;
  private var _styledel ;
  public var text  : lz.html;
  prototype private function applyData (d);
  prototype protected function _applystyle (s);
  prototype private function construct (parent, args);
  prototype private function destroy ();
  prototype public function doEnterDown ();
  prototype public function doEnterUp ();
  prototype private function _doMousedown ();
  prototype public function doSpaceDown ();
  prototype public function doSpaceUp ();
  prototype private function init ();
  prototype private event on_enabled ;
  prototype private event onfocusable ;
  prototype private event onisdefault ;
  prototype private event onstyle ;
  prototype private function _setDoesEnter (doe);
  prototype private function _setEnabled (isEnabled);
  prototype private function _setFocusable (isFocusable);
  prototype private function _setIsDefault (def);
  prototype public function setStyle (s);
  prototype private function _setstyle (s);
  prototype public function setTint (v, color, brightness);
  prototype private function _showEnabled ();
  prototype private function toString ();
  prototype private function updateData ();
  prototype public function updateDefault ();
  prototype private function _usestyle ();
}