prepare writing info messages to the minibuffer

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3390 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-01-16 14:24:38 +00:00
parent 6fb6cd8cc4
commit a86ed9bea2
6 changed files with 24 additions and 0 deletions

View 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;

View 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();
}

View 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

View 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;

View File

@ -177,3 +177,9 @@ void MathSymbolInset::write(WriteStream & os) const
}
void MathSymbolInset::infoize(std::ostream & os) const
{
os << '\\' << name();
}

View File

@ -46,6 +46,8 @@ public:
void octavize(OctaveStream &) const;
///
void write(WriteStream & os) const;
///
void infoize(std::ostream & os) const;
private:
///