+2001-04-17 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * math_macrotemplate.h: inherit privately from noncopyable
+
+ * math_macro.C (Metrics): reindent, use unsigned int as loop var
+ (setArgumentIdx): change test to avoid unsigned warning
+
+ * formula.C (LocalDispatch): use LFUN_MESSAGE
+
2001-04-16 Allan Rae <rae@lyx.org>
* formula.C (Latex, getLabelList, LocalDispatch):
#include "math_cursor.h"
#include "math_parser.h"
#include "lyx_main.h"
-#include "minibuffer.h"
#include "BufferView.h"
#include "lyxtext.h"
#include "gettext.h"
#include "math_spaceinset.h"
#include "math_deliminset.h"
#include "mathed/support.h"
+#include "lyxfunc.h"
using std::ostream;
using std::istream;
case LFUN_GREEK:
if (!greek_kb_flag) {
greek_kb_flag = 1;
- bv->owner()->getMiniBuffer()->Set(_("Math greek mode on"));
+ bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek mode on"));
} else
greek_kb_flag = 0;
break;
case LFUN_GREEK_TOGGLE:
greek_kb_flag = (greek_kb_flag) ? 0 : 2;
if (greek_kb_flag)
- bv->owner()->getMiniBuffer()->Set(_("Math greek keyboard on"));
+ bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek keyboard on"));
else
- bv->owner()->getMiniBuffer()->Set(_("Math greek keyboard off"));
+ bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Math greek keyboard off"));
break;
// Math fonts
case LFUN_TEX:
// varcode = LM_TC_TEX;
mathcursor->setLastCode(LM_TC_TEX);
- bv->owner()->getMiniBuffer()->Set(_("TeX mode"));
+ bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("TeX mode"));
break;
case LFUN_MATH_NUMBER:
if (!label_.empty()) {
label_.erase();
}
- bv->owner()->getMiniBuffer()->Set(_("No number"));
+ bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("No number"));
} else {
++type;
- bv->owner()->getMiniBuffer()->Set(_("Number"));
+ bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, _("Number"));
}
par->SetType(type);
UpdateLocal(bv);
// Invalid actions under math mode
case LFUN_MATH_MODE:
if (mathcursor->getLastCode()!= LM_TC_TEXTRM) {
- bv->owner()->getMiniBuffer()->Set(_("math text mode"));
+ bv->owner()->getLyXFunc()
+ ->Dispatch(LFUN_MESSAGE, _("math text mode"));
varcode = LM_TC_TEXTRM;
} else {
varcode = LM_TC_VAR;
break;
case LFUN_UNDO:
- bv->owner()->getMiniBuffer()->Set(_("Invalid action in math mode!"));
+ bv->owner()->getLyXFunc()
+ ->Dispatch(LFUN_MESSAGE,
+ _("Invalid action in math mode!"));
break;
//------- dummy actions
- case LFUN_EXEC_COMMAND:
- bv->owner()->getMiniBuffer()->PrepareForCommand();
- break;
+#warning Is this needed here? Shouldnt the main dispatch handle this? (Lgb)
+ //case LFUN_EXEC_COMMAND:
+ //bv->owner()->getMiniBuffer()->PrepareForCommand();
+ //break;
default:
if ((action == -1 || action == LFUN_SELFINSERT)
} else if (c == '\\') {
if (was_macro)
mathcursor->MacroModeClose();
- bv->owner()->getMiniBuffer()->Set(_("TeX mode"));
+ bv->owner()->getLyXFunc()
+ ->Dispatch(LFUN_MESSAGE,
+ _("TeX mode"));
mathcursor->setLastCode(LM_TC_TEX);
}
UpdateLocal(bv);
void MathMacro::Metrics()
{
- for (int i = 0; i < args_.size(); ++i)
- tmplate_->args_[i] = getArg(i);
+ for (unsigned int i = 0; i < args_.size(); ++i)
+ tmplate_->args_[i] = getArg(i);
tmplate_->SetStyle(size());
tmplate_->Metrics();
width = tmplate_->Width();
bool MathMacro::setArgumentIdx(int i)
{
- if (i >= 0 && i < args_.size()) {
+ if (i >= 0 && 0 < (args_.size() - i)) {
idx_ = i;
return true;
} else