Common events

Following is a list of common events broadcast by various classes. Every component should try to broadcast these events if they make sense for that component. This is not a complete list of events for all components, just ones that are likely to be reused by other components. Even though some events specify no parameters, all events have an implicit parameter: a reference to the object broadcasting the event.

Event

Parameters

Use

click

None

Used by Button, or whenever a mouse click has no other meaning.

scroll

Scrollbar.lineUp, lineDown, pageUp, pageDown, thumbTrack, thumbPosition, endScroll, toTop, toBottom, lineLeft, lineRight, pageLeft, pageRight, toLeft, toRight

Used by ScrollBar and by other controls that cause scrolling (scroll "bumpers" on a scrolling pop-up menu).

change

None

Used by List, ComboBox, and other text entry components.

maxChars

None

Used when user tries to enter too many characters in text entry components.

In addition, because of inheritance from UIComponent, all components broadcast the following events:

UIComponent event

Description

load

The component is creating or loading its subobjects.

unload

The component is unloading its subobjects.

focusIn

The component now has the input focus. Some HTML-equivalent components (ListBox, ComboBox, Button, Text) might also emit focus, but all emit DOMFocusIn

focusOut

The component has lost the input focus.

move

The component has been moved to a new location.

resize

The component has been resized.

The following table describes common key events:

Key events

Description

keyDown

A key has been pressed. The code property contains the key code and the ascii property contains the ASCII code of the key pressed. Do not check with the low-level Key object, because the event might not have been generated by the Key object.

keyUp

A key has been released.