]> git.lyx.org Git - features.git/commitdiff
Add virtual bool Inset::clickable(..) to be used to change the cursor.
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 24 Oct 2010 20:11:40 +0000 (20:11 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 24 Oct 2010 20:11:40 +0000 (20:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35804 a592a061-630c-0410-9148-cb99ea01b6c8

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

index baf58bf773d55d0b0bfc3475f348c2a2d8a260ea..d4a15940a376a635f1c10a1a3dfb19b973a89f1d 100644 (file)
@@ -335,6 +335,8 @@ public:
        /// FIXME: merge with editable()
        // true for InsetTabular & InsetText
        virtual bool isActive() const { return nargs() > 0; }
+       /// can we click at the specified position ?
+       virtual bool clickable(int x, int y) const { return false; }
 
        /// does this contain text that can be change track marked in DVI?
        virtual bool canTrackChanges() const { return false; }
index 48ae8a8df02eb11de1fed717e3b966d4952c9b52..b57b74b341fb0a7e2e5a261044a8a931b0df62c6 100644 (file)
@@ -411,6 +411,13 @@ bool InsetCollapsable::hitButton(FuncRequest const & cmd) const
 }
 
 
+bool InsetCollapsable::clickable(int x, int y) const
+{
+       FuncRequest cmd(LFUN_NOACTION, x, y, mouse_button::none);
+       return hitButton(cmd);
+}
+
+
 docstring const InsetCollapsable::getNewLabel(docstring const & l) const
 {
        docstring label;
index 5a317bdba76609465e0cc52c0e2f2de0f37ac9f6..e712fba0b3775b6bc674bdce00a66c1329c6d6a8 100644 (file)
@@ -68,6 +68,8 @@ public:
        bool editable() const;
        ///
        bool hasSettings() const { return true; }
+       ///
+       bool clickable(int x, int y) const;
        /// can we go further down on mouse click?
        bool descendable(BufferView const & bv) const;
        ///
index 990ac2abd2e54bea1e6fe76068a536118496df55..8e6ab7afae4508cf6363bd4fed96e04223e357f9 100644 (file)
@@ -99,6 +99,8 @@ private:
        ///
        InsetCode lyxCode() const { return NO_CODE; }
        ///
+       bool clickable(int x, int y) const { return hasSettings(); }
+       ///
        RenderButton & button() const { return button_; }
        ///
        bool setMouseHover(BufferView const * bv, bool mouse_hover) const;
index d5a2bc8febe882df11972afab27fc00d8d0af323..26890c217b606fdec5c65fda7e616a3e4c822348 100644 (file)
@@ -115,7 +115,8 @@ public:
        docstring contextMenu(BufferView const & bv, int x, int y) const;
        ///
        bool setMouseHover(BufferView const * bv, bool mouse_hover);
-
+       ///
+       bool clickable(int x, int y) const { return true; }
 private:
        ///
        InsetExternal(InsetExternal const &);
index b65f53c9952515b60f1d053972cc007e7422c5c0..ce02d14eb997faedab210e86f1d7514efe8beee3 100644 (file)
@@ -51,6 +51,8 @@ public:
        bool setParams(InsetGraphicsParams const & params);
 
        InsetGraphicsParams getParams() const { return params_;}
+       ///
+       bool clickable(int x, int y) const { return true; }
 
 private:
        ///
index d2d5d421df574c48ac9311a60f4fcd3b2240a68a..4519d90e563ee284d6f2356ee650c028e4032e26 100644 (file)
@@ -147,6 +147,8 @@ public:
        bool isSpace() const { return true; }
        ///
        docstring contextMenu(BufferView const & bv, int x, int y) const;
+       ///
+       bool clickable(int x, int y) const { return true; }
 protected:
        ///
        Inset * clone() const { return new InsetSpace(*this); }
index 2cac05ed718b49d5a9bb3cb536beeffef958a6cb..a4d6a9d3788c0dc3fcc08d859ee329bf8ed0be8d 100644 (file)
@@ -37,6 +37,8 @@ public:
        static void string2params(std::string const &, VSpace &);
        ///
        static std::string params2string(VSpace const &);
+       ///
+       bool clickable(int x, int y) const { return true; }
 private:
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;