Assigning Component Methods to Control Events

From Apache OpenOffice Wiki
Jump to: navigation, search



How a dialog is generally designed in the Basic IDE Dialog editor is described in First Steps with OpenOffice.org Basic. The assignment of macros to control events is also described there in the sub chapter Adding Event Handlers , but the Assign Action dialog showed in the following illustration can also be used to bind component methods to control events.

Assign Action dialog

Instead of pressing the Macro... button the Component... button has to be used. It opens a Assign Component dialog.

Assign Component dialog

Besides the standard buttons this dialog only contains an edit field to enter the name of the Component's method the event should be bound to. Unlike in the case of assigning macros it's not possible to browse to a component's methods because at design time no component instance exists. So the name has to be entered by hand.

The next illustration shows how the new assignment is shown in the Assign Action dialog.

Assign Action dialog with assigned component method


Tip.png When designing dialogs that should be used for components, it could make sense to create a new library first (see OpenOffice.org Basic Macro Organizer Dialog) and create the dialog there. Reason: The Standard library cannot be exported, but exporting the library containing the dialog as extension can be very useful in order to deploy it together with extension which contains the component.


The implementation of methods that should be assigned to events is explained in the following chapter.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages