On Tuesday 04 March 2003 12:54 pm, Andre Poenitz wrote: > The innermost level that knows to handle an event should handle it. Ideally > there should not be (much|any) magical guessing who is responsible. > > The hierarchy should be something like > > LyXFunc > > BufferView > > Buffer > > OutermostText [And this should go if everything is an inset] > > Insets > > and we should walk it bottom-up. Currently we have some strange combination > of guessing jumps down (the_locking_inset and some hard coded 'let's the > inset handle it) and a few steps up... > > Some jumps probably can't be avoided, though. > > Pressing apply could invoke an lfun "LFUN_DIALOG_APPLY" which is handled > only in the Bufferview (or whatever entity knows which inset is "open"). > The bv catches this event and issues another "LFUN_DIRECT_APPLY" event > to the proper inset.
Nice idea actually. Only BufferView handles LFUN_INSET_APPLY. If an inset is open then it calls inset->localDispatch(FuncRequest(bv_, LFUN_INSET_MODIFY, ev.argument)); else it creates a new inset at the current cursor pos. I can do this now... It'll cure my problem with LyXFunc::dispatch and will be ready for the next generation code too. Thanks André. Angus