]> git.lyx.org Git - features.git/commitdiff
Move handling of LFUN_MOUSE_RELEASE up to Inset and remove the edit() functions for...
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 10 Apr 2009 12:38:32 +0000 (12:38 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 10 Apr 2009 12:38:32 +0000 (12:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29184 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/Inset.cpp
src/insets/InsetCommand.cpp
src/insets/InsetCommand.h
src/insets/InsetExternal.cpp
src/insets/InsetExternal.h
src/insets/InsetGraphics.cpp
src/insets/InsetGraphics.h
src/insets/InsetSpace.cpp
src/insets/InsetSpace.h
src/insets/InsetVSpace.cpp
src/insets/InsetVSpace.h

index 91508608fbd7c25c472e26e9f1b149fbe6736e69..29984f0679253b0e0568d59d5770c989b56e9f2a 100644 (file)
@@ -220,10 +220,20 @@ void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 void Inset::doDispatch(Cursor & cur, FuncRequest &cmd)
 {
        switch (cmd.action) {
+       case LFUN_MOUSE_RELEASE:
+               // if the derived inset did not explicitly handle mouse_release,
+               // we assume we request the settings dialog
+               if (!cur.selection() && cmd.button() == mouse_button::button1) {
+                       FuncRequest tmpcmd(LFUN_INSET_SETTINGS);
+                       dispatch(cur, tmpcmd);
+               }
+               break;
+
        case LFUN_INSET_SETTINGS:
                showInsetDialog(&cur.bv());
                cur.dispatched();
                break;
+
        default:
                cur.noUpdate();
                cur.undispatched();
index d4a03317a2a0b73f4c57d2614f87c5b14fd781d7..0e6b0df0807adfc6f4c788488fe4f8fb0ebf1bb9 100644 (file)
@@ -136,12 +136,6 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_MOUSE_RELEASE: {
-               if (!cur.selection() && cmd.button() != mouse_button::button3)
-                       edit(cur, true);
-               break;
-       }
-
        default:
                Inset::doDispatch(cur, cmd);
                break;
@@ -186,12 +180,6 @@ docstring InsetCommand::contextMenu(BufferView const &, int, int) const
 }
 
 
-void InsetCommand::edit(Cursor & cur, bool, EntryDirection)
-{
-       showInsetDialog(&cur.bv());
-}
-
-
 bool InsetCommand::showInsetDialog(BufferView * bv) const
 {
        if (!mailer_name_.empty())
index 30f690f6baea833cfa8d14fbad0fc357b647e27a..a4dd7c3340616e0b7f58ffd8c9cb46b7f23eb3a8 100644 (file)
@@ -90,9 +90,6 @@ private:
        ///
        InsetCode lyxCode() const { return NO_CODE; }
        ///
-       void edit(Cursor & cur, bool front, 
-               EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
-       ///
        RenderButton & button() const { return button_; }
        ///
        bool setMouseHover(bool mouse_hover);
index 7aed200a4730a0f30490726616da8006b5335731..e53ee5598782b77b9201f2b2d298799d864f9d40 100644 (file)
@@ -414,13 +414,6 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
                        params2string(params(), cur.bv().buffer()));
                break;
 
-       case LFUN_MOUSE_RELEASE:
-               if (!cur.selection() && cmd.button() == mouse_button::button1)
-                       cur.bv().showDialog("external",
-                               params2string(params(), cur.bv().buffer()),
-                               this);
-               break;
-
        default:
                Inset::doDispatch(cur, cmd);
        }
@@ -445,12 +438,6 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetExternal::edit(Cursor & cur, bool, EntryDirection)
-{
-       showInsetDialog(&cur.bv());
-}
-
-
 bool InsetExternal::showInsetDialog(BufferView * bv) const
 {
        bv->showDialog("external", params2string(params(), bv->buffer()),
index 5572828489e6e2f27e79efc8af04913da7100775..490c6ed3c4edb4111fbf3416410d9f92bb287877 100644 (file)
@@ -138,8 +138,6 @@ private:
        ///
        void addPreview(graphics::PreviewLoader &) const;
        ///
-       void edit(Cursor & cur, bool front, EntryDirection entry_from);
-       ///
        bool showInsetDialog(BufferView * bv) const;
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
index 1b809e19604d80b12480363d204c275f574113eb..04955ab6a3f1b486974b32f3fbf6785af20eecdf 100644 (file)
@@ -215,11 +215,6 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.bv().updateDialog("graphics", params2string(params(), buffer()));
                break;
 
-       case LFUN_MOUSE_RELEASE:
-               if (!cur.selection() && cmd.button() == mouse_button::button1)
-                       cur.bv().showDialog("graphics", params2string(params(), buffer()), this);
-               break;
-
        default:
                Inset::doDispatch(cur, cmd);
                break;
@@ -244,12 +239,6 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetGraphics::edit(Cursor & cur, bool, EntryDirection)
-{
-       showInsetDialog(&cur.bv());
-}
-
-
 bool InsetGraphics::showInsetDialog(BufferView * bv) const
 {
        bv->showDialog("graphics", params2string(params(), bv->buffer()),
index 8b459a677fa876b33e9d5e77f9eb84439fb60b78..7aaff0cf835f75e216d960077eeb474bca902ca1 100644 (file)
@@ -85,8 +85,6 @@ private:
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void edit(Cursor & cur, bool front, EntryDirection entry_from);
-       ///
        bool showInsetDialog(BufferView * bv) const;
        ///
        void editGraphics(InsetGraphicsParams const &, Buffer const &) const;
index db7072f95f92affdcc2e00ae1a7f30a181757496..a12d28e1d0ce472a122835dab43d73448912facf 100644 (file)
@@ -153,11 +153,6 @@ void InsetSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.bv().updateDialog("space", params2string(params()));
                break;
 
-       case LFUN_MOUSE_RELEASE:
-               if (!cur.selection() && cmd.button() == mouse_button::button1)
-                       cur.bv().showDialog("space", params2string(params()), this);
-               break;
-
        default:
                Inset::doDispatch(cur, cmd);
                break;
@@ -187,12 +182,6 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetSpace::edit(Cursor & cur, bool, EntryDirection)
-{
-       showInsetDialog(&cur.bv());
-}
-
-
 bool InsetSpace::showInsetDialog(BufferView * bv) const
 {
        bv->showDialog("space", params2string(params()),
index d3842ddd05b43a50e2d84f928eb35accc959de10..5e1638e2129a3805e5c1e603776bfa14c19f0cef 100644 (file)
@@ -133,9 +133,6 @@ public:
        /// the string that is passed to the TOC
        void tocString(odocstream &) const;
        ///
-       void edit(Cursor & cur, bool front,
-               EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
-       ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
        InsetCode lyxCode() const { return SPACE_CODE; }
index 0042f981d1792e86e4bb95c104638a51949adfec..a0249720fa661b7338e27abc1e8a7eb4b66b4dfa 100644 (file)
@@ -66,12 +66,6 @@ void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_MOUSE_RELEASE:
-               if (!cur.selection() && cmd.button() == mouse_button::button1)
-                       cur.bv().showDialog("vspace", params2string(space()), 
-                               const_cast<InsetVSpace *>(this));
-               break;
-
        default:
                Inset::doDispatch(cur, cmd);
                break;
@@ -103,12 +97,6 @@ bool InsetVSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetVSpace::edit(Cursor & cur, bool, EntryDirection)
-{
-       showInsetDialog(&cur.bv());
-}
-
-
 bool InsetVSpace::showInsetDialog(BufferView * bv) const
 {
        bv->showDialog("vspace", params2string(space()),
index a559f13be935378871ebc1272c9f26ea50618bad..873e3c36236c8d3601b2d20e3a4fffa4b71912df 100644 (file)
@@ -32,9 +32,6 @@ public:
        ///
        InsetCode lyxCode() const { return VSPACE_CODE; }
        ///
-       void edit(Cursor & cur, bool front,
-               EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
-       ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
        docstring contextMenu(BufferView const & bv, int x, int y) const;