namespace lyx {
InsetMathRef::InsetMathRef(Buffer * buf)
- : CommandInset(buf, from_ascii("ref"), false)
+ : InsetMathCommand(buf, from_ascii("ref"), false)
{}
InsetMathRef::InsetMathRef(Buffer * buf, docstring const & data)
- : CommandInset(buf, data, false)
+ : InsetMathCommand(buf, data, false)
{}
}
case LFUN_MOUSE_RELEASE:
+ if (cur.selection()) {
+ cur.undispatched();
+ break;
+ }
if (cmd.button() == mouse_button::button3) {
LYXERR0("trying to goto ref '" << to_utf8(asString(cell(0))) << "'");
//FIXME: use DispatchResult argument
cur.undispatched();
break;
- case LFUN_MOUSE_PRESS:
- case LFUN_MOUSE_MOTION:
+ case LFUN_MOUSE_PRESS: {
+ bool do_selection = cmd.button() == mouse_button::button1
+ && cmd.modifier() == ShiftModifier;
+ // For some reason the cursor points inside the first cell, which is not
+ // active.
+ cur.leaveInset(*this);
+ cur.bv().mouseSetCursor(cur, do_selection);
+ break;
+ }
+
+ case LFUN_MOUSE_DOUBLE:
+ case LFUN_MOUSE_TRIPLE:
// eat other mouse commands
break;
default:
- CommandInset::doDispatch(cur, cmd);
+ InsetMathCommand::doDispatch(cur, cmd);
break;
}
}
case LFUN_INSET_DIALOG_UPDATE:
case LFUN_MOUSE_RELEASE:
case LFUN_MOUSE_PRESS:
- case LFUN_MOUSE_MOTION:
+ case LFUN_MOUSE_DOUBLE:
+ case LFUN_MOUSE_TRIPLE:
status.setEnabled(true);
return true;
default:
- return CommandInset::getStatus(cur, cmd, status);
+ return InsetMathCommand::getStatus(cur, cmd, status);
}
}