if (!lt->selection.mark())
beforeChange(lt);
update(lt, BufferView::SELECT|BufferView::FITCUR);
- LyXCursor const & cur = lt->cursor;
+ LyXCursor const cur = lt->cursor;
if (!is_rtl)
lt->CursorLeft(bv_, false);
if ((is_rtl || cur != lt->cursor) && // only if really moved!
+2001-06-01 Juergen Vigna <jug@sad.it>
+
+ * lyxfunc.C (Dispatch): LFUN_PREFIX don't call the update if we're
+ inside a LockingInset (is the update needed at all?).
+
+2001-05-31 Juergen Vigna <jug@sad.it>
+
+ * BufferView_pimpl.C (Dispatch): we need a new instanze of cursor
+ here not the old one otherwise how should we compare it afterwards
+ if it's the same!
+
2001-06-01 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyxfont.C:
+2001-06-01 Juergen Vigna <jug@sad.it>
+
+ * insettabular.C (resetPos): small hack so that scroll is not set to
+ 0 when we are in the last column of a tabular. This is a problem we
+ have because of constats 20 offset on both directions, so this can
+ cause on the limit an endless loop.
+
+ * insettext.C (SetFont): forgot that we can have locking insets ;)
+
+2001-05-31 Juergen Vigna <jug@sad.it>
+
+ * insettabular.C (LocalDispatch): small fix for LFUN_TAB.
+
2001-05-31 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* figinset.C: add using std:: directive for the C functions which
if (the_locking_inset == inset) {
the_locking_inset->InsetUnlock(bv);
the_locking_inset = 0;
+#warning fix scrolling when cellinset has requested a scroll (Jug)!!!
+#if 0
if (scroll(false))
scroll(bv, 0.0F);
- else
- UpdateLocal(bv, CELL, false);
+#endif
+ UpdateLocal(bv, CELL, false);
ShowInsetCursor(bv, false);
return true;
}
case LFUN_SHIFT_TAB:
case LFUN_TAB:
{
- if (GetFirstLockingInsetOfType(Inset::TABULAR_CODE))
+ if (GetFirstLockingInsetOfType(Inset::TABULAR_CODE) != this)
break;
HideInsetCursor(bv);
if (the_locking_inset) {
new_x += offset;
cursor.x(new_x);
// cursor.x(getCellXPos(actcell) + offset);
- if (scroll(false) && (tabular->GetWidthOfTabular() < bv->workWidth()-20)) {
+ if ((actcol < tabular->columns()-1) && scroll(false) &&
+ (tabular->GetWidthOfTabular() < bv->workWidth()-20))
+ {
scroll(bv, 0.0F);
UpdateLocal(bv, FULL, false);
} else if (the_locking_inset &&
- (tabular->GetWidthOfColumn(actcell) > bv->workWidth()-20)) {
+ (tabular->GetWidthOfColumn(actcell) > bv->workWidth()-20))
+ {
int xx = cursor.x() - offset + bv->text->GetRealCursorX(bv);
if (xx > (bv->workWidth()-20)) {
scroll(bv, -(xx - bv->workWidth() + 60));
((need_update&(INIT|FULL)) || (top_baseline!=baseline) ||
(last_drawn_width!=insetWidth)))
{
- int w = insetWidth;
- int h = insetAscent + insetDescent;
- int ty = baseline - insetAscent;
-
- if (ty < 0) {
- h += ty;
- ty = 0;
- }
- if ((ty + h) > pain.paperHeight())
- h = pain.paperHeight();
- if ((top_x + drawTextXOffset + w) > pain.paperWidth())
- w = pain.paperWidth();
- pain.fillRectangle(top_x+drawTextXOffset, ty, w, h);
- cleared = true;
- need_update = FULL;
+ clearInset(pain, baseline, cleared);
}
if (cleared)
frame_is_visible = false;
}
top_x = int(x);
#if 1
- cleared = true;
+ clearInset(pain, baseline, cleared);
#else
return;
#endif
void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall,
bool selectall)
{
+ if (the_locking_inset) {
+ the_locking_inset->SetFont(bv, font, toggleall, selectall);
+ return;
+ }
if (TEXT(bv)->selection.set()) {
bv->text->SetUndo(bv->buffer(), Undo::EDIT,
bv->text->cursor.par()->previous(),
TEXT(bv)->ClearSelection(bv);
}
+void InsetText::clearInset(Painter & pain, int baseline, bool & cleared) const
+{
+ int w = insetWidth;
+ int h = insetAscent + insetDescent;
+ int ty = baseline - insetAscent;
+
+ if (ty < 0) {
+ h += ty;
+ ty = 0;
+ }
+ if ((ty + h) > pain.paperHeight())
+ h = pain.paperHeight();
+ if ((top_x + drawTextXOffset + w) > pain.paperWidth())
+ w = pain.paperWidth();
+ pain.fillRectangle(top_x+drawTextXOffset, ty, w, h);
+ cleared = true;
+ need_update = FULL;
+}
/* Emacs:
* Local variables:
* tab-width: 4
void drawFrame(Painter &, bool cleared) const;
void clearFrame(Painter &, bool cleared) const;
///
+ void clearInset(Painter &, int baseline, bool & cleared) const;
/* Private structures and variables */
///
}
return string();
case LFUN_DOWN:
- TEXT()->CursorDown(owner->view());
+ if (TEXT()->cursor.row()->next())
+ TEXT()->CursorDown(owner->view());
+ else
+ TEXT()->CursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
return string();
case LFUN_PREFIX:
{
- if (owner->view()->available()) {
+ if (owner->view()->available() && !owner->view()->theLockingInset()) {
owner->view()->update(TEXT(),
BufferView::SELECT|BufferView::FITCUR);
}