]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_boxinset.C
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / math_boxinset.C
index b2ed64015f875667382793ff64fffec246bb6e15..135d526944ad795baf8ccf48581617a23a47867e 100644 (file)
@@ -1,19 +1,15 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_boxinset.h"
-#include "support/LOstream.h"
-#include "debug.h"
-#include "Painter.h"
-#include "math_cursor.h"
+#include "math_support.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
+#include "support/LOstream.h"
+
 
 MathBoxInset::MathBoxInset(string const & name)
-       : MathGridInset(1, 1), name_(name)
+       : MathNestInset(1), name_(name)
 {}
 
 
@@ -25,7 +21,7 @@ MathInset * MathBoxInset::clone() const
 
 void MathBoxInset::write(WriteStream & os) const
 {
-       os << "\\" << name_ << "{" << cell(0) << "}";
+       os << '\\' << name_ << '{' << cell(0) << '}';
 }
 
 
@@ -37,17 +33,24 @@ void MathBoxInset::normalize(NormalStream & os) const
 }
 
 
-void MathBoxInset::rebreak()
+void MathBoxInset::metrics(MathMetricsInfo & mi) const
+{
+       MathFontSetChanger dummy(mi.base, "textnormal");
+       cell(0).metrics(mi);
+       dim_ = cell(0).dim();
+       metricsMarkers2();
+}
+
+
+void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const
 {
-       //lyxerr << "trying to rebreak...\n";
+       MathFontSetChanger dummy(pi.base, "textnormal");
+       cell(0).draw(pi, x, y);
+       drawMarkers2(pi, x + 1, y);
 }
 
 
-void MathBoxInset::draw(Painter & pain, int x, int y) const
+void MathBoxInset::infoize(std::ostream & os) const
 {
-       MathGridInset::draw(pain, x, y);
-       if (mathcursor && mathcursor->isInside(this)) {
-               pain.rectangle(x - 1, y - ascent() - 1, width(), height(),
-                       LColor::mathframe);
-       }
+       os << "Box: " << name_;
 }