// try to dispatch to enclosed insets first
if (mathcursor->dispatch(cmd) == UNDISPATCHED) {
// launch math panel for right mouse button
+ lyxerr << "lfunMouseRelease: undispatched: " << cmd.button() << endl;
bv->owner()->getDialogs().showMathPanel();
}
return DISPATCHED;
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
+ //lyxerr << "Mouse single press\n";
return lfunMousePress(cmd);
case LFUN_MOUSE_MOTION:
- return lfunMouseMotion(cmd);
+ //return lfunMouseMotion(cmd);
case LFUN_MOUSE_RELEASE:
+ lyxerr << "Mouse single release\n";
return lfunMouseRelease(cmd);
case LFUN_MOUSE_DOUBLE:
//lyxerr << "Mouse double\n";
dispatch_result MathCursor::dispatch(FuncRequest const & cmd)
{
+ // mouse clicks are somewhat special
+ // check
+ switch (cmd.action) {
+ case LFUN_MOUSE_PRESS:
+ case LFUN_MOUSE_MOTION:
+ case LFUN_MOUSE_RELEASE:
+ case LFUN_MOUSE_DOUBLE: {
+ MathCursorPos & pos = Cursor_.back();
+ dispatch_result res = UNDISPATCHED;
+ int x = 0, y = 0;
+ getPos(x, y);
+ if (x < cmd.x && hasPrevAtom()) {
+ res = prevAtom().nucleus()->dispatch(cmd, pos.idx_, pos.pos_);
+ if (res != UNDISPATCHED)
+ return res;
+ }
+ if (x > cmd.x && hasNextAtom()) {
+ res = nextAtom().nucleus()->dispatch(cmd, pos.idx_, pos.pos_);
+ if (res != UNDISPATCHED)
+ return res;
+ }
+ }
+ default:
+ break;
+ }
+
for (int i = Cursor_.size() - 1; i >= 0; --i) {
MathCursorPos & pos = Cursor_[i];
dispatch_result res = pos.par_->dispatch(cmd, pos.idx_, pos.pos_);
RefInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
{
switch (cmd.action) {
+ lyxerr << "dispatching " << cmd.argument << "\n";
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3) {
lyxerr << "trying to goto ref" << cell(0) << "\n";