]> git.lyx.org Git - features.git/commitdiff
Alfredo's patches
authorJohn Levon <levon@movementarian.org>
Tue, 1 Apr 2003 19:22:14 +0000 (19:22 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 1 Apr 2003 19:22:14 +0000 (19:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6675 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetbutton.C
src/insets/insetbutton.h
src/insets/insetcommand.C
src/insets/insettext.C

index 7421f70424e44c884592e872d1d184613fb4f103..42453bd643e0c6b085fd0de727e827bd61588472 100644 (file)
@@ -1,3 +1,14 @@
+2003-04-01  John Levon  <levon@movementarian.org>
+
+       From Alfredo Braunstein
+
+       * insetbutton.h:        
+       * insetbutton.C: add localDispatch()
+
+       * insetcommand.C: return DISPATCHED when edit() called
+
+       * insettext.C: fix bug 967
+
 2003-04-01  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * insettext.C: adjust
index 53ea6738142499dbaf65642d0ecb4aa797712c6f..9fa257d2e11f8a9e00ffb23a3c090e6b9e45d392 100644 (file)
@@ -16,6 +16,7 @@
 #include "insetbutton.h"
 #include "debug.h"
 #include "BufferView.h"
+#include "funcrequest.h"
 #include "frontends/LyXView.h"
 #include "frontends/Painter.h"
 #include "support/LAssert.h"
@@ -127,3 +128,11 @@ BufferView * InsetButton::view() const
 {
        return view_.lock().get();
 }
+
+
+dispatch_result InsetButton::localDispatch(FuncRequest const & cmd)
+{
+       FuncRequest cmd1(cmd);
+       edit(cmd1.view(), cmd1.x, cmd1.y, cmd1.button());
+       return DISPATCHED;
+}
index b0a6edbe0d0b06ef8542bd3f0b4d2228c252fd3f..a27485a17abf4491662a07595e1630f3712d2b37 100644 (file)
@@ -31,6 +31,8 @@ public:
        int width(BufferView *, LyXFont const &) const;
        ///
        void draw(BufferView *, LyXFont const &, int, float &) const;
+       ///
+       dispatch_result localDispatch(FuncRequest const & cmd);
 
 protected:
        ///
index dd2ae21cc49b19dd84af1a06c965dd2e71d2cea8..974f2569835ab9779c4a1ffc4be42999798d779f 100644 (file)
@@ -90,6 +90,7 @@ dispatch_result InsetCommand::localDispatch(FuncRequest const & cmd)
 
        case LFUN_MOUSE_RELEASE:
                edit(cmd.view(), cmd.x, cmd.y, cmd.button());
+               result = DISPATCHED;
                break;
 
        default:
index e76d3cb9b0f7490a815e8e87cbea8af5b258fc64..c94ac1666b04bc57b185c803d6e563978c45a77a 100644 (file)
@@ -1014,6 +1014,12 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd)
        Inset * inset = getLyXText(bv)->checkInsetHit(tmp_x, tmp_y);
        bool ret = false;
        if (inset) {
+// This code should probably be removed now. Simple insets
+// (!highlyEditable) can actually take the localDispatch,
+// and turn it into edit() if necessary. But we still
+// need to deal properly with the whole relative vs.
+// absolute mouse co-ords thing in a realiable, sensible way
+#if 0
                if (isHighlyEditableInset(inset))
                        ret = inset->localDispatch(cmd1);
                else {
@@ -1021,12 +1027,13 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd)
                        inset_y = ciy(bv) + drawTextYOffset;
                        cmd1.x = cmd.x - inset_x;
                        cmd1.y = cmd.x - inset_y;
-// note that we should do ret = inset->localDispatch(cmd1)
-// and fix this instead (Alfredo);
-                       ret = true;
                        inset->edit(bv, cmd1.x, cmd1.y, cmd.button());
+                       ret = true;
                }
+#endif
+               ret = inset->localDispatch(cmd1);
                updateLocal(bv, CURSOR_PAR, false);
+
        }
        return ret;
 }