Assigning Component Methods to Control Events
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.
Instead of pressing the Macro... button the Component... button has to be used. It opens a 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.
|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).|