]> git.lyx.org Git - features.git/commitdiff
prepare writing info messages to the minibuffer
authorAndré Pönitz <poenitz@gmx.net>
Wed, 16 Jan 2002 14:24:38 +0000 (14:24 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 16 Jan 2002 14:24:38 +0000 (14:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3390 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulabase.C
src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/mathed/math_inset.h
src/mathed/math_symbolinset.C
src/mathed/math_symbolinset.h

index 484a3049e03dee47215cb57637bd2184532c3dca..d26933e0e556ebfa27aa0bd8ad10cbf94406a025 100644 (file)
@@ -378,6 +378,8 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        case LFUN_RIGHT:
                result = mathcursor->right(sel) ? DISPATCHED : FINISHED_RIGHT;
                updateLocal(bv, false);
+               // write something to the minibuffer
+               //bv->owner()->message(mathcursor->info());
                break;
 
 
index 6f120f542411fb4ef9b382e6908d30c0de64f730..d2381c8fbd55209dc96810d226e7606ed1a71cbc 100644 (file)
@@ -1470,3 +1470,12 @@ void MathCursor::setSelection(cursor_type const & where, size_type n)
        Cursor_ = where;
        cursor().pos_ += n;
 }
+
+
+string MathCursor::info() const
+{
+       std::ostringstream os;
+       if (pos() > 0)
+               prevAtom()->infoize(os);
+       return os.str();
+}
index 765c19bd57692a08bc6cb61b170a2ebbefc4bf5b..82e5a28d59285776ea13f2b3954c3a696d49999c 100644 (file)
@@ -231,6 +231,8 @@ public:
        /// reference to the last item of the path, i.e. "The Cursor"
        MathCursorPos const & cursor() const;
 
+       /// describe the situation
+       string info() const;
        /// dump selection information for debugging
        void seldump(char const * str) const;
        /// dump selection information for debugging
index 6c14437e827626519fbd0027b468b7fe9299aae3..e7272ded448278fd663b3df6fbd90faf2c360d1d 100644 (file)
@@ -66,6 +66,7 @@ class OctaveStream;
 class MapleStream;
 class MathMLStream;
 class WriteStream;
+class InfoStream;
 class MathArray;
 
 class LaTeXFeatures;
@@ -234,6 +235,8 @@ public:
        virtual void mathmlize(MathMLStream &) const;
        /// write content as something readable by Octave
        virtual void octavize(OctaveStream &) const;
+       /// describe content
+       virtual void infoize(std::ostream &) const {}
 
        /// dump content to stderr for debugging
        virtual void dump() const;
index c861d5c94289f70744f7543a7af01f1b61eee024..8b7fc8d546b5595cfa054c32c560f0f9dd9af179 100644 (file)
@@ -177,3 +177,9 @@ void MathSymbolInset::write(WriteStream & os) const
 }
 
 
+void MathSymbolInset::infoize(std::ostream & os) const
+{
+       os << '\\' << name();
+}
+
+
index 0de6781ed307709d5d4c8a8af5e1312ae32b2aae..bb653b220f08bc581f215eb29e7fa99f520b4d0a 100644 (file)
@@ -46,6 +46,8 @@ public:
        void octavize(OctaveStream &) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       void infoize(std::ostream & os) const;
 
 private:
        ///