Fix bug 3301 (selecting buttons (e.g. a citation) with the mouse opens dialog)

* insets/InsetExternal.cpp (doDispatch):
	* insets/InsetGraphics.cpp (doDispatch):
	* insets/InsetInclude.cpp (doDispatch):
	* insets/InsetCommand.cpp (doDispatch):
	* insets/InsetVSpace.cpp (doDispatch): do not open dialog if a 
	selection is set.

	* insets/InsetRef.cpp (doDispatch):
	* insets/InsetCharStyle.cpp (doDispatch): act on mouse release, not
	mouse press.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18473 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2007-05-23 10:35:57 +00:00
parent 68b3ad672d
commit e499a5428e
7 changed files with 18 additions and 18 deletions

View File

@ -239,11 +239,11 @@ void InsetCharStyle::doDispatch(Cursor & cur, FuncRequest & cmd)
setInlined();
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3)
params_.show_label = !params_.show_label;
else
InsetText::doDispatch(cur, cmd);
InsetCollapsable::doDispatch(cur, cmd);
break;
case LFUN_INSET_TOGGLE:

View File

@ -133,7 +133,7 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
}
case LFUN_MOUSE_RELEASE: {
if (!mailer_name_.empty())
if (!mailer_name_.empty() && !cur.selection())
InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
break;
}

View File

@ -450,6 +450,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
case LFUN_MOUSE_RELEASE:
if (!cur.selection())
InsetExternalMailer(*this).showDialog(&cur.bv());
break;

View File

@ -201,6 +201,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
case LFUN_MOUSE_RELEASE:
if (!cur.selection())
InsetGraphicsMailer(*this).showDialog(&cur.bv());
break;

View File

@ -161,6 +161,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
case LFUN_MOUSE_RELEASE:
if (!cur.selection())
InsetIncludeMailer(*this).showDialog(&cur.bv());
break;

View File

@ -45,21 +45,17 @@ InsetRef::InsetRef(InsetRef const & ir)
void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
{
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
case LFUN_MOUSE_RELEASE:
// Eventually trigger dialog with button 3 not 1
if (cmd.button() == mouse_button::button3)
lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
else {
InsetCommandMailer("ref", *this).showDialog(&cur.bv());
cur.undispatched();
}
return;
case LFUN_MOUSE_RELEASE:
return;
lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO,
getParam("reference")));
else
InsetCommand::doDispatch(cur, cmd);
break;
default:
return InsetCommand::doDispatch(cur, cmd);
InsetCommand::doDispatch(cur, cmd);
}
}

View File

@ -73,6 +73,7 @@ void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
}
case LFUN_MOUSE_RELEASE:
if (!cur.selection())
InsetVSpaceMailer(*this).showDialog(&cur.bv());
break;