3 #include "math_parboxinset.h"
4 #include "math_mathmlstream.h"
5 #include "math_streamstr.h"
13 MathParboxInset::MathParboxInset()
14 : lyx_width_(0), tex_width_("0mm"), position_('c')
16 lyxerr << "constructing MathParboxInset" << endl;
20 auto_ptr<InsetBase> MathParboxInset::clone() const
22 return auto_ptr<InsetBase>(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" << endl;
40 void MathParboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
42 FontSetChanger dummy1(mi.base, "textnormal");
43 WidthChanger dummy2(mi.base, lyx_width_);
44 MathTextInset::metrics(mi, dim_);
50 void MathParboxInset::draw(PainterInfo & pi, int x, int y) const
52 FontSetChanger dummy(pi.base, "textnormal");
53 MathTextInset::draw(pi, x + 1, y);
54 drawMarkers(pi, x, y);
58 void MathParboxInset::write(WriteStream & os) const
62 os << '[' << position_ << ']';
63 os << '{' << tex_width_ << "}{" << cell(0) << '}';
67 void MathParboxInset::infoize(std::ostream & os) const
69 os << "Box: Parbox " << tex_width_;