]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fboxinset.C
enable insertion of spaces in all \textxxx modes.
[lyx.git] / src / mathed / math_fboxinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_fboxinset.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "frontends/Painter.h"
11
12
13
14 MathFboxInset::MathFboxInset()
15         : MathNestInset(1)
16 {}
17
18
19 MathInset * MathFboxInset::clone() const
20 {
21         return new MathFboxInset(*this);
22 }
23
24
25 void MathFboxInset::metrics(MathMetricsInfo & mi) const
26 {
27         MathFontSetChanger dummy(mi.base, "textnormal");
28         dim_ = xcell(0).metrics(mi);
29         metricsMarkers2(5); // 5 pixels margin
30 }
31
32
33 void MathFboxInset::draw(MathPainterInfo & pi, int x, int y) const
34 {
35         MathFontSetChanger dummy(pi.base, "textnormal");
36         pi.pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2,
37                         LColor::black);
38         xcell(0).draw(pi, x + 5, y);
39 }
40
41
42 void MathFboxInset::write(WriteStream & os) const
43 {
44         os << "\\fbox{" << cell(0) << '}';
45 }
46
47
48 void MathFboxInset::normalize(NormalStream & os) const
49 {
50         os << "[fbox " << cell(0) << ']';
51 }