Jean-Marc Lasgouttes schreef:
Vincent van Ravesteijn <v.f.vanraveste...@tudelft.nl> writes:
Vincent van Ravesteijn schreef:
I mean, if you look for one thing or two to implement ;-)
What's the second ?
"Insert Cross-Reference at Cursor position" ;-) Abdel.
Done.

Vincent
This is a patch that will add two functions to the context menu of
Labels (and erroneously still also References) in the Outline.

I hope you like my solution(s).

Any comments on the design are welcome.

I like the feature, but we have to make sure that it fits well in the
rest. I think I'd prefer a solution where GUITOC::doDipatch would call
LyXFunc::dispatch.
I think there is a little confusion here. The GuiToc::doDispatch function should maybe be called GuiToc::dispatch. It is only used to forward the dispatch from GuiView to the tocwidget, just as you describe later. So, no dispatch is 'generated' in GuiToc.
 Then this will call Application::dispatch (or
View::dispatch, I am not sure which one holds the tocwidget)
This call is made by the context menu itself, so everything starts here. The call is received in GuiView::dispatch, which holds the GuiToc, which holds the tocwidget.
  which will
notice that the ficus is on the widget and call the doDispatch of the
widget.
I don't know how to know which widget the focus has. That's why I introduces the outliner-context command 'modifier'.
I agree that this looks more complicated, but I think that always using
the same path is in the end a gain. I agree that, with your patch, there
is no problem, because modifications are done through the dispatch
mechanism, but what I highlighted above (if not prohibitively
complicated) would make me happy :)
I believe the implementation is just like the way you propose..
JMarc
Vincent

Reply via email to