Allan> This is why we need context sensitive menu support. Another dialog is
Allan> pointless for what is really a trivial action. Why click three times
Allan> (open, select, close) when a single held click on a c-s menu will do.
Because the dialog will do more than just "go to the ref"
Allan> Lars you were saying something last week about c-s menu support. Any
Allan> ideas for handling this in a simple manner? JMarc any suggestions for how
Allan> we map c-s menus in the UI menu stuff?
Lars> I'd like to have a RMB context menu popup. Wherever I click RMB the
Lars> context-sensitive-menu is called and the appropriate popup is shown.
Lars> F.ex if I RMB on the small red margin on a marginal note I get a small
Lars> popup where I can choose left or right margin etc. Similar for floats
Lars> where I could choose placement, etc.
The magic code preventing this at the moment is in workAreaButtonRelease
(line 767) :
if (button >= 2) return;
// go on to call inset->Edit();
I've just finished playing with InsetRef, the Edit() of which is:
void InsetRef::Edit(BufferView * bv, int, int, unsigned int button)
{
// Eventually trigger dialog with button 3 not 1
if( button == 3 )
bv->owner()->getLyXFunc()->
Dispatch(LFUN_REFGOTO, getContents().c_str());
else if( button == 1 )
bv->owner()->getDialogs()->showRef( this );
}
So, at the moment we get the pop-up (new --- try it!) on mouse-button 1, but
eventually we'll get the old behaviour of "go to ref on click 1" and get
"launch this new dialog on click 3"
Anyway. Patch attached. Please apply!
Angus
patch07Aug2000.tar.bz2