3 #include "math_macroarg.h"
4 #include "mathed/support.h"
8 MathMacroArgument::MathMacroArgument()
9 : expnd_mode_(false), number_(1)
11 SetType(LM_OT_MACRO_ARG);
15 MathMacroArgument::MathMacroArgument(int n)
16 : expnd_mode_(false), number_(n)
18 SetType(LM_OT_MACRO_ARG);
22 MathMacroArgument::~MathMacroArgument()
24 lyxerr << "help, destroyme!" << std::endl;
28 MathedInset * MathMacroArgument::Clone()
34 void MathMacroArgument::setNumber(int n)
40 void MathMacroArgument::setExpand(bool e)
46 bool MathMacroArgument::getExpand() const
52 void MathMacroArgument::draw(Painter & pain, int x, int baseline)
55 MathParInset::draw(pain, x, baseline);
58 std::ostringstream ost;
59 ost << '#' << number_;
60 drawStr(pain, LM_TC_TEX, size, x, baseline, ost.str().c_str());
64 void MathMacroArgument::Metrics()
67 MathParInset::Metrics();
69 std::ostringstream ost;
70 ost << '#' << number_;
71 width = mathed_string_width(LM_TC_TEX, size, ost.str().c_str());
72 mathed_string_height(LM_TC_TEX, size, ost.str().c_str(),
78 void MathMacroArgument::Write(ostream & os, bool fragile)
81 MathParInset::Write(os, fragile);
83 os << '#' << number_ << ' ';