]> git.lyx.org Git - features.git/commitdiff
Some more cursor/redraw problems fixe (hopefully the last ones ;)
authorJürgen Vigna <jug@sad.it>
Fri, 3 Nov 2000 15:56:33 +0000 (15:56 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 3 Nov 2000 15:56:33 +0000 (15:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1194 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/insets/insetcollapsable.C
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C

index 451234e62c964fcf6c3d92b2215269f07594c366..67d0ede67461c80fc991975be9346e9c2b2b5d92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2000-11-03  Juergen Vigna  <jug@sad.it>
+
+       * src/insets/insettabular.h: added fixed number to update codes so
+       that update is only in one direction.
+
+       * src/insets/insettabular.C (UpdateLocal): modified a bit don't think
+       it matters.
+
+       * src/insets/insettext.C (InsetButtonPress): set the_locking_inset
+       before call to edit because of redraw.
+
+       * src/insets/insetcollapsable.C (draw): fixed clearing too much.
+
 2000-11-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lib/ui/default.ui: Populate "edit_float" menu
index 2870b5d3bdfed4473dabe6d1f29ba9f987b5553a..ca8f71d31c6bb15cbbcda4fa2f195c25ebcab8ef 100644 (file)
@@ -187,6 +187,8 @@ void InsetCollapsable::draw(BufferView * bv, LyXFont const & f,
            h = pain.paperHeight();
        if ((top_x + w) > pain.paperWidth())
            w = pain.paperWidth();
+       if (baseline < 0)
+           h += (baseline - ascent(bv, f));
        pain.fillRectangle(tx, ty - 1, w, h + 2);
        cleared = true;
     }
index f4db822cf74a3fb33ab7832e8e12cd977bafe962..b16366a71eb25be82bd3d2e6effc6ad4324d4c1a 100644 (file)
@@ -444,7 +444,7 @@ void InsetTabular::Edit(BufferView * bv, int x, int y, unsigned int button)
     if (InsetHit(bv, x, y)) {
        ActivateCellInset(bv, x, y, button);
     }
-    UpdateLocal(bv, NONE, false);
+//    UpdateLocal(bv, NONE, false);
 //    bv->getOwner()->getPopups().updateFormTabular();
 }
 
@@ -474,11 +474,14 @@ void InsetTabular::InsetUnlock(BufferView * bv)
 void InsetTabular::UpdateLocal(BufferView * bv, UpdateCodes what,
                               bool mark_dirty) const
 {
-    need_update = what;
+    if (need_update < what) // only set this if it has greater update
+       need_update = what;
     // Dirty Cast! (Lgb)
-    bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty);
-    if (locked && (what != NONE))
-       resetPos(bv);
+    if (need_update != NONE) {
+       bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty);
+       if (locked) // && (what != NONE))
+           resetPos(bv);
+    }
 }
 
 
index 39ee7b6bf6127908fb9d9181f712bd5e75584aae..4a62f37108ee7d4652b70b29f3863ab7f5ae5695 100644 (file)
@@ -70,11 +70,11 @@ public:
     ///
     enum UpdateCodes {
        NONE = 0,
-       INIT,
-       FULL,
-       CELL,
-       CURSOR,
-       SELECTION
+       CURSOR = 1,
+       CELL = 2,
+       SELECTION = 3,
+       FULL = 4,
+       INIT = 5
     };
     ///
     InsetTabular(Buffer const &, int rows = 1, int columns = 1);
index 9122719fe0f8caee5def4ae4fc84dd8a18ca5fe8..6f17fbac6f35420b5b5f7de909f6c752cf5a5440 100644 (file)
@@ -608,6 +608,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
            the_locking_inset->InsetUnlock(bv);
            inset_x = cx(bv) - top_x + drawTextXOffset;
            inset_y = cy(bv) + drawTextYOffset;
+           the_locking_inset = static_cast<UpdatableInset*>(inset);
            inset->InsetButtonPress(bv, x - inset_x, y - inset_y, button);
            inset->Edit(bv, x - inset_x, y - inset_y, button);
            if (the_locking_inset) {
@@ -626,6 +627,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
            inset_y = cy(bv) + drawTextYOffset;
            inset_pos = cpos(bv);
            inset_par = cpar(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);
 //         TEXT(bv)->ClearSelection();