First - thanks again. So forgive me for being a little dense on this.

Matthias Benkmann wrote:
On 1/2/06, Andrew Jensen <[EMAIL PROTECTED]> wrote:
  
Matthias,

Thanks for the suggestion. However, I had read that section. The way I took this
was that it is equivilant to assigning a procedure to a given event using
Tools>Configure>Events and selecting OpenOffice.org. Am I wrong on this?
    

GlobalEventBroadcaster supports 2 interfaces: XEventsSupplier and
XEventBroadcaster. I'm talking about the XEventBroadcaster interface
which is not the same as Tools->Configure->Events.
  
OK, I will go over that in more detail. On page 478 in the Dev.Guide 5-2005 it says;
"All event bindings can be seen or set in the OpenOffice.org UI in the Tools-Configure dialog on
Events page."
I did not realize it was limiting this just to one of the interfaces.
  
Also the documentation states:

"The event source in the notifications is NULL (empty)."
    

I don't know where this particular quote comes from but I know for a
fact that if you register an event handler via XEventBroadcaster you
will get a proper event source.

  
On page 478 in DevGuide again. I may have missed the context on this however, it is just below as
section talking about the events OnStartApp and OnCloseApp, maybe this is limited to only this case.
I am guessing however that it may have more to do with the 2 seperate interfaces you mentioned
earlier. Because if you assign any of these events to a procedure that takes a parameter it generates an
error 'Wrong number of parameters", assign to a procedure with no parameters and it is happy.

  
This is my problem, what I don't understand is how
once in my event handler is called what am I checking
to see if it supprots the interfcae XOfficeDatabaseDocument?
    

In Java you use UnoRuntime.queryInterface().

  
Thanks

  
As I state in the first email if the event is a Base document opening then
 thisComponent is null,
    

ThisComponent is only useful for macros stored in documents.
  
OK
  
StarDesktop.CurrentComponent
and StarDesktip.CurrentController don't seem to help.
    

They refer to the foreground document which is not necessarily the
event source, so it is usually just as unhelpful as ThisComponent as
far as events are concerned.
  
Actually, in the case of all document types other then Base they are very useful. The macro (basic procedure) assigned to the event is
not called until the frame is already on the desktop - so I could have used  thisComponent, StarDeskTop.CurrentComponet  or
StarDesktop.CurrentController.Frame for my purposes. It is only when it is an ODB file being loaded that the frame has not been
displayed on the desktop before the call to the assigned procedure.
To do things properly you have to use the XEventBroadcaster interface
to register a real event handler. I don't know how to do this from
StarBasic or if it it is even possible.

Matthias
  

Bottom line is, I have a lot to learn abou this tool and appreciate your help
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  

Reply via email to