Andre Poenitz wrote: > On Mon, Dec 16, 2002 at 06:17:03PM +0000, John Levon wrote: >> On Mon, Dec 16, 2002 at 04:46:02PM +0100, Alfredo Braunstein wrote: >> >> > opens simultanously both the reference menu and the float menu. >> >> I guess this will fix the release-critical similar bug listed on >> bugzilla too. Good stuff. >> >> > The problem is in InsetText::lfunMouseRelease(...), it checks if an >> > inset >> >> Andre needs to ack this, he was in there last. > > I don't really understand the logic there. Ideally the innermost inset > would return with "DISPATCHED" and no further action should be taken by > the outside world. > > However, I don't know how the edit call fits in that scheme, especially as > this implies a hard wired connection between right click and edit(). > > I think whatever it does should be done in the inset's localDispatch(), > but the call has been there "since ever"... > >> > Inset::localDispatch() on, say, InsetButton, making it to catch >> > LFUN_MOUSE_RELEASE and call edit() by itself? >> >> A button is not necessarily editable .... > > This could be taken care of by doing "nothing special" in the insets' > localDispatch instead of providing an empty(?) edit() function.
Something like this? Or should we overload localDispatch on every single clase inheriting from InsetButton? Inset::RESULT InsetButton::localDispatch(FuncRequest const & ev) { switch (ev.action) { case LFUN_MOUSE_RELEASE: if(editable()) { edit(ev.view(),ev.x,ev.y,ev.button()); return DISPATCHED; } else return UNDISPATCHED; default: return UNDISPATCHED; } } Regards, Alfredo