Martin Vermeer wrote: > On Mon, Sep 01, 2003 at 12:11:37AM +0100, John Levon spake thusly: >> >> On Sun, Aug 31, 2003 at 11:50:38PM +0300, Martin Vermeer wrote: >> >> > Ah, I think I am beginning to see. Funny cursor behaviour when >> > you're approaching the inset from below/above/left/right with the >> > cursor keys, right? >> >> I don't know off hand what effects it would have, only that there's >> a problem visible from the source. >> >> > it's LFUN_MOUSE_RELEASE that generates the .x,.y I want to use, >> > and they are OK. But along the way, it becomes an >> > LFUN_INSET_EDIT. Ah... that happens in insetcommand.C:113. Should >> > this be changed into... ehh >> > ... LFUN_INSET_ACTIVATE? >> >> No idea... > > That's a bad sign :-( > >> regards >> john > > Anybody else understand this stuff? > > My understanding is the following: > > On LFUN_MOUSE_RELEASE in a command-type inset, localDispatch for > that inset is called and drops through default: to > InsetCommand::localDispatch. There, the action is transformed from > LFUN_MOUSE_RELEASE to LFUN_INSET_EDIT and *this.localDispatch (i.e., > the insetbibtex's localDispatch) called again. With co-ordinates.
I haven't looked at this code for a while, but is this change of LFUN needed anymore? Ie, now that the insets handle the LFUNs themselves, why can't they handle LFUN_MOUSE_RELEASE and be done with it? IMO, InsetBibtex::localDispatch should just tell the mailer to show the dialog on receipt of LFUN_MOUSE_RELEASE. > As for the other occurrences, it looks to me that these occur only > in cursor navigation. Like > > FuncRequest cmd(bv, LFUN_INSET_EDIT, "left"); > > means enter the text of an editable inset on the left side. For > "button-style" insets like insetbibtex, these either are never > called (usually, see e.g. text2 where it has to be a > HighlyEditableInset) or do nothing. > > So I believe the solution proposed by me is basically sound albeit > relying on something that ought to be much more explicit. > > Calling the action that makes a dialog pop up from a button-style > inset LFUN_INSET_ACTIVATE or LFUN_INSET_DIALOG as distinct from > LFUN_INSET_EDIT (which opens an editable inset for editing its > content as the name suggests) would IMHO be a Good Thing self > documentation wise all on its own. > > Comments? Agree. IMO, InsetBibtex::localDispatch should do the same thing (tell the mailer to open the dialog) on receipt of either LFUN_MOUSE_RELEASE or LFUN_INSET_SHOW_DIALOG or whatever you choose to call this new LFUN. -- Angus