Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Nov 04, 2003 at 12:27:14PM +0100, Lars Gullik Bjønnes wrote: >> Andre Poenitz <[EMAIL PROTECTED]> writes: >> >> | No, jsut inset->dispatch() and finally bv->text->dispatch. >> >> right... (sorry: misread.) >> >> should it do even that? > | Sure. > >> That would probably be ok... but I am not quite sure. > | How else would you handle editing the main text? > >> Anyway what I have decided/realized is that no dispatch function >> should call another dispatch function that is farther "out". > | I could interpret this sentence in a way that I agree with it. But I am | not sure you mean it. > | [My interpretation would be you mean 'further out' on the LyXView <-> | BufferView <-> LyX Canvas scale, not on the Main Text <-> Inset <-> | Inset scale] > | Suppose we have an inset A that generally responds to, say, mouse clicks | and a second inset, B, that does the same, and in there a third inset C | which does not respond to mouse clicks. > | Suppose a user clicks on C. What should happen?
depends really... I guess that in most cases B should react. A::dispatch [neston] -> B::dispatch [neston] -> C::dispatch [unhandled] <- B::dispatch [handled] | [ ] nothing | [ ] B reacts | [ ] A reacts We need to traverse down through dispatch functions until we reach the inset that received the click. if not handle we back-track until we find one that does. This means in the cased of nested insets, it is the outer of these that first reveives the click and this insets dispatch must realize that it has a nested inset at the same coord. >> And if at all possible I want the "top" dispatch to be the entry point >> for all dispatch handling. (and if at all possible this "top" dispatch >> should be the only one to _ever_ call update.) > | Fine with me. Currently the canvas related part of this top dispatch is | LCursor::dispatch, which can be merged with the View's dispatch if the | thing is ripe. What do you mean by merge here? If the only change is that you get one huge function that better leave them as two distinct functions. -- Lgb