On Wed, 2005-02-09 at 21:25, Martin Vermeer wrote: > On Wed, 2005-02-09 at 09:00 +0100, Georg Baum wrote: > > Martin Vermeer wrote: > > ... > > I checked in the basic patch, as it is very straightforward. We'll have > to think about getStatus.
... Try the attached on for size :-) - Martin
Index: lib/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v retrieving revision 1.672 diff -u -r1.672 ChangeLog --- lib/ChangeLog 9 Feb 2005 18:56:00 -0000 1.672 +++ lib/ChangeLog 10 Feb 2005 07:44:58 -0000 @@ -1,3 +1,7 @@ +2005-02-10 Martin Vermeer <[EMAIL PROTECTED]> + + * bind/math.bind: provide key bindings for lines in matrix + 2005-02-09 Martin Vermeer <[EMAIL PROTECTED]> * ui/stdmenus.ui: add facilities for drawing/deleting partition Index: src/mathed/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v retrieving revision 1.470 diff -u -r1.470 ChangeLog --- src/mathed/ChangeLog 9 Feb 2005 18:56:00 -0000 1.470 +++ src/mathed/ChangeLog 10 Feb 2005 07:44:58 -0000 @@ -1,4 +1,7 @@ -<<<<<<< ChangeLog +2005-02-10 Martin Vermeer <[EMAIL PROTECTED]> + + * math_gridinset.C: implement getStatus for tabular-features. + 2005-02-09 Martin Vermeer <[EMAIL PROTECTED]> * math_gridinset.[hC]: add facilities for drawing/deleting partition Index: src/mathed/math_gridinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.C,v retrieving revision 1.155 diff -u -r1.155 math_gridinset.C --- src/mathed/math_gridinset.C 9 Feb 2005 18:56:00 -0000 1.155 +++ src/mathed/math_gridinset.C 10 Feb 2005 07:44:58 -0000 @@ -22,6 +22,7 @@ #include "cursor.h" #include "debug.h" #include "funcrequest.h" +#include "gettext.h" #include "undo.h" #include "frontends/Painter.h" @@ -1223,25 +1224,37 @@ { bool ret = true; switch (cmd.action) { - case LFUN_TABULAR_FEATURE: -#if 0 - // should be more precise - if (v_align_ == '\0') { - flag.enable(true); - break; + case LFUN_TABULAR_FEATURE: { + istringstream is(cmd.argument); + string s; + is >> s; + if (nrows() <= 1 + && (s == "delete-row" || s == "swap-row")) { + flag.message(N_("Only one row")); + flag.enabled(false); + return true; } - if (cmd.argument.empty()) { - flag.enable(false); - break; + if (ncols() <= 1 + && (s == "delete-column" || s == "swap-column")) { + flag.message(N_("Only one column")); + flag.enabled(false); + return true; } - if (!contains("tcb", cmd.argument[0])) { - flag.enable(false); - break; + if (colinfo_[col(cur.idx())].lines_ == 0 + && (s == "delete-vline-left")) { + flag.message(N_("No vline to delete")); + flag.enabled(false); + return true; } - flag.setOnOff(cmd.argument[0] == v_align_); -#endif + if (rowinfo_[cur.row()].lines_ == 0 + && (s == "delete-hline-above")) { + flag.message(N_("No hline to delete")); + flag.enabled(false); + return true; + } flag.enabled(true); - break; + return true; + } default: ret = MathNestInset::getStatus(cur, cmd, flag); break; Index: lib/bind/math.bind =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/bind/math.bind,v retrieving revision 1.25 diff -u -r1.25 math.bind --- lib/bind/math.bind 19 May 2004 16:27:43 -0000 1.25 +++ lib/bind/math.bind 10 Feb 2005 07:44:58 -0000 @@ -77,11 +77,15 @@ \bind "M-m c d" "tabular-feature delete-column" \bind "M-m c c" "tabular-feature copy-column" \bind "M-m c s" "tabular-feature swap-column" +\bind "M-m c v" "tabular-feature add-vline-left" +\bind "M-m c k" "tabular-feature delete-vline-left" \bind "M-m w i" "tabular-feature append-row" \bind "M-m w d" "tabular-feature delete-row" \bind "M-m w c" "tabular-feature copy-row" \bind "M-m w s" "tabular-feature swap-row" +\bind "M-m w h" "tabular-feature add-hline-above" +\bind "M-m w k" "tabular-feature delete-hline-above" \bind "M-m w t" "tabular-feature valign-top" \bind "M-m w m" "tabular-feature valign-middle"
signature.asc
Description: This is a digitally signed message part