Hi Marc,

> The IDL reference tells me about "css.script.registerScriptEvent":
> ...
> registers one event for an object identified by its index. 
>         
>         If any object is attached under this index, then this event is
>         attached automatically. 
> ...
> 
> I do not understand what object is in this context. Is it the main form
> ("Standard") or is it the control aka. my button?

it's your button. More precise, it's the index of the button within its
containing form. So,
  oForm.registerScriptEvent(0, oEvents(0))
registers events for the first child (because of the first "0") of oForm
- which may or may not be your button.

Normally, you'd expect some "getIndexInParent" (or so) method at your
objects (buttons), but there is none (IIRC, there is some RFE requesting
this).
So, the algorithm would normally be (pidgin-Basic only)
  Function getIndexInParent( oContainer, oObject )
    For ( i = 0 to oContainer.getCount() )
      If ( oContainer.getByIndex( i ) = oObject ) Then
        getIndexInParent = i
        Exit Function
      End If
    Next i
    getIndexInParent = -1
  End Function

However, I am not sure how to test equality of UNO objects in Basic, I'd
suppose that "=" might not really work here. Perhaps there's a dedicated
function for this.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


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

Reply via email to