[api-dev] How to handle OnSelect event on sheet ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[api-dev] How to handle OnSelect event on sheet ?

Bernard Marcelly
Hi,
I am trying to attach a macro to the sheet events available in OOo 3.3 (by a
right-click on the sheet tab).

With the OnSelect event, if the called macro displays a message you go into an
endless loop because, once the message appears, the slightest move of the mouse
changes the selection (all buttons released) - and calls again the macro !
I don't know how to avoid this. I feel there is a design problem here. The
selection should not change when no mouse button is pressed.
Tested on RC9 with Windows XP.

Example of macro:

Sub handleEvent(zone As Object)
   MsgBox("Hey!")
End Sub

Regards
   Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [api-dev] How to handle OnSelect event on sheet ?

Niklas Nebel-2
Bernard Marcelly schrieb:

> I am trying to attach a macro to the sheet events available in OOo 3.3
> (by a right-click on the sheet tab).
>
> With the OnSelect event, if the called macro displays a message you go
> into an endless loop because, once the message appears, the slightest
> move of the mouse changes the selection (all buttons released) - and
> calls again the macro !
> I don't know how to avoid this. I feel there is a design problem here.
> The selection should not change when no mouse button is pressed.
> Tested on RC9 with Windows XP.
>
> Example of macro:
>
> Sub handleEvent(zone As Object)
>   MsgBox("Hey!")
> End Sub

The message box interferes with cell selection, because the view doesn't
get a "button released" event. Change your macro to something that
doesn't show a message box, and it should work better.

Niklas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]