- PainterInfo pi2(pi.base.bv, pi.pain);
- pi2.base.font.setColor(macro_ ? Color_latex : Color_error);
- //pi2.base.style = LM_ST_TEXT;
- pi2.pain.text(x, y, from_ascii("\\"), pi2.base.font);
- x += mathed_string_width(pi2.base.font, from_ascii("\\")) + 1;
- cell(0).draw(pi2, x, y);
- drawMarkers(pi2, expx, expy);
+ FontSetChanger dummy(pi.base, "lyxtex");
+ pi.pain.text(x, y, from_ascii("\\"), pi.base.font);
+ x += mathed_string_width(pi.base.font, from_ascii("\\")) + 1;
+ cell(0).draw(pi, x, y);
+ drawMarkers(pi, expx, expy);
+ } else if (lyxrc.macro_edit_style == LyXRC::MACRO_EDIT_LIST
+ && editing_[pi.base.bv]) {
+ // Macro will be edited in a old-style list mode here:
+
+ CoordCache const & coords = pi.base.bv->coordCache();
+ FontInfo const & labelFont = sane_font;
+
+ // markers and box needs two pixels
+ x += 2;
+
+ // get maximal font height
+ Dimension fontDim;
+ math_font_max_dim(pi.base.font, fontDim.asc, fontDim.des);
+
+ // draw label
+ docstring label = from_ascii("Macro \\") + name() + from_ascii(": ");
+ pi.pain.text(x, y, label, labelFont);
+ x += mathed_string_width(labelFont, label);
+
+ // draw definition
+ definition_.draw(pi, x, y);
+ Dimension const & defDim = coords.getArrays().dim(&definition_);
+ y += max(fontDim.des, defDim.des);
+
+ // draw parameters
+ docstring str = from_ascii("#9");
+ int strw1 = mathed_string_width(labelFont, from_ascii("#9"));
+ int strw2 = mathed_string_width(labelFont, from_ascii(": "));
+
+ for (idx_type i = 0; i < nargs(); ++i) {
+ // position of label
+ Dimension const & cdim = coords.getArrays().dim(&cell(i));
+ x = expx + 2;
+ y += max(fontDim.asc, cdim.asc) + 1;
+
+ // draw label
+ str[1] = '1' + i;
+ pi.pain.text(x, y, str, labelFont);
+ x += strw1;
+ pi.pain.text(x, y, from_ascii(":"), labelFont);
+ x += strw2;
+
+ // draw paramter
+ cell(i).draw(pi, x, y);
+
+ // next line
+ y += max(fontDim.des, cdim.des);
+ }
+
+ pi.pain.rectangle(expx + 1, expy - dim.asc + 1, dim.wid - 3,
+ dim.height() - 2, Color_mathmacroframe);
+ drawMarkers2(pi, expx, expy);