Fix bug #6642: Concatenate the context menus for: InsetCollapsables without a button, InsetTexts which have a custom context menu and InsetTabulars. Override the default behaviour for InsetInfo.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36606 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-11-29 23:21:52 +00:00
parent c9da62fb08
commit c42a61c5ac
7 changed files with 33 additions and 3 deletions

View File

@ -622,10 +622,10 @@ docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
int y) const
{
if (decoration() == InsetLayout::CONGLOMERATE)
return contextMenuName();
return contextMenuName() + ";" + InsetText::contextMenuName();
if (geometry(bv) == NoButton)
return contextMenuName();
return contextMenuName() + ";" + InsetText::contextMenuName();
Dimension dim = dimensionCollapsed(bv);
if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)

View File

@ -452,6 +452,14 @@ void InsetInfo::updateInfo()
}
docstring InsetInfo::contextMenuName() const
{
//FIXME: We override the implementation of InsetCollapsable,
//because this inset is not a collapsable inset.
return contextMenuName();
}
docstring InsetInfo::contextMenuName() const
{
return from_ascii("context-info");

View File

@ -127,6 +127,8 @@ public:
docstring toolTip(BufferView const & bv, int x, int y) const;
///
docstring contextMenuName() const;
///
docstring contextMenuName() const;
/// should paragraph indendation be ommitted in any case?
bool neverIndent() const { return true; }

View File

@ -3329,7 +3329,14 @@ void InsetTabular::write(ostream & os) const
docstring InsetTabular::contextMenuName() const
{
// FIXME: depending on the selection state, we could offer a different menu.
// FIXME: depending on the selection state,
// we could offer a different menu.
return cell(0)->contextMenuName() + ";" + contextMenuName();
}
docstring InsetTabular::contextMenuName() const
{
return from_ascii("context-tabular");
}

View File

@ -813,6 +813,8 @@ public:
///
InsetCode lyxCode() const { return TABULAR_CODE; }
///
docstring contextMenu(BufferView const &, int, int) const;
///
docstring contextMenuName() const;
/// get offset of this cursor slice relative to our upper left corner
void cursorPos(BufferView const & bv, CursorSlice const & sl,

View File

@ -813,6 +813,15 @@ void InsetText::completionPosAndDim(Cursor const & cur, int & x, int & y,
}
docstring InsetText::contextMenuName() const
{
docstring context_menu = contextMenuName();
if (context_menu != InsetText::contextMenuName())
context_menu += ";" + InsetText::contextMenuName();
return context_menu;
}
docstring InsetText::contextMenuName() const
{
return from_ascii("context-edit");

View File

@ -195,6 +195,8 @@ public:
/// e.g., "Index: ".
docstring toolTipText(docstring prefix = empty_docstring()) const;
///
docstring contextMenu(BufferView const &, int, int) const;
///
docstring contextMenuName() const;
///