1
0
mirror of https://git.lyx.org/repos/lyx.git synced 2025-01-12 19:38:18 +00:00

(Andr��): partial fix for mouse handling in math insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9686 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2005-02-28 11:32:58 +00:00
parent 2849fbae2a
commit e1928a2109
2 changed files with 15 additions and 23 deletions

View File

@ -1,3 +1,9 @@
2005-02-28 André Pönitz <poenitz@lyx.org>
* math_nestinset.C (lfunMouseRelease, lfunMouseMotion, lfunMousePress):
remove ancient hack and get mouse actions inside nested mathed insets
working again.
2005-02-23 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* math_parinset.[Ch] (doClone): Implement, avoids triggering the

View File

@ -63,18 +63,6 @@ using std::string;
using std::istringstream;
namespace {
// local global
int first_x;
int first_y;
} // namespace anon
MathNestInset::MathNestInset(idx_type nargs)
: cells_(nargs), lock_(false)
{}
@ -956,11 +944,9 @@ InsetBase * MathNestInset::editXY(LCursor & cur, int x, int y) const
void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd)
{
lyxerr << "lfunMousePress: buttons: " << cmd.button() << endl;
//lyxerr << "## lfunMousePress: buttons: " << cmd.button() << endl;
if (cmd.button() == mouse_button::button1) {
first_x = cmd.x;
first_y = cmd.y;
lyxerr << "lfunMousePress: setting cursor to: " << cur << endl;
//lyxerr << "## lfunMousePress: setting cursor to: " << cur << endl;
cur.resetAnchor();
cur.bv().cursor() = cur;
}
@ -976,22 +962,22 @@ void MathNestInset::lfunMouseMotion(LCursor & cur, FuncRequest & cmd)
// only select with button 1
if (cmd.button() == mouse_button::button1) {
LCursor & bvcur = cur.bv().cursor();
if (abs(cmd.x - first_x) + abs(cmd.y - first_y) > 4
&& bvcur.anchor_.hasPart(cur)) {
first_x = cmd.x;
first_y = cmd.y;
if (bvcur.anchor_.hasPart(cur)) {
//lyxerr << "## lfunMouseMotion: cursor: " << cur << endl;
bvcur.setCursor(cur);
bvcur.selection() = true;
} else
//lyxerr << "MOTION " << bvcur << endl;
}
else {
cur.undispatched();
}
}
}
void MathNestInset::lfunMouseRelease(LCursor & cur, FuncRequest & cmd)
{
lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
//lyxerr << "## lfunMouseRelease: buttons: " << cmd.button() << endl;
if (cmd.button() == mouse_button::button1) {
//cur.bv().stuffClipboard(cur.grabSelection());