#include "Cursor.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
+#include "FuncStatus.h"
#include "InsetMathFont.h"
#include "InsetMathScript.h"
#include "InsetMathSymbol.h"
//LYXERR("InsetMathScript: request: " << cmd);
if (cmd.action() == LFUN_MATH_LIMITS) {
+ cur.recordUndoInset();
if (!cmd.argument().empty()) {
if (cmd.argument() == "limits")
limits_ = 1;
}
+bool InsetMathScript::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const
+{
+ if (cmd.action() == LFUN_MATH_LIMITS) {
+ if (!cmd.argument().empty()) {
+ if (cmd.argument() == "limits")
+ flag.setOnOff(limits_ == 1);
+ else if (cmd.argument() == "nolimits")
+ flag.setOnOff(limits_ == -1);
+ else
+ flag.setOnOff(limits_ == 0);
+ }
+ flag.setEnabled(true);
+ return true;
+ }
+
+ return InsetMathNest::getStatus(cur, cmd, flag);
+}
+
+
// the idea for dual scripts came from the eLyXer code
void InsetMathScript::validate(LaTeXFeatures & features) const
{
void validate(LaTeXFeatures &features) const;
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+ /// do we want to handle this event?
+ bool getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const;
private:
virtual Inset * clone() const;
/// returns x offset for main part