releaseMathCursor(bv);
mathcursor = new MathCursor(this, true);
metrics(bv);
- mathcursor->setPos(x, y);
- //lyxerr << "setting pos to " << x << "," << y << "\n";
-
+ mathcursor->setPos(x + xo_, y + yo_);
// if that is removed, we won't get the magenta box when entering an
// inset for the first time
bv->updateInset(this, false);
return;
}
mathcursor->getPos(x, y);
- //x -= xo_;
+ x = mathcursor->targetX();
+ x -= xo_;
y -= yo_;
//lyxerr << "getCursorPos: " << x << " " << y << "\n";
}
return;
fitInsetCursor(bv);
int x, y, asc, des;
- getCursorPos(bv, x, y);
+ mathcursor->getPos(x, y);
math_font_max_dim(font_, asc, des);
- bv->showLockedInsetCursor(x, y, asc, des);
+ bv->showLockedInsetCursor(x, y - yo_, asc, des);
setCursorVisible(true);
//lyxerr << "showInsetCursor: " << x << " " << y << "\n";
}
return lfunMouseMotion(cmd);
case LFUN_MOUSE_RELEASE:
return lfunMouseRelease(cmd);
+ case LFUN_MOUSE_DOUBLE:
+ //lyxerr << "Mouse double\n";
+ return localDispatch(FuncRequest(LFUN_WORDSEL));
default:
break;
}
case LFUN_MATH_MUTATE:
case LFUN_MATH_DISPLAY:
- case LFUN_MATH_HALIGN:
- case LFUN_MATH_VALIGN:
- case LFUN_MATH_ROW_INSERT:
- case LFUN_MATH_ROW_DELETE:
- case LFUN_MATH_COLUMN_INSERT:
- case LFUN_MATH_COLUMN_DELETE:
case LFUN_MATH_NUMBER:
case LFUN_MATH_NONUMBER:
case LFUN_TABINSERT:
case LFUN_DELETE_LINE_FORWARD:
case LFUN_INSERT_LABEL:
case LFUN_MATH_EXTERN:
+ case LFUN_TABULAR_FEATURE:
+ case LFUN_PASTESELECTION:
+ case LFUN_MATH_LIMITS:
bv->lockedInsetStoreUndo(Undo::EDIT);
mathcursor->dispatch(cmd);
updateLocal(bv, true);
break;
- case LFUN_WORDRIGHTSEL:
case LFUN_RIGHTSEL:
sel = true; // fall through...
case LFUN_RIGHT:
//bv->owner()->message(mathcursor->info());
break;
- case LFUN_WORDLEFTSEL:
case LFUN_LEFTSEL:
sel = true; // fall through
case LFUN_LEFT:
updateLocal(bv, false);
break;
+ case LFUN_WORDSEL:
+ mathcursor->home(false);
+ mathcursor->end(true);
+ updateLocal(bv, false);
+ break;
+
case LFUN_HOMESEL:
+ case LFUN_WORDLEFTSEL:
sel = true; // fall through
case LFUN_HOME:
+ case LFUN_WORDLEFT:
result = mathcursor->home(sel) ? DISPATCHED : FINISHED;
updateLocal(bv, false);
break;
case LFUN_ENDSEL:
+ case LFUN_WORDRIGHTSEL:
sel = true; // fall through
case LFUN_END:
+ case LFUN_WORDRIGHT:
result = mathcursor->end(sel) ? DISPATCHED : FINISHED_RIGHT;
updateLocal(bv, false);
break;
case LFUN_PRIORSEL:
case LFUN_PRIOR:
+ case LFUN_BEGINNINGBUFSEL:
+ case LFUN_BEGINNINGBUF:
result = FINISHED_UP;
updateLocal(bv, false);
break;
case LFUN_NEXTSEL:
case LFUN_NEXT:
+ case LFUN_ENDBUFSEL:
+ case LFUN_ENDBUF:
result = FINISHED_DOWN;
updateLocal(bv, false);
break;
break;
}
-/*
- case LFUN_PASTESELECTION: {
- string const clip = bv->getClipboard();
- if (!clip.empty())
- mathed_parse_normal(par_, clip);
- break;
- }
-*/
-
case LFUN_PASTE:
if (was_macro)
mathcursor->macroModeClose();
case LFUN_FRAK: handleFont(bv, cmd.argument, "mathfrak"); break;
case LFUN_ITAL: handleFont(bv, cmd.argument, "mathit"); break;
case LFUN_NOUN: handleFont(bv, cmd.argument, "mathbb"); break;
- case LFUN_DEFAULT: handleFont(bv, cmd.argument, "textnormal"); break;
case LFUN_FREE: handleFont(bv, cmd.argument, "textrm"); break;
+ case LFUN_DEFAULT: handleFont(bv, cmd.argument, "textnormal"); break;
case LFUN_GREEK:
handleFont(bv, cmd.argument, "lyxgreek1");
//bv->owner()->message(_("math text mode toggled"));
break;
- case LFUN_MATH_LIMITS:
- bv->lockedInsetStoreUndo(Undo::EDIT);
- if (mathcursor->toggleLimits())
- updateLocal(bv, true);
- break;
-
case LFUN_MATH_SIZE:
#if 0
if (!arg.empty()) {