- if (action == LFUN_MATH_MACROARG) {
- int i = atoi(arg.c_str()) - 1;
- if (i >= 0 && i < tmacro->getNoArgs()) {
- mathcursor->Insert(tmacro->getMacroPar(i), LM_TC_INSET);
- InsetFormula::UpdateLocal(bv);
- }
-
- return DISPATCHED;
- }
- tmacro->setEditMode(true);
- tmacro->Metrics();
- RESULT result = InsetFormula::LocalDispatch(bv, action, arg);
- tmacro->setEditMode(false);
-
- return result;
+ // label
+ LyXFont font = p.base.font;
+ font.setColor(LColor::math);
+
+ PainterInfo pi(p.base.bv);
+ pi.base.style = LM_ST_TEXT;
+ pi.base.font = font;
+
+ int const a = y - dim_.asc + 1;
+ int const w = dim_.wid - 2;
+ int const h = dim_.height() - 2;
+
+ // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too
+ pi.pain.fillRectangle(x, a, w, h, LColor::mathmacrobg);
+ pi.pain.rectangle(x, a, w, h, LColor::mathframe);
+
+ if (mathcursor &&
+ const_cast<InsetFormulaBase const *>(mathcursor->formula()) == this)
+ mathcursor->drawSelection(pi);
+
+ pi.pain.text(x + 2, y, prefix(), font);
+
+ // formula
+ par()->draw(pi, x + font_metrics::width(prefix(), p.base.font) + 5, y);
+ xo_ = x;
+ yo_ = y;