diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index eb1361239d..1ae825376c 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -217,4 +217,37 @@ Menuset Item "Edit externally...|x" "graphics-edit" End +# +# InsetTabular context menu +# + + Menu "context-tabular" + Item "Multicolumn|M" "tabular-feature multicolumn" + Separator + Item "Top Line|T" "tabular-feature toggle-line-top" + Item "Bottom Line|B" "tabular-feature toggle-line-bottom" + Item "Left Line|L" "tabular-feature toggle-line-left" + Item "Right Line|R" "tabular-feature toggle-line-right" + Separator + Item "Left|L" "tabular-feature align-left" + Item "Center|C" "tabular-feature align-center" + Item "Right|R" "tabular-feature align-right" + Separator + Item "Top|T" "tabular-feature valign-top" + Item "Middle|M" "tabular-feature valign-middle" + Item "Bottom|B" "tabular-feature valign-bottom" + Separator + Item "Add Row|A" "tabular-feature append-row" + Item "Delete Row|D" "tabular-feature delete-row" + Item "Copy Row|o" "tabular-feature copy-row" + # Item "Swap Rows|S" "tabular-feature swap-row" # currently broken + Separator + Item "Add Column|u" "tabular-feature append-column" + Item "Delete Column|e" "tabular-feature delete-column" + Item "Copy Column|p" "tabular-feature copy-column" + # Item "Swap Columns|w" "tabular-feature swap-column" # currently broken + Separator + Item "Settings...|S" "inset-settings listings" + End + End diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 5ac32bc6f4..5b07135ec2 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -2806,6 +2806,13 @@ void InsetTabular::write(ostream & os) const } +docstring InsetTabular::contextMenu(BufferView const &, int, int) const +{ + // FIXME: depending on the selection state, we could offer a different menu. + return from_ascii("context-tabular"); +} + + void InsetTabular::read(Lexer & lex) { bool const old_format = (lex.getString() == "\\LyXTable"); diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 390fc2ab07..d05c20065a 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -737,6 +737,8 @@ public: void validate(LaTeXFeatures & features) const; /// InsetCode lyxCode() const { return TABULAR_CODE; } + /// + docstring contextMenu(BufferView const & bv, int x, int y) const; /// get offset of this cursor slice relative to our upper left corner void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const;