The BaseComponent class is a subclass of LzView and the superclass of all LZX components. It is therefore worthwhile to spend some time examining its attributes and methods.
The attributes defined in the BaseComponent class are given in Table 2.3.
Name | Usage | Type | Default | Accessibility |
---|---|---|---|---|
doesenter | Tag and JS | boolean | false | read-write |
Description. If set to true, the component manager will call the doEnterDown and doEnterUp methods on this component. | ||||
enabled | Tag and JS | boolean | true | read-write |
Description. Indicates if the component is enabled. An enabled component is also clickable and a disabled component is not clickable. | ||||
hasdefault | Tag and JS | boolean | false | read-write |
Description. Indicates if this component can receive enter key events. | ||||
isdefault | Tag and JS | boolean | false | read-write |
Description. Indicates if this component will be the default and therefore will receive the enter key. | ||||
style | Tag and JS | boolean | read-write | |
Description. If the value of this attribute is null, the style is set to the inherited style from the parent component. | ||||
styleable | Tag and JS | boolean | true | read-write |
Description. Indicates if style should be applied to this component. | ||||
text | Tag and JS | html | read-write | |
Description. The label or title of this component. |
The following are methods added to the BaseComponent class.
doEnterDown()
Called when the enter key goes down and the component has the focus and its doesenter attribute is set to true.
doEnterUp()
Called when the enter key goes up and the component has the focus and its doesenter attribute is set to true.
doSpaceDown()
Called when the space bar goes down and the component has the focus.
doSpaceDown()
Called when the space bar goes up and the component has the focus.
setStyle(style)
Sets this component’s style.
setTint(subview, color, brightness)
Tints a view so that 50% gray appears as the given color with shades of the color darker or lighter. The brightness argument must be a number between –255 and 255 (inclusive).
updateDefault()
Forces the default button to update.