2 #include "math_parboxinset.h"
3 #include "math_mathmlstream.h"
4 #include "math_streamstr.h"
9 MathParboxInset::MathParboxInset()
10 : lyx_width_(0), tex_width_("0mm"), position_('c')
12 lyxerr << "constructing MathParboxInset\n";
16 MathInset * MathParboxInset::clone() const
18 return new MathParboxInset(*this);
22 void MathParboxInset::setPosition(string const & p)
24 position_ = p.size() > 0 ? p[0] : 'c';
28 void MathParboxInset::setWidth(string const & w)
31 lyx_width_ = LyXLength(w).inBP();
32 lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
36 void MathParboxInset::metrics(MetricsInfo & mi) const
38 FontSetChanger dummy1(mi.base, "textnormal");
39 WidthChanger dummy2(mi.base, lyx_width_);
40 MathTextInset::metrics(mi);
45 void MathParboxInset::draw(PainterInfo & pi, int x, int y) const
47 FontSetChanger dummy(pi.base, "textnormal");
48 MathTextInset::draw(pi, x + 1, y);
49 drawMarkers2(pi, x, y);
53 void MathParboxInset::write(WriteStream & os) const
57 os << '[' << position_ << ']';
58 os << '{' << tex_width_ << "}{" << cell(0) << '}';
62 void MathParboxInset::infoize(std::ostream & os) const
64 os << "Box: Parbox " << tex_width_;