Add context menus to the Toc for labels(settings), branches, graphics, citations, figures, tables.

This is now possible because we can dispatch all the necessary LFUNs to the insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29177 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-04-10 00:42:24 +00:00
parent cc11c6803c
commit 4b6a802398
2 changed files with 58 additions and 1 deletions

View File

@ -420,6 +420,52 @@ Menuset
Menu "context-toc-label"
Item "Copy Label as Reference|C" "copy-label-as-reference"
Item "Insert Reference at Cursor Position|I" "insert-label-as-reference"
Separator
Item "Settings...|S" "inset-settings"
End
#
# Toc Branches context menu
#
Menu "context-toc-branch"
Item "Activate Branch|A" "branch-activate"
Item "Deactivate Branch|e" "branch-deactivate"
Item "Settings...|S" "inset-settings"
End
#
# Toc Graphics context menu
#
Menu "context-toc-graphics"
Item "Settings...|S" "inset-settings"
Separator
Item "Edit externally...|x" "inset-edit"
End
#
# Toc Citation context menu
#
Menu "context-toc-citation"
Item "Settings...|S" "inset-settings"
End
#
# Toc Figures context menu
#
Menu "context-toc-figure"
Item "Settings...|S" "inset-settings"
End
#
# Toc Tables context menu
#
Menu "context-toc-table"
Item "Settings...|S" "inset-settings"
End
End

View File

@ -103,9 +103,20 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
DocIterator const & dit = item.dit();
Inset * inset = 0;
if (current_type_ == "label")
if (current_type_ == "label"
|| current_type_ == "graphics"
|| current_type_ == "citation")
inset = dit.nextInset();
else if (current_type_ == "branch")
inset = &dit.inset();
else if (current_type_ == "table" || current_type_ == "figure") {
DocIterator tmp_dit(dit);
tmp_dit.pop_back();
inset = &tmp_dit.inset();
}
FuncRequest tmpcmd(cmd);
if (inset)
inset->dispatch(cur, tmpcmd);