Laurent Godard wrote: > i red rapidelly but is it possible to implement the reactors of objects > in Basic ?It seems to me that Paolo already asked something like this, no ? > > a way could be a generic service taking the macro name as argument and > doing a transparent relay. Would it be difficult to do ? i do not think so
We could provide a generic "DispatchObject" Service that implements the css.frame.XDispatch interface. This interface allows the UI element it is bound to to execute its bound command or query for the new interfaces created by Carsten for the new callbacks, so this generic object will also implement all these nice new interfaces just to forward to macros. For this purpose each of these callbacks ("dispatch()" being the simplest) will be transferred to a corresponding event and through an event binding interface the object allows to bind a macro to them. The tricky parts are that the macros need a defined signature for each of the callback macros and that we must be able to hand over different kinds of parameters to the macros. The first is only "not nice" (wrong macro bindings might lead to a crash), but for the second I'm not sure wether we can do this. We have to check this with Andreas Bregas. Perhaps instead of macro event bindings we could use listeners as Basic is able to implement them? But I'm not sure wether listeners implemented in Basic will "survive" the termination of the macro that registers them. But you or Paolo as Basic experts know, I assume. ;-) There still is the other way around: once a UI element gets a dispatch object it will register at it as a css.frame.XStatusEventListener and expects to receive status events. Thew new controls don't make any sense without providing proper status information. The macro code must be able to provide this information and it must be able to *update* it when needed. So each created dispatch object must be accessible somehow later to send a new status. This means: you must store the information for this somewhere, you can't store it in variables in your basic code because you shouldn't have your macro running permanently by using a busy loop. So where should the data go? You see: a lot of questions to answer. But not impossible. :-) Perhaps it would help if you ore Paolo could describe a possible use case where you would like to use the new toolbar control features in basic code. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]