6 #include "math_parboxinset.h"
7 #include "math_mathmlstream.h"
8 #include "math_streamstr.h"
13 MathParboxInset::MathParboxInset()
14 : lyx_width_(0), tex_width_("0mm"), position_('c')
16 lyxerr << "constructing MathParboxInset\n";
20 MathInset * MathParboxInset::clone() const
22 return new MathParboxInset(*this);
26 void MathParboxInset::setPosition(string const & p)
28 position_ = p.size() > 0 ? p[0] : 'c';
32 void MathParboxInset::setWidth(string const & w)
35 lyx_width_ = LyXLength(w).inBP();
36 lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
40 void MathParboxInset::metrics(MathMetricsInfo & mi) const
42 MathFontSetChanger dummy1(mi.base, "textnormal");
43 MathWidthChanger dummy2(mi.base, lyx_width_);
44 MathTextInset::metrics(mi);
49 void MathParboxInset::draw(MathPainterInfo & pi, int x, int y) const
51 MathFontSetChanger dummy(pi.base, "textnormal");
52 MathTextInset::draw(pi, x + 1, y);
53 drawMarkers2(pi, x, y);
57 void MathParboxInset::write(WriteStream & os) const
61 os << '[' << position_ << ']';
62 os << '{' << tex_width_ << "}{" << cell(0) << '}';
66 void MathParboxInset::infoize(std::ostream & os) const
68 os << "Box: Parbox " << tex_width_;