paste_internally = true;
}
+ int const screen_first = bv_->text->first_y;
+
if (bv_->theLockingInset()) {
// We are in inset locking mode
selection_possible = true;
screen_->hideCursor();
- int const screen_first = bv_->text->first_y;
-
// Clear the selection
screen_->toggleSelection(bv_->text, bv_);
bv_->text->clearSelection();
selection_possible = false;
owner_->updateLayoutChoice();
owner_->message(inset->editMessage());
- // IMO the inset has to be first in edit-mode and then we send the
- // button press. (Jug 20020222)
- inset->edit(bv_); //, xpos, ypos, button);
+ //inset->edit(bv_, xpos, ypos, button);
+ // We just have to lock the inset before calling a PressEvent on it!
+ // we don't need the edit() call here! (Jug20020329)
+ if (!bv_->lockInset(inset)) {
+ lyxerr[Debug::INSETS] << "Cannot lock inset" << endl;
+ }
inset->insetButtonPress(bv_, xpos, ypos, button);
return;
}
inset->insetButtonRelease(bv_, x, y, button);
} else {
inset_hit->insetButtonRelease(bv_, x, y, button);
+ // IMO this is a grosshack! Inset's should be changed so that
+ // they call the actions they have to do with the insetButtonRel.
+ // function and not in the edit(). This should be changed
+ // (Jug 20020329)
inset_hit->edit(bv_, x, y, button);
}
return;
+2002-03-29 Juergen Vigna <jug@sad.it>
+
+ * BufferView_pimpl.C (workAreaButtonPress): just lock the inset don't
+ call the edit() as it is not needed (and wrong) IMO.
+ (workAreaButtonPress): set the screen_first variable before evt.
+ unlock the inset as this may change screen_first and then we have
+ a wrong y position for the click!
+
2002-03-28 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* MenuBackend.C (expand): another translation that I missed
+2002-03-29 Juergen Vigna <jug@sad.it>
+
+ * insettext.C (insetButtonPress): change behaviour of no_selection
+ to the one in the BufferView selection_possible and fix the spurious
+ selection bug with it.
+
2002-03-28 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* insetfloatlist.C (getScreenLabel): translate the GUI label.
insetDescent = 0;
insetWidth = 0;
old_max_width = 0;
- no_selection = false;
+ no_selection = true;
need_update = FULL;
drawTextXOffset = 0;
drawTextYOffset = 0;
the_locking_inset = 0;
}
hideInsetCursor(bv);
- no_selection = false;
+ no_selection = true;
locked = false;
int code;
if (drawFrame_ == LOCKED)
void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
{
- no_selection = true;
+ no_selection = false;
// use this to check mouse motion for selection!
mouse_x = x;
x - inset_x,
y - inset_y,
button);
- no_selection = false;
return;
} else if (inset) {
// otherwise unlock the_locking_inset and lock the new inset
// inset->edit(bv, x - inset_x, y - inset_y, button);
if (the_locking_inset)
updateLocal(bv, CURSOR, false);
- no_selection = false;
return;
}
// otherwise only unlock the_locking_inset
the_locking_inset->insetUnlock(bv);
the_locking_inset = 0;
}
+ if (inset)
+ no_selection = true;
+
if (bv->theLockingInset()) {
if (isHighlyEditableInset(inset)) {
UpdatableInset * uinset = static_cast<UpdatableInset*>(inset);
uinset->edit(bv, x - inset_x, y - inset_y, 0);
if (the_locking_inset)
updateLocal(bv, CURSOR, false);
- no_selection = false;
return;
}
}
lt = getLyXText(bv);
clear = true;
}
+ int old_first_y = lt->first_y;
lt->setCursorFromCoordinates(bv, x - drawTextXOffset,
y + insetAscent);
updateLocal(bv, CURSOR, false);
}
bv->owner()->setLayout(cpar(bv)->layout());
+ // we moved the view we cannot do mouse selection in this case!
+ if (getLyXText(bv)->first_y != old_first_y)
+ no_selection = true;
old_par = cpar(bv);
// Insert primary selection with middle mouse
// if there is a local selection in the current buffer,
getLyXText(bv)->clearSelection();
}
showInsetCursor(bv);
- no_selection = false;
}
bool InsetText::insetButtonRelease(BufferView * bv, int x, int y, int button)
{
+ no_selection = true;
if (the_locking_inset) {
return the_locking_inset->insetButtonRelease(bv,
x - inset_x, y - inset_y,