add status messages to math hull inset

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9312 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2004-11-26 13:56:22 +00:00
parent d23bb9eaa8
commit 9a45f8922c
2 changed files with 30 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2004-11-26 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* math_hullinset.C (getStatus): add status messages
2004-11-24 Lars Gullik Bjønnes <larsbj@gullik.net>
* Most insets: rename priv_dispatch to doDispatch

View File

@ -20,6 +20,7 @@
#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
#include "LColor.h"
#include "LaTeXFeatures.h"
#include "cursor.h"
@ -48,6 +49,7 @@
#include <sstream>
using lyx::cap::grabAndEraseSelection;
using lyx::support::bformat;
using lyx::support::subst;
using std::endl;
@ -1102,19 +1104,35 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd,
if (!rowChangeOK()
&& (s == "append-row"
|| s == "delete-row"
|| s == "copy-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 (nrows() <= 1
&& (s == "delete-row" || s == "swap-row"))
return false;
&& (s == "delete-row" || s == "swap-row")) {
flag.message(N_("Only one row"));
flag.enabled(false);
return true;
}
if (!colChangeOK()
&& (s == "append-column"
|| s == "delete-column"
|| s == "copy-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 (ncols() <= 1
&& (s == "delete-column" || s == "swap-column"))
return false;
&& (s == "delete-column" || s == "swap-column")) {
flag.message(N_("Only one column"));
flag.enabled(false);
return true;
}
return MathGridInset::getStatus(cur, cmd, flag);
}
default: