Event handling of controls is performed using the $[officename] API. If you assign an event to a control, an object registers itself internally as a &quot; Listener &quot; for a specific control event. To do this, the object must use a specific interface, for example the XFocusListener Interface, so that it can react to focus events. When the event occurs, the control then invokes a special method of the Listener interface when the control receives the focus. The internally registered object then invokes the JavaScript or $[officename] Basic code, which was assigned to the event.
控制的事件处理是使用 $[officename] API 来实现。当为控制指定事件时，对象会将自己以内部注册的方式注册成特定控制事件的“收听者”。为此，该对象必须使用特定的接口，例如 XFocusListener 接口，以便对瞄准事件做出反应。事件发生后，控制会在接收到瞄准时调用收听者接口的特殊方法。内部注册的对象随后将调用指定到该事件的 JavaScript 或 $[officename] Basic 代码。