]> git.lyx.org Git - features.git/commitdiff
Make lyx compile with xforms 0.88 again + small fix in insettabular.
authorJürgen Vigna <jug@sad.it>
Tue, 31 Oct 2000 13:53:26 +0000 (13:53 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 31 Oct 2000 13:53:26 +0000 (13:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1177 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/WorkArea.C
src/insets/insettabular.C
src/insets/insettext.C

index 3fc52d6669dee12cb90083fccf4d23eb99f6ef9a..b8824d1898dd3b7199250f540d0fc497644cf14b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-10-31  Juergen Vigna  <jug@sad.it>
+
+       * src/WorkArea.C (work_area_handler): honor xforms 0.88 defines.
+
+       * src/insets/insettabular.C (ActivateCellInset): passed the wrong
+       xposition to the Edit call.
+
 2000-10-31  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/trans.C (AddDeadkey): cast explicitly to char.
index f30c09489b5fd79f17ec66f332b2dc776d78885f..0821f000f48e4698d0fa2f264f7aad4bc127a10a 100644 (file)
@@ -309,7 +309,11 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
                                      ev->xbutton.y - ob->y,
                                      ev->xbutton.button);
                break;
+#if FL_REVISION < 89
+       case FL_MOUSE:
+#else
        case FL_DRAG:
+#endif
                if (!ev || ! area->scrollbar) break;
                if (ev->xmotion.x != x_old ||
                    ev->xmotion.y != y_old ||
@@ -321,7 +325,11 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
                                             ev->xbutton.state);
                }
                break;
+#if FL_REVISION < 89
+       case FL_KEYBOARD:
+#else
        case FL_KEYPRESS:
+#endif
        {
                lyxerr[Debug::KEY] << "Workarea event: KEYBOARD" << endl;
                
@@ -408,10 +416,13 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
                area->workAreaKeyPress(ret_key, ret_state);
        }
        break;
+
+#if FL_REVISION >= 89
        case FL_KEYRELEASE:
                lyxerr << "Workarea event: KEYRELEASE" << endl;
                break;
-               
+#endif
+
        case FL_FOCUS:
                lyxerr[Debug::GUI] << "Workarea event: FOCUS" << endl;
                area->workAreaFocus();
index e328e51b513e856df53bbad7979962e71b5e60be..aef7875ac230544abcc9a289d61d747ed6a747ba 100644 (file)
@@ -1056,7 +1056,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
     int lx = tabular->GetWidthOfColumn(actcell) -
        tabular->GetAdditionalWidth(actcell);
 #warning Jürgen, can you rewrite this to _not_ use the sequencing operator. (Lgb)
-#if 1
+#if 0
     for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
        ++actcell,lx += tabular->GetWidthOfColumn(actcell) +
            tabular->GetAdditionalWidth(actcell - 1));
@@ -1588,7 +1588,7 @@ bool InsetTabular::ActivateCellInset(BufferView * bv, int x, int y, int button,
     }
     inset_x = cursor.x() - top_x + tabular->GetBeginningOfTextInCell(actcell);
     inset_y = cursor.y();
-    inset->Edit(bv, x, y - inset_y, button);
+    inset->Edit(bv, x - inset_x, y - inset_y, button);
     if (!the_locking_inset)
        return false;
     UpdateLocal(bv, CELL, false);
index a114219575ec1536498bd74ea838833c0bbda7ae..a3c784e1649f0b71292601c85c6aead6d4dd6bf4 100644 (file)
@@ -628,6 +628,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
            inset_par = cpar(bv);
            uinset->InsetButtonPress(bv, x - inset_x, y - inset_y, button);
            uinset->Edit(bv, x - inset_x, y - inset_y, 0);
+           TEXT(bv)->ClearSelection();
            if (the_locking_inset) {
                UpdateLocal(bv, CURSOR_PAR, false);
            }
@@ -1269,11 +1270,12 @@ bool InsetText::InsertInset(BufferView * bv, Inset * inset)
     inset->setOwner(this);
     HideInsetCursor(bv);
     TEXT(bv)->InsertInset(bv, inset);
+    if ((cpar(bv)->GetChar(cpos(bv)) != LyXParagraph::META_INSET) ||
+       (cpar(bv)->GetInset(cpos(bv)) != inset))
+       TEXT(bv)->CursorLeft(bv);
     TEXT(bv)->selection = 0;
-    TEXT(bv)->CursorLeft(bv);
     bv->fitCursor(TEXT(bv));
     UpdateLocal(bv, CURSOR_PAR, true);
-//    inset->Edit(bv, 0, 0, 0);
     ShowInsetCursor(bv);
     return true;
 }