From 2eab9579719f59ddb0fd5bb0c64695124e86ab7e Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Mon, 25 Apr 2005 14:10:10 +0000 Subject: [PATCH] Fix handling of aligment; rearrange tabular-features menu stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9872 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/ui/stdmenus.ui | 30 ++++++++++++------------------ src/mathed/ChangeLog | 6 ++++++ src/mathed/math_gridinset.C | 8 ++++++++ src/mathed/math_hullinset.C | 6 ++++++ src/mathed/math_nestinset.C | 3 +++ 6 files changed, 39 insertions(+), 18 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index e1d51fbfa1..cb540528e6 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2005-04-25 Martin Vermeer + + * ui/stdmenus.ui: rearrange tabular features stuff + 2005-04-22 Angus Leeming * configure.m4: rewrite the "DeclareFOOClass" manipulation diff --git a/lib/ui/stdmenus.ui b/lib/ui/stdmenus.ui index 96bb123209..4ed8d1a622 100644 --- a/lib/ui/stdmenus.ui +++ b/lib/ui/stdmenus.ui @@ -90,6 +90,7 @@ Menuset # Mathed b0rkage means these don't work properly OptSubmenu "Table|T" "edit_tabular" OptSubmenu "Math|M" "edit_math" + OptSubmenu "Rows & Cols|C" "tabular_features" Separator OptItem "Increase List Depth|I" "depth-increment" OptItem "Decrease List Depth|D" "depth-decrement" @@ -117,12 +118,6 @@ Menuset # not much we can do to help here Menu "edit_tabular" - Item "Add Row|A" "tabular-feature append-row" - Item "Delete Row|w" "tabular-feature delete-row" - Separator - Item "Add Column|u" "tabular-feature append-column" - Item "Delete Column|D" "tabular-feature delete-column" - Separator Item "Multicolumn|M" "tabular-feature multicolumn" Separator Item "Top Line|T" "tabular-feature toggle-line-top" @@ -130,10 +125,9 @@ Menuset Item "Left Line|L" "tabular-feature toggle-line-left" Item "Right Line|R" "tabular-feature toggle-line-right" Separator - Submenu "Alignment|i" "edit_align" End - Menu "edit_align" + Menu "tabular_features" Item "Left|L" "tabular-feature align-left" Item "Center|C" "tabular-feature align-center" Item "Right|R" "tabular-feature align-right" @@ -141,6 +135,16 @@ Menuset 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" "tabular-feature append-row" + Item "Delete Row" "tabular-feature delete-row" + Item "Copy Row" "tabular-feature copy-row" + Item "Swap Rows" "tabular-feature swap-row" + Separator + Item "Add Column" "tabular-feature append-column" + Item "Delete Column" "tabular-feature delete-column" + Item "Copy Column" "tabular-feature copy-column" + Item "Swap Columns" "tabular-feature swap-column" End Menu "edit_math" @@ -152,21 +156,11 @@ Menuset Separator Submenu "Use Computer Algebra System|S" "edit_math_extern" Separator - Submenu "Alignment|A" "edit_align" - Separator - Item "Add Row|R" "tabular-feature append-row" - Item "Delete Row|D" "tabular-feature delete-row" - Item "Copy Row" "tabular-feature copy-row" - Item "Swap Rows" "tabular-feature swap-row" Item "Add Line Above" "tabular-feature add-hline-above" Item "Add Line Below" "tabular-feature add-hline-below" Item "Delete Line Above" "tabular-feature delete-hline-above" Item "Delete Line Below" "tabular-feature delete-hline-below" Separator - Item "Add Column|C" "tabular-feature append-column" - Item "Delete Column|e" "tabular-feature delete-column" - Item "Copy Column" "tabular-feature copy-column" - Item "Swap Columns" "tabular-feature swap-column" Item "Add Line to Left" "tabular-feature add-vline-left" Item "Add Line to Right" "tabular-feature add-vline-right" Item "Delete Line to Left" "tabular-feature delete-vline-left" diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 392192b582..f04d32e78a 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,9 @@ +2005-04-25 Martin Vermeer a + + * math_gridinset.C (doDispatch): + * math_hullInset.C (doDispatch): + * math_nestInset.C (doDispatch): fix handling of alignment + 2005-04-11 Martin Vermeer * math_nestinset.C (doDispatch): make insert-around-selection diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 955477ae7d..0234dfd51e 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -1292,6 +1292,14 @@ bool MathGridInset::getStatus(LCursor & cur, FuncRequest const & cmd, flag.message(bformat( N_("Unknown tabular feature '%1$s'"), s)); } + + flag.setOnOff(s == "align-left" && halign(cur.col()) == 'l' + || s == "align-right" && halign(cur.col()) == 'r' + || s == "align-center" && halign(cur.col()) == 'c' + || s == "valign-top" && valign() == 't' + || s == "valign-bottom" && valign() == 'b' + || s == "valign-middle" && valign() == 'm'); + #if 0 // FIXME: What did this code do? // Please check wether it is still needed! diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 092b15decd..823108dcb9 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -1139,6 +1139,12 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd, flag.enabled(false); return true; } + if (s == "valign-top" || s == "valign-middle" + || s == "valign-bottom" || s == "align-left" + || s == "align-center" || s == "align-right") { + flag.enabled(false); + return true; + } return MathGridInset::getStatus(cur, cmd, flag); } default: diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index fb6e2a04b9..1cf026cf3e 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -866,6 +866,9 @@ bool MathNestInset::getStatus(LCursor & /*cur*/, FuncRequest const & cmd, //string tc = "mathnormal"; bool ret = true; switch (cmd.action) { + case LFUN_TABULAR_FEATURE: + flag.enabled(false); + break; #if 0 case LFUN_TABULAR_FEATURE: // FIXME: check temporarily disabled