]> git.lyx.org Git - lyx.git/blob - src/mathed/math_boxinset.C
forward search in math insets. ugly. seems to work. don't ask why.
[lyx.git] / src / mathed / math_boxinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_boxinset.h"
8 #include "support/LOstream.h"
9 #include "debug.h"
10 #include "Painter.h"
11 #include "math_cursor.h"
12 #include "math_mathmlstream.h"
13 #include "math_streamstr.h"
14
15 MathBoxInset::MathBoxInset(string const & name)
16         : MathGridInset(1, 1), name_(name)
17 {}
18
19
20 MathInset * MathBoxInset::clone() const
21 {
22         return new MathBoxInset(*this);
23 }
24
25
26 void MathBoxInset::write(WriteStream & os) const
27 {
28         os << "\\" << name_ << "{" << cell(0) << "}";
29 }
30
31
32 void MathBoxInset::normalize(NormalStream & os) const
33 {
34         os << '[' << name_ << ' ';
35         //text_->write(buffer(), os);
36         os << "] ";
37 }
38
39
40 void MathBoxInset::rebreak()
41 {
42         //lyxerr << "trying to rebreak...\n";
43 }
44
45
46 void MathBoxInset::draw(Painter & pain, int x, int y) const
47 {
48         MathGridInset::draw(pain, x, y);
49         if (mathcursor && mathcursor->isInside(this)) {
50                 pain.rectangle(x - 1, y - ascent() - 1, width(), height(),
51                         LColor::mathframe);
52         }
53 }