]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parboxinset.C
remove noload/don't typeset
[lyx.git] / src / mathed / math_parboxinset.C
1
2 #include "math_parboxinset.h"
3 #include "math_mathmlstream.h"
4 #include "math_streamstr.h"
5 #include "lyxlength.h"
6 #include "debug.h"
7
8 using std::vector;
9
10
11 MathParboxInset::MathParboxInset()
12         : lyx_width_(0), tex_width_("0mm"), position_('c')
13 {
14         lyxerr << "constructing MathParboxInset\n";
15 }
16
17
18 MathInset * MathParboxInset::clone() const
19 {
20         return new MathParboxInset(*this);
21 }
22
23
24 void MathParboxInset::setPosition(string const & p)
25 {
26         position_ = p.size() > 0 ? p[0] : 'c';
27 }
28
29
30 void MathParboxInset::setWidth(string const & w)
31 {
32         tex_width_ = w;
33         lyx_width_ = LyXLength(w).inBP();
34         lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
35 }
36
37
38 void MathParboxInset::metrics(MathMetricsInfo & mi) const
39 {
40         MathFontSetChanger dummy1(mi.base, "textnormal");
41         MathWidthChanger dummy2(mi.base, lyx_width_);
42         MathTextInset::metrics(mi);
43         metricsMarkers2();
44 }
45
46
47 void MathParboxInset::draw(MathPainterInfo & pi, int x, int y) const
48 {
49         MathFontSetChanger dummy(pi.base, "textnormal");
50         MathTextInset::draw(pi, x + 1, y);
51         drawMarkers2(pi, x, y);
52 }
53
54
55 void MathParboxInset::write(WriteStream & os) const
56 {
57         os << "\\parbox";
58         if (position_ != 'c')
59                 os << '[' << position_ << ']';
60         os << '{' << tex_width_ << "}{" << cell(0) << '}';
61 }
62
63
64 void MathParboxInset::infoize(std::ostream & os) const
65 {
66         os << "Box: Parbox " << tex_width_;
67 }
68