1 #include "math_parboxinset.h"
2 #include "math_mathmlstream.h"
3 #include "math_streamstr.h"
10 MathParboxInset::MathParboxInset()
11 : lyx_width_(0), tex_width_("0mm"), position_('c')
13 lyxerr << "constructing MathParboxInset\n";
17 auto_ptr<InsetBase> MathParboxInset::clone() const
19 return auto_ptr<InsetBase>(new MathParboxInset(*this));
23 void MathParboxInset::setPosition(string const & p)
25 position_ = p.size() > 0 ? p[0] : 'c';
29 void MathParboxInset::setWidth(string const & w)
32 lyx_width_ = LyXLength(w).inBP();
33 lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
37 void MathParboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
39 FontSetChanger dummy1(mi.base, "textnormal");
40 WidthChanger dummy2(mi.base, lyx_width_);
41 MathTextInset::metrics(mi, dim_);
47 void MathParboxInset::draw(PainterInfo & pi, int x, int y) const
49 FontSetChanger dummy(pi.base, "textnormal");
50 MathTextInset::draw(pi, x + 1, y);
51 drawMarkers(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_;