mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
remove no more needed hack for positioning the cursor with the mouse
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3890 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
539d0d1664
commit
1e9b462b6e
@ -155,22 +155,16 @@ string const InsetFormulaBase::editMessage() const
|
||||
}
|
||||
|
||||
|
||||
void InsetFormulaBase::edit(BufferView * bv, int x, int /*y*/, unsigned int)
|
||||
void InsetFormulaBase::edit(BufferView * bv, int x, int y, unsigned int
|
||||
button)
|
||||
{
|
||||
lyxerr << "edit: " << x << " " << y << " button: " << button << "\n";
|
||||
if (!bv->lockInset(this))
|
||||
lyxerr[Debug::MATHED] << "Cannot lock inset!!!" << endl;
|
||||
|
||||
//lyxerr << "edit: " << x << " " << y << " button: " << button << "\n";
|
||||
if (!mathcursor) {
|
||||
if (!mathcursor)
|
||||
mathcursor = new MathCursor(this, x == 0);
|
||||
metrics(bv);
|
||||
// handle ignored click
|
||||
if (hack_x || hack_y) {
|
||||
insetButtonPress(bv, hack_x, hack_y, hack_button);
|
||||
hack_x = hack_y = 0;
|
||||
}
|
||||
} else
|
||||
metrics(bv);
|
||||
metrics(bv);
|
||||
// if that is removed, we won't get the magenta box when entering an
|
||||
// inset for the first time
|
||||
bv->updateInset(this, false);
|
||||
@ -281,9 +275,9 @@ void InsetFormulaBase::updateLocal(BufferView * bv, bool dirty)
|
||||
bool InsetFormulaBase::insetButtonRelease(BufferView * bv,
|
||||
int /*x*/, int /*y*/, int /*button*/)
|
||||
{
|
||||
//lyxerr << "insetButtonRelease: " << x << " " << y << "\n";
|
||||
if (!mathcursor)
|
||||
return false;
|
||||
//lyxerr << "insetButtonRelease: " << x << " " << y << "\n";
|
||||
hideInsetCursor(bv);
|
||||
showInsetCursor(bv);
|
||||
bv->updateInset(this, false);
|
||||
@ -294,26 +288,21 @@ bool InsetFormulaBase::insetButtonRelease(BufferView * bv,
|
||||
void InsetFormulaBase::insetButtonPress(BufferView * bv,
|
||||
int x, int y, int button)
|
||||
{
|
||||
// hack to cope with mouseclick that comes before the call to edit()
|
||||
if (!mathcursor) {
|
||||
hack_x = x;
|
||||
hack_y = y;
|
||||
hack_button = button;
|
||||
return;
|
||||
}
|
||||
//lyxerr << "insetButtonPress: "
|
||||
// << x << " " << y << " but: " << button << "\n";
|
||||
|
||||
lyxerr << "insetButtonPress: " << x + xo_ << " " << y + yo_
|
||||
<< " but: " << button << "\n";
|
||||
switch (button) {
|
||||
default:
|
||||
case 1:
|
||||
// just click
|
||||
// left click
|
||||
if (!mathcursor) {
|
||||
mathcursor = new MathCursor(this, x == 0);
|
||||
metrics(bv);
|
||||
}
|
||||
first_x = x;
|
||||
first_y = y;
|
||||
if (mathcursor) {
|
||||
mathcursor->selClear();
|
||||
mathcursor->setPos(x + xo_, y + yo_);
|
||||
}
|
||||
mathcursor->selClear();
|
||||
mathcursor->setPos(x + xo_, y + yo_);
|
||||
break;
|
||||
/*
|
||||
case 2:
|
||||
|
@ -114,6 +114,8 @@ public:
|
||||
virtual void mutateToText();
|
||||
///
|
||||
virtual void revealCodes(BufferView *) const;
|
||||
///
|
||||
virtual Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
||||
|
||||
|
||||
private:
|
||||
|
@ -103,7 +103,7 @@ key_type wordlist_array[] =
|
||||
{"mathfrak", LM_TK_FONT, LM_TC_EUFRAK},
|
||||
{"mathit", LM_TK_FONT, LM_TC_IT},
|
||||
{"mathnormal", LM_TK_FONT, LM_TC_VAR},
|
||||
//{"mathring", LM_TK_DECORATION, 0},
|
||||
{"mathring", LM_TK_DECORATION, 0},
|
||||
{"mathrm", LM_TK_FONT, LM_TC_RM},
|
||||
{"mathsf", LM_TK_FONT, LM_TC_SF},
|
||||
{"mathtt", LM_TK_FONT, LM_TC_TT},
|
||||
|
Loading…
Reference in New Issue
Block a user