21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Events 217<br />

The Assign Action dialog lists all of<br />

the available Events. To assign a<br />

macro to an event:<br />

1. Select the event<br />

2. Click Macro...<br />

3. Browse to and select the macro<br />

you want to assign<br />

4. Click OK<br />

Parameters<br />

The occurrence of a particular event<br />

is not always enough for an<br />

The Assign Action dialog<br />

appropriate response. Additional information may be required. For example, to process a<br />

mouse click, you may need the screen position where the mouse button was pressed.<br />

In <strong>OpenOffice</strong>.<strong>org</strong> Basic, you can use object parameters to provide more information about<br />

an event to a procedure, for example:<br />

Sub ProcessEvent(Event As Object)<br />

End Sub<br />

The structure and properties of the Event object depend on the type of event that triggers<br />

the procedure call.<br />

Regardless of the type of event, all objects provide access to the relevant control element<br />

and its model. The control element can be reached using Event.Source and its model using<br />

Event.Source.Model.<br />

You can use these properties to trigger an event within an event handler.<br />

Mouse Events<br />

<strong>OpenOffice</strong>.<strong>org</strong> Basic recognizes the following mouse events:<br />

Mouse moved<br />

user moves mouse<br />

Mouse moved while key pressed<br />

user drags mouse while holding down a key<br />

Mouse button pressed<br />

user presses a mouse button<br />

Mouse button released<br />

user releases a mouse button<br />

Mouse outside<br />

user moves mouse outside of the current window<br />

The structure of the associated event objects is defined in the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!