The BaseComponent Class

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.

Table 2.3. The attributes of the BaseComponent class
NameUsageTypeDefaultAccessibility
doesenterTag and JSbooleanfalseread-write
 Description. If set to true, the component manager will call the doEnterDown and doEnterUp methods on this component.
enabledTag and JSbooleantrueread-write
 Description. Indicates if the component is enabled. An enabled component is also clickable and a disabled component is not clickable.
hasdefaultTag and JSbooleanfalseread-write
 Description. Indicates if this component can receive enter key events.
isdefaultTag and JSbooleanfalseread-write
 Description. Indicates if this component will be the default and therefore will receive the enter key.
styleTag and JSboolean read-write
 Description. If the value of this attribute is null, the style is set to the inherited style from the parent component.
styleableTag and JSbooleantrueread-write
 Description. Indicates if style should be applied to this component.
textTag and JShtml 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset