2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_boxinset.h"
|
|
|
|
#include "support/LOstream.h"
|
|
|
|
#include "debug.h"
|
|
|
|
#include "Painter.h"
|
|
|
|
#include "math_cursor.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2001-10-19 11:25:48 +00:00
|
|
|
|
|
|
|
MathBoxInset::MathBoxInset(string const & name)
|
2001-12-18 12:21:33 +00:00
|
|
|
: MathGridInset(1, 1), name_(name)
|
2001-10-19 16:07:10 +00:00
|
|
|
{}
|
2001-10-19 11:25:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathBoxInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathBoxInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathBoxInset::write(WriteStream & os) const
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << "\\" << name_ << "{" << cell(0) << "}";
|
2001-10-19 11:25:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathBoxInset::normalize(NormalStream & os) const
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
2001-12-18 12:21:33 +00:00
|
|
|
os << '[' << name_ << ' ';
|
2001-10-19 11:25:48 +00:00
|
|
|
//text_->write(buffer(), os);
|
|
|
|
os << "] ";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-18 12:21:33 +00:00
|
|
|
void MathBoxInset::rebreak()
|
2001-10-19 11:25:48 +00:00
|
|
|
{
|
2001-12-18 12:21:33 +00:00
|
|
|
//lyxerr << "trying to rebreak...\n";
|
2001-10-19 11:25:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathBoxInset::draw(Painter & pain, int x, int y) const
|
|
|
|
{
|
2001-12-18 12:21:33 +00:00
|
|
|
MathGridInset::draw(pain, x, y);
|
|
|
|
if (mathcursor && mathcursor->isInside(this)) {
|
|
|
|
pain.rectangle(x - 1, y - ascent() - 1, width(), height(),
|
2001-10-19 11:25:48 +00:00
|
|
|
LColor::mathframe);
|
2001-12-18 12:21:33 +00:00
|
|
|
}
|
2001-10-24 19:09:31 +00:00
|
|
|
}
|