From b25a73386fe4b4b53fefc2de2f7b0b4d9d5fd89e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 10 Mar 2003 16:23:34 +0000 Subject: [PATCH] Angus: What code should handle the mailer.show() request? git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6426 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_gridinset.C | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 8e3c61838d..846c477203 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -7,12 +7,36 @@ #include "debug.h" +#include "insets/mailinset.h" + using std::swap; using std::max; using std::min; using std::vector; +class GridInsetMailer : public MailInset { +public: + GridInsetMailer(MathGridInset & inset) : inset_(inset) {} + /// + virtual string const & name() const + { + static const string theName = "tabular"; + return theName; + } + /// + virtual string const inset2string() const + { + lyxerr << "inset2string called" << endl; + return "whatever"; //(inset_); + } + +protected: + InsetBase & inset() const { return inset_; } + MathGridInset & inset_; +}; + + void mathed_parse_normal(MathGridInset &, string const & argument); namespace { @@ -972,6 +996,25 @@ dispatch_result MathGridInset::dispatch { switch (cmd.action) { + case LFUN_MOUSE_RELEASE: { + if (cmd.button() == mouse_button::button3) { + WriteStream ws(lyxerr); + write(ws); + GridInsetMailer mailer(*this); + lyxerr << "mailer " << mailer.name() << " active\n"; + mailer.showDialog(); + return DISPATCHED; + } + break; + } + + case LFUN_INSET_DIALOG_UPDATE: { + GridInsetMailer mailer(*this); + mailer.updateDialog(); + break; + } + + // insert file functions case LFUN_DELETE_LINE_FORWARD: //autocorrect_ = false; //macroModeClose(); -- 2.39.2