2 #include "math_parboxinset.h"
3 #include "math_mathmlstream.h"
4 #include "math_streamstr.h"
11 MathParboxInset::MathParboxInset()
12 : lyx_width_(0), tex_width_("0mm"), position_('c')
14 lyxerr << "constructing MathParboxInset\n";
18 MathInset * MathParboxInset::clone() const
20 return new MathParboxInset(*this);
24 void MathParboxInset::setPosition(string const & p)
26 position_ = p.size() > 0 ? p[0] : 'c';
30 void MathParboxInset::setWidth(string const & w)
33 lyx_width_ = LyXLength(w).inBP();
34 lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
38 void MathParboxInset::metrics(MathMetricsInfo & mi) const
40 MathFontSetChanger dummy1(mi.base, "textnormal");
41 MathWidthChanger dummy2(mi.base, lyx_width_);
42 MathTextInset::metrics(mi);
47 void MathParboxInset::draw(MathPainterInfo & pi, int x, int y) const
49 MathFontSetChanger dummy(pi.base, "textnormal");
50 MathTextInset::draw(pi, x + 1, y);
51 drawMarkers2(pi, x, y);
55 void MathParboxInset::write(WriteStream & os) const
59 os << '[' << position_ << ']';
60 os << '{' << tex_width_ << "}{" << cell(0) << '}';
64 void MathParboxInset::infoize(std::ostream & os) const
66 os << "Box: Parbox " << tex_width_;