]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.C
more cursor up/down smoothing
[lyx.git] / src / mathed / formulabase.C
index 1bfab1f6c9edf7b56806565c5c0a695a0a8ab3ae..f31a291568198f30eb4f778f52e7eae6d06f505d 100644 (file)
@@ -28,7 +28,6 @@
 #include "funcrequest.h"
 #include "BufferView.h"
 #include "lyxtext.h"
-#include "lyxfunc.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
 #include "debug.h"
@@ -174,9 +173,7 @@ void InsetFormulaBase::edit(BufferView * bv, int x, int y, mouse_button::state)
        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);
@@ -219,7 +216,7 @@ void InsetFormulaBase::getCursorPos(BufferView *, int & x, int & y) const
                return;
        }
        mathcursor->getPos(x, y);
-       //x -= xo_;
+       x -= xo_;
        y -= yo_;
        //lyxerr << "getCursorPos: " << x << " " << y << "\n";
 }
@@ -243,7 +240,7 @@ void InsetFormulaBase::showInsetCursor(BufferView * bv, bool)
        int x, y, asc, des;
        getCursorPos(bv, x, y);
        math_font_max_dim(font_, asc, des);
-       bv->showLockedInsetCursor(x, y, asc, des);
+       bv->showLockedInsetCursor(x + xo_, y, asc, des);
        setCursorVisible(true);
        //lyxerr << "showInsetCursor: " << x << " " << y << "\n";
 }
@@ -416,12 +413,6 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
 
        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:
@@ -429,6 +420,8 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
        case LFUN_DELETE_LINE_FORWARD:
        case LFUN_INSERT_LABEL:
        case LFUN_MATH_EXTERN:
+       case LFUN_TABULAR_FEATURE:
+       case LFUN_PASTESELECTION:
                bv->lockedInsetStoreUndo(Undo::EDIT);
                mathcursor->dispatch(cmd);
                updateLocal(bv, true);
@@ -533,15 +526,6 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                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();
@@ -945,7 +929,7 @@ void mathDispatchCreation(FuncRequest const & cmd, bool display)
                bv->getLyXText()->cutSelection(bv);
                openNewInset(bv, f);
        }
-       bv->owner()->getLyXFunc().setMessage(N_("Math editor mode"));
+       cmd.message(N_("Math editor mode"));
 }
 
 
@@ -971,7 +955,7 @@ void mathDispatch(FuncRequest const & cmd)
 
                case LFUN_MATH_MACRO:
                        if (cmd.argument.empty())
-                               bv->owner()->getLyXFunc().setErrorMessage(N_("Missing argument"));
+                               cmd.errorMessage(N_("Missing argument"));
                        else {
                                string s = cmd.argument;
                                string const s1 = token(s, ' ', 1);