Bonsoir Bernard,
Bernard Marcelly wrote:
Example in Basic:

sub doSomething(evt as object)
dim myDialog as object
  myDialog = evt.Source.getContext()
end sub

Unfortunately, outside of OOo Basic for dialogs this is not possible, as the invoked script does not get the event object supplied (it does not get any arguments for that matter).
Actually, this is not true. After closing the scripting framework editor in which the macro that should get invoked is loaded, I now get one argument, the event object. Unfortunately, still I cannot issue a getContext() successfully (I get the source object from the event object, though, assuming that it is the commandButton/Button object). So it is still not possible to get at the xDialog.


I did like this without problem on OOo 2.0.1 / Win XP.
I created a dialog in My Macros, with a button starting a Python routine also in My Macros. The dialog was started from another Python routine, and when I pushed the button, the Python event handler modified a Textfield of the dialog.
Well if you are using an event handler, then it would be a different use case.

In the case where I have a problem the script to invoke via the OOo scripting framework is defined in the dialog editor. The commandButton's key-pressed and mouse-release events get the URL pointing to the macro which gets invoked/executed (and I can correctly refer to the appropriate key or mouse event object). So the question still would be up, how one would proceed to get at the xDialog object (tried to invoke the method "getContext()" on the source, but that did not work out, unfortunately).

Regards,

---rony


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to