7 #include "math_macroarg.h"
8 #include "mathed/support.h"
12 MathMacroArgument::MathMacroArgument()
13 : expnd_mode_(false), number_(1)
15 SetType(LM_OT_MACRO_ARG);
19 MathMacroArgument::MathMacroArgument(int n)
20 : expnd_mode_(false), number_(n)
22 SetType(LM_OT_MACRO_ARG);
26 MathedInset * MathMacroArgument::Clone()
32 void MathMacroArgument::setExpand(bool e)
38 bool MathMacroArgument::getExpand() const
44 void MathMacroArgument::draw(Painter & pain, int x, int baseline)
47 MathParInset::draw(pain, x, baseline);
49 std::ostringstream ost;
50 ost << '#' << number_;
51 drawStr(pain, LM_TC_TEX, size(), x, baseline, ost.str().c_str());
55 void MathMacroArgument::Metrics()
58 MathParInset::Metrics();
60 std::ostringstream ost;
61 ost << '#' << number_;
62 width = mathed_string_width(LM_TC_TEX, size(), ost.str().c_str());
63 mathed_string_height(LM_TC_TEX, size(), ost.str().c_str(),
69 void MathMacroArgument::Write(ostream & os, bool fragile)
72 MathParInset::Write(os, fragile);
74 os << '#' << number_ << ' ';