small step forward on the lenghty path to \mbox support

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2940 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-10-24 18:29:55 +00:00
parent 68a3a474b7
commit 557033beb6
6 changed files with 20 additions and 8 deletions

View File

@ -70,7 +70,6 @@ void MathBoxInset::metrics(MathMetricsInfo const & st) const
void MathBoxInset::draw(Painter & pain, int x, int y) const
{
float fx = x + 2;
if (text_ && mi_.view)
text_->draw(mi_.view, mi_.font, y, fx, false);
if (mathcursor && mathcursor->isInside(this))

View File

@ -36,6 +36,8 @@ public:
void metrics(MathMetricsInfo const &) const;
/// identifies BoxInsets
MathBoxInset * asBoxInset() { return this; }
///
bool isHyperActive() const { return 1; }
private:
/// unimplemented

View File

@ -243,6 +243,9 @@ bool MathCursor::isInside(MathInset const * p) const
bool MathCursor::openable(MathAtom const & t, bool sel) const
{
if (t->isHyperActive())
return true;
if (!t->isActive())
return false;
@ -304,6 +307,9 @@ bool MathCursor::left(bool sel)
lastcode_ = LM_TC_VAR;
if (hasPrevAtom() && openable(prevAtom(), sel)) {
if (prevAtom()->isHyperActive()) {
lyxerr << "entering hyperactive inset\n";
}
pushRight(prevAtom());
return true;
}
@ -324,6 +330,9 @@ bool MathCursor::right(bool sel)
lastcode_ = LM_TC_VAR;
if (hasNextAtom() && openable(nextAtom(), sel)) {
if (nextAtom()->isHyperActive()) {
lyxerr << "entering hyperactive inset\n";
}
pushLeft(nextAtom());
return true;
}

View File

@ -2,7 +2,7 @@
#include "math_parser.h"
#include "math_binominset.h"
//#include "math_boxinset.h"
#include "math_boxinset.h"
#include "math_decorationinset.h"
#include "math_dotsinset.h"
#include "math_funcinset.h"
@ -63,8 +63,8 @@ MathAtom createMathInset(latexkeys const * l)
return MathAtom(new MathSpaceInset(l->id));
case LM_TK_DOTS:
return MathAtom(new MathDotsInset(l->name));
//case LM_TK_BOX:
// return MathAtom(new MathBoxInset(l->name));
case LM_TK_BOX:
return MathAtom(new MathBoxInset(l->name));
}
return MathAtom(new MathFuncInset(l->name));
}

View File

@ -56,28 +56,28 @@ MathXArray dummyCell;
MathXArray & MathInset::xcell(idx_type)
{
lyxerr << "I don't have a cell\n";
lyxerr << "I don't have a cell 1\n";
return dummyCell;
}
MathXArray const & MathInset::xcell(idx_type) const
{
lyxerr << "I don't have a cell\n";
lyxerr << "I don't have a cell 2\n";
return dummyCell;
}
MathArray & MathInset::cell(idx_type)
{
lyxerr << "I don't have a cell\n";
lyxerr << "I don't have a cell 3\n";
return dummyCell.data_;
}
MathArray const & MathInset::cell(idx_type) const
{
lyxerr << "I don't have a cell\n";
lyxerr << "I don't have a cell 4\n";
return dummyCell.data_;
}

View File

@ -222,6 +222,8 @@ public:
virtual bool isScriptable() const { return false; }
///
virtual bool isActive() const { return nargs() > 0; }
/// identifies insets from the outer world
virtual bool isHyperActive() const { return 0; }
///
virtual bool isRelOp() const { return false; }
///