]> git.lyx.org Git - features.git/commitdiff
Add tabular context menu. Feel free to enhance/modify Edwin.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 28 Mar 2008 18:50:33 +0000 (18:50 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 28 Mar 2008 18:50:33 +0000 (18:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24018 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ui/stdcontext.inc
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h

index eb1361239d28577e14af6223778a5d9425c8a757..1ae825376cf4546f59ce3bcfb5f7bcfc143783ad 100644 (file)
@@ -217,4 +217,37 @@ Menuset
                Item "Edit externally...|x" "graphics-edit"
        End
 
+#
+# InsetTabular context menu
+#
+
+       Menu "context-tabular"
+               Item "Multicolumn|M" "tabular-feature multicolumn"\r
+               Separator\r
+               Item "Top Line|T" "tabular-feature toggle-line-top"\r
+               Item "Bottom Line|B" "tabular-feature toggle-line-bottom"\r
+               Item "Left Line|L" "tabular-feature toggle-line-left"\r
+               Item "Right Line|R" "tabular-feature toggle-line-right"\r
+               Separator\r
+               Item "Left|L" "tabular-feature align-left"\r
+               Item "Center|C" "tabular-feature align-center"\r
+               Item "Right|R" "tabular-feature align-right"\r
+               Separator\r
+               Item "Top|T" "tabular-feature valign-top"\r
+               Item "Middle|M" "tabular-feature valign-middle"\r
+               Item "Bottom|B" "tabular-feature valign-bottom"\r
+               Separator\r
+               Item "Add Row|A" "tabular-feature append-row"\r
+               Item "Delete Row|D" "tabular-feature delete-row"\r
+               Item "Copy Row|o" "tabular-feature copy-row"\r
+               # Item "Swap Rows|S" "tabular-feature swap-row" # currently broken\r
+               Separator\r
+               Item "Add Column|u" "tabular-feature append-column"\r
+               Item "Delete Column|e" "tabular-feature delete-column"\r
+               Item "Copy Column|p" "tabular-feature copy-column"\r
+               # Item "Swap Columns|w" "tabular-feature swap-column" # currently broken\r
+               Separator
+               Item "Settings...|S" "inset-settings listings"
+       End
+
 End
index 5ac32bc6f40526ed8e009a1b7fa7675a0278b5d5..5b07135ec2dd8fe13f532f896cbf01ebef9350a3 100644 (file)
@@ -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");
index 390fc2ab0768e09ce12ee04fe142741e71de48cc..d05c20065a8e42eed821505be4cd2c8cf72f5a14 100644 (file)
@@ -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;