]> git.lyx.org Git - features.git/commitdiff
small step forward on the lenghty path to \mbox support
authorAndré Pönitz <poenitz@gmx.net>
Wed, 24 Oct 2001 18:29:55 +0000 (18:29 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 24 Oct 2001 18:29:55 +0000 (18:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2940 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_boxinset.C
src/mathed/math_boxinset.h
src/mathed/math_cursor.C
src/mathed/math_factory.C
src/mathed/math_inset.C
src/mathed/math_inset.h

index 2e1c3bacded15038e635a6e1744f6875adaad000..16263fb172df526323ea041420a4b3766b871cad 100644 (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))
index a3d8202c7570df32f6c0d523457d992bf05b52ad..6e7ac2fd05f593ad3331e648f4c35dc661457a7b 100644 (file)
@@ -36,6 +36,8 @@ public:
        void metrics(MathMetricsInfo const &) const;
        /// identifies BoxInsets
        MathBoxInset * asBoxInset() { return this; }
+       ///
+       bool isHyperActive() const { return 1; }
 
 private:
        /// unimplemented
index 6535c43bd34167970dc3c2af533744fca6075715..822b1d97fc4b6076671fd209d92abc9c982a417b 100644 (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;
        }
index 49201ac99442c92fc308347bb67b1497b29c6d7c..10f0082e764158594b56f65a7d7f48a95584d6d6 100644 (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));
 }
index 40984b1670e543e80668f36a615d023339ea5796..6c20b0e1817c740aca4973ddf20baecfd432d68e 100644 (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_;
 }
 
index d2a8802bddfce4fff9dd8c8cacc5968e799da3fd..ebdae3f5480fd8dab685925b867106523d96309c 100644 (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; }
        ///