From: g0dil Date: Thu, 8 Jan 2009 22:02:37 +0000 (+0000) Subject: Utils/Termlib: Implement aux display hide/show support X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=567f66452149cfe6d5e909901901e50e1bf1fbd1;p=senf.git Utils/Termlib: Implement aux display hide/show support git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1049 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Termlib/Editor.cc b/Utils/Termlib/Editor.cc index f268efb..e8291a2 100644 --- a/Utils/Termlib/Editor.cc +++ b/Utils/Termlib/Editor.cc @@ -324,6 +324,11 @@ prefix_ void senf::term::LineEditor::show() if (enabled_) return; enabled_ = true; + for (unsigned n (0); n < auxDisplay_.size(); ++n) { + toLine(n+1); + put(auxDisplay_[n]); + } + toLine(0); forceRedisplay(); } @@ -331,6 +336,7 @@ prefix_ void senf::term::LineEditor::hide() { if (! enabled_) return; + reset(); clearLine(); enabled_ = false; } @@ -464,6 +470,9 @@ prefix_ void senf::term::LineEditor::auxDisplay(int line, std::string const & te toLine(line+1); clearLine(); put(text); + while (auxDisplay_.size() < line+1) + auxDisplay_.push_back(""); + auxDisplay_[line] = text; } prefix_ unsigned senf::term::LineEditor::maxAuxDisplayHeight() @@ -474,6 +483,7 @@ prefix_ unsigned senf::term::LineEditor::maxAuxDisplayHeight() prefix_ void senf::term::LineEditor::clearAuxDisplay() { reset(); + auxDisplay_.clear(); } prefix_ std::string const & senf::term::LineEditor::text() diff --git a/Utils/Termlib/Editor.hh b/Utils/Termlib/Editor.hh index d2d091c..e173a29 100644 --- a/Utils/Termlib/Editor.hh +++ b/Utils/Termlib/Editor.hh @@ -159,6 +159,7 @@ namespace term { typedef std::map KeyMap; typedef std::vector History; + typedef std::vector AuxDisplay; bool enabled_; bool redisplayNeeded_; @@ -173,6 +174,7 @@ namespace term { KeyMap bindings_; History history_; unsigned historyPoint_; + AuxDisplay auxDisplay_; }; namespace bindings {