2001-10-18 13:21:21 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_lefteqninset.h"
|
|
|
|
#include "LColor.h"
|
|
|
|
#include "Painter.h"
|
|
|
|
#include "math_cursor.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-10-18 13:21:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
MathLefteqnInset::MathLefteqnInset()
|
|
|
|
: MathNestInset(1)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathLefteqnInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathLefteqnInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-08 12:06:56 +00:00
|
|
|
void MathLefteqnInset::metrics(MathMetricsInfo const & mi) const
|
|
|
|
{
|
|
|
|
MathNestInset::metrics(mi);
|
|
|
|
ascent_ = xcell(0).ascent() + 2;
|
|
|
|
descent_ = xcell(0).descent() + 2;
|
|
|
|
width_ = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-18 13:21:21 +00:00
|
|
|
void MathLefteqnInset::draw(Painter & pain, int x, int y) const
|
|
|
|
{
|
|
|
|
xcell(0).draw(pain, x + 2, y);
|
|
|
|
if (mathcursor && mathcursor->isInside(this)) {
|
|
|
|
pain.rectangle(x, y - ascent(), xcell(0).width(), height(),
|
|
|
|
LColor::mathframe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
void MathLefteqnInset::write(MathWriteInfo & os) const
|
2001-10-18 13:21:21 +00:00
|
|
|
{
|
2001-10-19 11:25:48 +00:00
|
|
|
os << "\\lefteqn{" << cell(0) << "}";
|
2001-10-18 13:21:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-08 12:06:56 +00:00
|
|
|
void MathLefteqnInset::writeNormal(NormalStream & os) const
|
2001-10-18 13:21:21 +00:00
|
|
|
{
|
|
|
|
os << "[lefteqn ";
|
2001-11-08 12:06:56 +00:00
|
|
|
MathWriteInfo wi(os.os_);
|
2001-10-19 11:25:48 +00:00
|
|
|
cell(0).write(wi);
|
2001-11-08 12:06:56 +00:00
|
|
|
os << "]";
|
2001-10-18 13:21:21 +00:00
|
|
|
}
|