2 * \file InsetMathFrameBox.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathFrameBox.h"
14 #include "MathArray.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
18 #include "frontends/Painter.h"
26 InsetMathFrameBox::InsetMathFrameBox()
31 auto_ptr<InsetBase> InsetMathFrameBox::doClone() const
33 return auto_ptr<InsetBase>(new InsetMathFrameBox(*this));
37 bool InsetMathFrameBox::metrics(MetricsInfo & mi, Dimension & dim) const
39 FontSetChanger dummy(mi.base, "textnormal");
40 w_ = mathed_char_width(mi.base.font, '[');
41 InsetMathNest::metrics(mi);
53 void InsetMathFrameBox::draw(PainterInfo & pi, int x, int y) const
55 FontSetChanger dummy(pi.base, "textnormal");
56 pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
57 dim_.width() - 2, dim_.height() - 2, LColor::foreground);
60 drawStrBlack(pi, x, y, from_ascii("["));
62 cell(0).draw(pi, x, y);
64 drawStrBlack(pi, x, y, from_ascii("]"));
67 drawStrBlack(pi, x, y, from_ascii("["));
69 cell(1).draw(pi, x, y);
71 drawStrBlack(pi, x, y, from_ascii("]"));
74 cell(2).draw(pi, x, y);
75 drawMarkers(pi, x, y);
79 void InsetMathFrameBox::write(WriteStream & os) const
82 os << '[' << cell(0) << ']';
84 os << '[' << cell(1) << ']';
85 os << '{' << cell(2) << '}';
89 void InsetMathFrameBox::normalize(NormalStream & os) const
91 os << "[framebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';