<basecomponent>
an abstract class which all components subclass

JavaScript: lz.basecomponent
extends <view> » <node> » lz.Eventable »

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

an abstract class which all components subclass

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
doesenter boolean boolean false read/write
  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 expression any true read/write
  when false the component should appear as its disabled state and not respond to user events. The component is automatically set to clickable when enabled, and not clickable when disabled.
hasdefault expression any false read/write
  set to true when this component will receive enter key events
isdefault expression any   read/write
  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 expression any null read/write
  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 expression any true read/write
  whether style should be applied to this component
text html lz.html   read/write
  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

acceptValue()
basecomponent.acceptValue(data : String, type : String);
Set `value` according to `type` from a String Used to set a typed value from a string representation. In this base method, the `value` is the text of the component. Cf., basevaluecomponent.
Parameter Name Type Description
data String the string representation of `value` (according to `type`).
type String (optional) the name of the type to use, defaults to `this.type`

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

presentValue()
basecomponent.presentValue(type : String);
Return `value` according to `type` as a String Used to get a string representation of a typed value. In this base method, the `value` is the text of the component. Cf., basevaluecomponent.
Parameter Name Type Description
type String (optional) the name of the type to use, defaults to `this.type`
Returns Type Description
  String the string representation of `value` (according to `type`)

setStyle()
basecomponent.setStyle(s);
Sets this component's style
Parameter Name Type Description
s    

setTint()
basecomponent.setTint(v : lz.view, color : Number, brightness : Number);
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. Only available on some runtimes.
Parameter Name Type Description
v lz.view the view to colorize
color Number the color to use for tinting (e.g. 0xddddff)
brightness Number -255 to 255, optional parameter will lighten or darken everything that is colorized

updateDefault()
basecomponent.updateDefault();
this method can be called to force the default button to update

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy