+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
#include "insetbutton.h"
#include "debug.h"
#include "BufferView.h"
+#include "funcrequest.h"
#include "frontends/LyXView.h"
#include "frontends/Painter.h"
#include "support/LAssert.h"
{
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;
+}
int width(BufferView *, LyXFont const &) const;
///
void draw(BufferView *, LyXFont const &, int, float &) const;
+ ///
+ dispatch_result localDispatch(FuncRequest const & cmd);
protected:
///
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 {
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;
}