From: André Pönitz Date: Wed, 16 Jan 2002 14:24:38 +0000 (+0000) Subject: prepare writing info messages to the minibuffer X-Git-Tag: 1.6.10~20003 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a86ed9bea2ec94892d65e2925b4570a2fe7a60bb;p=features.git prepare writing info messages to the minibuffer git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3390 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 484a3049e0..d26933e0e5 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -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; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 6f120f5424..d2381c8fbd 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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(); +} diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index 765c19bd57..82e5a28d59 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -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 diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 6c14437e82..e7272ded44 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -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; diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index c861d5c942..8b7fc8d546 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -177,3 +177,9 @@ void MathSymbolInset::write(WriteStream & os) const } +void MathSymbolInset::infoize(std::ostream & os) const +{ + os << '\\' << name(); +} + + diff --git a/src/mathed/math_symbolinset.h b/src/mathed/math_symbolinset.h index 0de6781ed3..bb653b220f 100644 --- a/src/mathed/math_symbolinset.h +++ b/src/mathed/math_symbolinset.h @@ -46,6 +46,8 @@ public: void octavize(OctaveStream &) const; /// void write(WriteStream & os) const; + /// + void infoize(std::ostream & os) const; private: ///