#include "BufferView.h"
#include "CutAndPaste.h"
+#include "FuncStatus.h"
#include "LColor.h"
#include "LaTeXFeatures.h"
#include "cursor.h"
#include <sstream>
using lyx::cap::grabAndEraseSelection;
+using lyx::support::bformat;
using lyx::support::subst;
using std::endl;
case LFUN_MATH_MUTATE:
case LFUN_MATH_DISPLAY:
// we handle these
+ flag.enabled(true);
return true;
case LFUN_TABULAR_FEATURE: {
istringstream is(cmd.argument);
if (!rowChangeOK()
&& (s == "append-row"
|| s == "delete-row"
- || s == "copy-row"))
- return false;
- if (nrows() <= 1
- && (s == "delete-row" || s == "swap-row"))
- return false;
+ || s == "copy-row")) {
+ flag.message(bformat(
+ N_("Can't change number of rows in '%1$s'"),
+ type_));
+ flag.enabled(false);
+ return true;
+ }
if (!colChangeOK()
&& (s == "append-column"
|| s == "delete-column"
- || s == "copy-column"))
- return false;
- if (ncols() <= 1
- && (s == "delete-column" || s == "swap-column"))
- return false;
+ || s == "copy-column")) {
+ flag.message(bformat(
+ N_("Can't change number of columns in '%1$s'"),
+ type_));
+ flag.enabled(false);
+ return true;
+ }
+ if ((type_ == "simple"
+ || type_ == "equation"
+ || type_ == "none") &&
+ (s == "add-hline-above" || s == "add-hline-below")) {
+ flag.message(bformat(
+ N_("Can't add horizontal grid lines in '%1$s'"),
+ type_));
+ flag.enabled(false);
+ return true;
+ }
+ if (s == "add-vline-left" || s == "add-vline-right") {
+ flag.message(bformat(
+ N_("Can't add vertical grid lines in '%1$s'"),
+ type_));
+ flag.enabled(false);
+ return true;
+ }
return MathGridInset::getStatus(cur, cmd, flag);
}
default: