Fix insetButtonPress in InsetText the same way as in Bufferview_pimpl.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3892 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2002-04-03 13:59:04 +00:00
parent fb94708472
commit c04225fdf1
3 changed files with 16 additions and 10 deletions

View File

@ -651,6 +651,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
inset->insetButtonPress(bv_, xpos, ypos, button); inset->insetButtonPress(bv_, xpos, ypos, button);
return; return;
} }
// I'm not sure we should continue here if we hit an inset (Jug20020403)
// Right click on a footnote flag opens float menu // Right click on a footnote flag opens float menu
if (button == 3) { if (button == 3) {

View File

@ -1,3 +1,8 @@
2002-04-03 Juergen Vigna <jug@sad.it>
* insettext.C (insetButtonPress): fix insetButtonPress events the same
way as in Bufferview_pimpl.
2002-04-03 Allan Rae <rae@lyx.org> 2002-04-03 Allan Rae <rae@lyx.org>
* insetgraphics.C (latex): one % too many makes living on the bleeding * insetgraphics.C (latex): one % too many makes living on the bleeding

View File

@ -937,7 +937,9 @@ void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
y - inset_y, y - inset_y,
button); button);
return; return;
} else if (inset) { }
#if 0
else if (inset) {
// otherwise unlock the_locking_inset and lock the new inset // otherwise unlock the_locking_inset and lock the new inset
the_locking_inset->insetUnlock(bv); the_locking_inset->insetUnlock(bv);
inset_x = cx(bv) - top_x + drawTextXOffset; inset_x = cx(bv) - top_x + drawTextXOffset;
@ -950,6 +952,7 @@ void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
updateLocal(bv, CURSOR, false); updateLocal(bv, CURSOR, false);
return; return;
} }
#endif
// otherwise only unlock the_locking_inset // otherwise only unlock the_locking_inset
the_locking_inset->insetUnlock(bv); the_locking_inset->insetUnlock(bv);
the_locking_inset = 0; the_locking_inset = 0;
@ -959,16 +962,13 @@ void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
if (bv->theLockingInset()) { if (bv->theLockingInset()) {
if (isHighlyEditableInset(inset)) { if (isHighlyEditableInset(inset)) {
// We just have to lock the inset before calling a
// PressEvent on it!
UpdatableInset * uinset = static_cast<UpdatableInset*>(inset); UpdatableInset * uinset = static_cast<UpdatableInset*>(inset);
inset_x = cx(bv) - top_x + drawTextXOffset; if (!bv->lockInset(uinset)) {
inset_y = cy(bv) + drawTextYOffset; lyxerr[Debug::INSETS] << "Cannot lock inset" << endl;
inset_pos = cpos(bv); }
inset_par = cpar(bv); inset->insetButtonPress(bv, x - inset_x, y - inset_y, button);
inset_boundary = cboundary(bv);
the_locking_inset = uinset;
uinset->insetButtonPress(bv, x - inset_x, y - inset_y,
button);
uinset->edit(bv, x - inset_x, y - inset_y, 0);
if (the_locking_inset) if (the_locking_inset)
updateLocal(bv, CURSOR, false); updateLocal(bv, CURSOR, false);
return; return;