Add virtual bool Inset::clickable(..) to be used to change the cursor.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35804 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-10-24 20:11:40 +00:00
parent 72569c42ba
commit 72a93582b0
8 changed files with 21 additions and 1 deletions

View 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; }

View 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;

View 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;
///

View 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;

View 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 &);

View 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:
///

View 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); }

View 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;