if (covering_inset)
return covering_inset->contextMenu(*this, x, y);
- // FIXME: Do something more elaborate here.
- return from_ascii("edit");
+ return buffer_.inset().contextMenu(*this, x, y);
}
}
+docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
+ int y) const
+{
+ if (geometry() != NoButton) {
+ Dimension dim = dimensionCollapsed();
+ if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)
+ return docstring();
+ }
+
+ return InsetText::contextMenu(bv, x, y);
+}
+
} // namespace lyx
/// Is this inset's layout defined in the document's textclass?
/// May be wrong after textclass change or paste from another document
bool undefined() const;
+ ///
+ virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
protected:
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
}
+docstring InsetRef::contextMenu(BufferView const &, int, int) const
+{
+ // FIXME: find a way to create a menu with "Goto label" inside.
+ return docstring();
+}
+
+
void InsetRef::validate(LaTeXFeatures & features) const
{
if (getCmdName() == "vref" || getCmdName() == "vpageref")
void updateLabels(ParIterator const & it);
///
void addToToc(ParConstIterator const &) const;
+ ///
+ virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
protected:
///
InsetRef(InsetRef const &);
}
+docstring InsetText::contextMenu(BufferView const &, int, int) const
+{
+ // FIXME: Do something more elaborate here.
+ return from_ascii("edit");
+}
+
+
} // namespace lyx
bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
///
void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
-
+ ///
+ virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
private: