src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/xforms_helpers.C
src/gettext.h
-src/graphics/GraphicsCacheItem.C
-src/graphics/GraphicsConverter.C
src/importer.C
src/insets/insetbib.C
src/insets/inset.C
bv_->text->cursor.iy()
+ bv_->theLockingInset()->insetInInsetY()
+ y - text->cursor.row()->baseline());
- } else if (text->cursor.row()->height() < workarea_.height()) {
+ } else if (text->cursor.irow()->height() < workarea_.height()) {
screen_->draw(text, bv_, text->cursor.y() -
text->cursor.row()->baseline());
+ } else {
}
updateScrollbar();
}
inline
-void BufferView::Pimpl::moveCursorUpdate(bool selecting)
+void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
{
LyXText * lt = bv_->getLyXText();
updateInset(lt->inset_owner, false);
}
if (lt->bv_owner) {
- update(lt, BufferView::SELECT|BufferView::FITCUR);
+ if (fitcur)
+ update(lt, BufferView::SELECT|BufferView::FITCUR);
+ else
+ update(lt, BufferView::SELECT);
showCursor();
}
update(lt, BufferView::UPDATE);
cursorNext(lt);
finishUndo();
- moveCursorUpdate(false);
+ moveCursorUpdate(false, false);
owner_->showState();
}
break;
update(lt,
BufferView::SELECT|BufferView::FITCUR);
- lt->cursorUp(bv_);
+ lt->cursorUp(bv_, true);
finishUndo();
moveCursorUpdate(true);
owner_->showState();
update(lt,
BufferView::SELECT|BufferView::FITCUR);
- lt->cursorDown(bv_);
+ lt->cursorDown(bv_, true);
finishUndo();
moveCursorUpdate(true);
owner_->showState();
///
std::vector<Position> saved_positions;
///
- void moveCursorUpdate(bool selecting);
+ void moveCursorUpdate(bool selecting, bool fitcur = true);
/// Get next inset of this class from current cursor position
Inset * getInsetByCode(Inset::Code code);
///
+2002-04-17 Juergen Vigna <jug@sad.it>
+
+ * insettext.h: changed behind variables to front variables to be
+ equal to the one in the edit call (as it is for that they are used).
+
2002-04-16 Angus Leeming <a.leeming@ic.ac.uk>
* insetnote.h (ascii): overide the InsetCollapsable::ascii method to
InsetText::moveRight(BufferView * bv, bool activate_inset, bool selecting)
{
if (getLyXText(bv)->cursor.par()->isRightToLeftPar(bv->buffer()->params))
- return moveLeftIntern(bv, false, activate_inset, selecting);
+ return moveLeftIntern(bv, true, activate_inset, selecting);
else
- return moveRightIntern(bv, false, activate_inset, selecting);
+ return moveRightIntern(bv, true, activate_inset, selecting);
}
InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
{
if (getLyXText(bv)->cursor.par()->isRightToLeftPar(bv->buffer()->params))
- return moveRightIntern(bv, true, activate_inset, selecting);
+ return moveRightIntern(bv, false, activate_inset, selecting);
else
- return moveLeftIntern(bv, true, activate_inset, selecting);
+ return moveLeftIntern(bv, false, activate_inset, selecting);
}
UpdatableInset::RESULT
-InsetText::moveRightIntern(BufferView * bv, bool behind,
+InsetText::moveRightIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
if (!cpar(bv)->next() && (cpos(bv) >= cpar(bv)->size()))
return FINISHED_RIGHT;
- if (activate_inset && checkAndActivateInset(bv, behind))
+ if (activate_inset && checkAndActivateInset(bv, front))
return DISPATCHED;
getLyXText(bv)->cursorRight(bv);
if (!selecting)
UpdatableInset::RESULT
-InsetText::moveLeftIntern(BufferView * bv, bool behind,
+InsetText::moveLeftIntern(BufferView * bv, bool front,
bool activate_inset, bool selecting)
{
if (!cpar(bv)->previous() && (cpos(bv) <= 0))
getLyXText(bv)->cursorLeft(bv);
if (!selecting)
getLyXText(bv)->selection.cursor = getLyXText(bv)->cursor;
- if (activate_inset && checkAndActivateInset(bv, behind))
+ if (activate_inset && checkAndActivateInset(bv, front))
return DISPATCHED;
return DISPATCHED_NOUPDATE;
}
}
-bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
+bool InsetText::checkAndActivateInset(BufferView * bv, bool front)
{
if (cpar(bv)->isInset(cpos(bv))) {
- unsigned int x;
- unsigned int y;
Inset * inset =
static_cast<UpdatableInset*>(cpar(bv)->getInset(cpos(bv)));
if (!isHighlyEditableInset(inset))
return false;
- LyXFont const font =
- getLyXText(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv));
- if (behind) {
- x = inset->width(bv, font);
- y = font.isRightToLeft() ? 0 : inset->descent(bv, font);
- } else {
- x = 0;
- y = font.isRightToLeft() ? inset->descent(bv, font) : 0;
- }
- //inset_x = cx(bv) - top_x + drawTextXOffset;
- //inset_y = cy(bv) + drawTextYOffset;
- inset->edit(bv, x, y, 0);
+ inset->edit(bv, front);
if (!the_locking_inset)
return false;
updateLocal(bv, CURSOR, false);
bool activate_inset = true,
bool selecting = false);
///
- UpdatableInset::RESULT moveRightIntern(BufferView *, bool behind,
+ UpdatableInset::RESULT moveRightIntern(BufferView *, bool front,
bool activate_inset = true,
bool selecting = false);
///
- UpdatableInset::RESULT moveLeftIntern(BufferView *, bool behind,
+ UpdatableInset::RESULT moveLeftIntern(BufferView *, bool front,
bool activate_inset = true,
bool selecting = false);
///
void setCharFont(Buffer const *, int pos, LyXFont const & font);
///
- bool checkAndActivateInset(BufferView * bv, bool behind);
+ bool checkAndActivateInset(BufferView * bv, bool front);
///
bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
int button = 0);
moveCursorUpdate(true, false);
owner->showState();
goto exit_with_message;
- } else {
+ }
+#warning I am not sure this is still right, please have a look! (Jug 20020417)
+ else { // result == UNDISPATCHED
//setMessage(N_("Text mode"));
switch (action) {
case LFUN_UNKNOWN_ACTION:
void setCursorFromCoordinates(BufferView *, LyXCursor &,
int x, int y) const;
///
- void cursorUp(BufferView *) const;
+ void cursorUp(BufferView *, bool selecting = false) const;
///
- void cursorDown(BufferView *) const;
+ void cursorDown(BufferView *, bool selecting = false) const;
///
void cursorLeft(BufferView *, bool internal = true) const;
///
}
-void LyXText::cursorUp(BufferView * bview) const
+void LyXText::cursorUp(BufferView * bview, bool selecting) const
{
#if 1
int x = cursor.x_fix();
int y = cursor.y() - cursor.row()->baseline() - 1;
setCursorFromCoordinates(bview, x, y);
- int y1 = cursor.iy() - first_y;
- int y2 = y1;
- Inset * inset_hit = bview->checkInsetHit(const_cast<LyXText *>(this), x, y1);
- if (inset_hit && isHighlyEditableInset(inset_hit)) {
- inset_hit->edit(bview, x, y - (y2 - y1), 0);
+ if (!selecting) {
+ int y1 = cursor.iy() - first_y;
+ int y2 = y1;
+ y -= first_y;
+ Inset * inset_hit =
+ bview->checkInsetHit(const_cast<LyXText *>(this), x, y1);
+ if (inset_hit && isHighlyEditableInset(inset_hit)) {
+ inset_hit->edit(bview, x, y - (y2 - y1), 0);
+ }
}
#else
setCursorFromCoordinates(bview, cursor.x_fix(),
}
-void LyXText::cursorDown(BufferView * bview) const
+void LyXText::cursorDown(BufferView * bview, bool selecting) const
{
#if 1
int x = cursor.x_fix();
int y = cursor.y() - cursor.row()->baseline() +
cursor.row()->height() + 1;
setCursorFromCoordinates(bview, x, y);
- int y1 = cursor.iy() - first_y;
- int y2 = y1;
- Inset * inset_hit = bview->checkInsetHit(const_cast<LyXText *>(this), x, y1);
- if (inset_hit && isHighlyEditableInset(inset_hit)) {
- inset_hit->edit(bview, x, y - (y2 - y1), 0);
+ if (!selecting) {
+ int y1 = cursor.iy() - first_y;
+ int y2 = y1;
+ y -= first_y;
+ Inset * inset_hit =
+ bview->checkInsetHit(const_cast<LyXText *>(this), x, y1);
+ if (inset_hit && isHighlyEditableInset(inset_hit)) {
+ inset_hit->edit(bview, x, y - (y2 - y1), 0);
+ }
}
#else
setCursorFromCoordinates(bview, cursor.x_fix(),