5 #include "math_parboxinset.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
12 MathParboxInset::MathParboxInset()
13 : lyx_width_(0), tex_width_("0mm"), position_('c')
15 lyxerr << "constructing MathParboxInset\n";
19 MathInset * MathParboxInset::clone() const
21 return new MathParboxInset(*this);
25 void MathParboxInset::setPosition(string const & p)
27 position_ = p.size() > 0 ? p[0] : 'c';
31 void MathParboxInset::setWidth(string const & w)
34 lyx_width_ = LyXLength(w).inBP();
35 lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
39 void MathParboxInset::metrics(MathMetricsInfo & mi) const
41 MathFontSetChanger dummy1(mi.base, "textnormal");
42 MathWidthChanger dummy2(mi.base, lyx_width_);
43 MathTextInset::metrics(mi);
48 void MathParboxInset::draw(MathPainterInfo & pi, int x, int y) const
50 MathFontSetChanger dummy(pi.base, "textnormal");
51 MathTextInset::draw(pi, x + 1, y);
52 drawMarkers2(pi, x, y);
56 void MathParboxInset::write(WriteStream & os) const
60 os << '[' << position_ << ']';
61 os << '{' << tex_width_ << "}{" << cell(0) << '}';
65 void MathParboxInset::infoize(std::ostream & os) const
67 os << "Box: Parbox " << tex_width_;