From: Abdelrazak Younes Date: Fri, 28 Mar 2008 18:50:33 +0000 (+0000) Subject: Add tabular context menu. Feel free to enhance/modify Edwin. X-Git-Tag: 1.6.10~5378 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=53daaabef4bea8c71f1d5d5976b65bf782c7aad4;p=features.git Add tabular context menu. Feel free to enhance/modify Edwin. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24018 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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;