From 557033beb6e3b59270fa5334c310b9b40a56d100 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 24 Oct 2001 18:29:55 +0000 Subject: [PATCH] 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 --- src/mathed/math_boxinset.C | 1 - src/mathed/math_boxinset.h | 2 ++ src/mathed/math_cursor.C | 9 +++++++++ src/mathed/math_factory.C | 6 +++--- src/mathed/math_inset.C | 8 ++++---- src/mathed/math_inset.h | 2 ++ 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/mathed/math_boxinset.C b/src/mathed/math_boxinset.C index 2e1c3bacde..16263fb172 100644 --- a/src/mathed/math_boxinset.C +++ b/src/mathed/math_boxinset.C @@ -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)) diff --git a/src/mathed/math_boxinset.h b/src/mathed/math_boxinset.h index a3d8202c75..6e7ac2fd05 100644 --- a/src/mathed/math_boxinset.h +++ b/src/mathed/math_boxinset.h @@ -36,6 +36,8 @@ public: void metrics(MathMetricsInfo const &) const; /// identifies BoxInsets MathBoxInset * asBoxInset() { return this; } + /// + bool isHyperActive() const { return 1; } private: /// unimplemented diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 6535c43bd3..822b1d97fc 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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; } diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 49201ac994..10f0082e76 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -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)); } diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 40984b1670..6c20b0e181 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -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_; } diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index d2a8802bdd..ebdae3f548 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -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; } /// -- 2.39.2