Author: kmachalkova
Date: Thu Dec 20 10:37:54 2007
New Revision: 43200
URL: http://svn.opensuse.org/viewcvs/yast?rev=43200&view=rev
Log:
Bottom status line added
Modified:
trunk/ncurses/src/NCDialog.cc
trunk/ncurses/src/NCurses.cc
trunk/ncurses/src/NCurses.h
Modified: trunk/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCDialog.cc?rev=43200&r1=43199&r2=43200&view=diff
==============================================================================
--- trunk/ncurses/src/NCDialog.cc (original)
+++ trunk/ncurses/src/NCDialog.cc Thu Dec 20 10:37:54 2007
@@ -267,6 +267,7 @@
getVisible();
doUpdate();
DumpOn( NCDBG, " " );
+
}
else if ( !pan )
{
@@ -531,6 +532,9 @@
--inMultiDraw_i;
} else {
inMultiDraw_i = 0;
+ string text = "";
+ describeFunctionKeys( text );
+ NCurses::SetStatusLine( text );
Update();
}
}
@@ -1417,8 +1421,8 @@
for ( it = fkeys.begin(); it != fkeys.end(); ++it )
{
- sprintf( key, "F%-2d: ", (*it).first );
- text += key + (*it).second + "<br>";
+ sprintf( key, "F%d: ", (*it).first );
+ text += key + (*it).second + " ";
}
helpText = text;
Modified: trunk/ncurses/src/NCurses.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCurses.cc?rev=43200&r1=43199&r2=43200&view=diff
==============================================================================
--- trunk/ncurses/src/NCurses.cc (original)
+++ trunk/ncurses/src/NCurses.cc Thu Dec 20 10:37:54 2007
@@ -147,6 +147,7 @@
NCurses::NCurses()
: theTerm ( 0 )
, title_w ( 0 )
+ , status_w( 0 )
, styleset( 0 )
, stdpan ( 0 )
{
@@ -174,6 +175,8 @@
delete stdpan;
if ( title_w )
::delwin( title_w );
+ if ( status_w)
+ ::delwin( status_w );
::endwin();
if ( theTerm )
::delscreen( theTerm );
@@ -188,14 +191,23 @@
//
// DESCRIPTION :
//
-WINDOW * NCurses::ripped_w = 0;
+WINDOW * NCurses::ripped_w_top = 0;
+WINDOW * NCurses::ripped_w_bottom = 0;
-int NCurses::ripinit( WINDOW * w, int c )
+int NCurses::ripinit_top( WINDOW * w, int c )
{
- ripped_w = w;
+ ripped_w_top = w;
return OK;
}
+
+int NCurses::ripinit_bottom( WINDOW * w, int c )
+{
+ ripped_w_bottom = w;
+ return OK;
+}
+
+
void NCurses::init()
{
UIMIL << "Launch NCurses..."
@@ -206,8 +218,12 @@
UIMIL << "TERM=" << envTerm << endl;
signal( SIGINT, SIG_IGN ); // ignore Ctrl C
-
- if ( title_line() && ::ripoffline( 1, ripinit ) != OK )
+
+ //rip off the top line
+ if ( title_line() && ::ripoffline( 1, ripinit_top ) != OK )
+ throw NCursesError( "ripoffline() failed" );
+ //and bottom line (-1 means 1st from the bottom)
+ if ( ::ripoffline( -1, ripinit_bottom) != OK )
throw NCursesError( "ripoffline() failed" );
UIMIL << "isatty(stdin)" << (isatty(0) ? "yes" : "no") << endl;
@@ -277,11 +293,15 @@
}
if ( title_line() ) {
- if ( !ripped_w )
- throw NCursesError( "ripinit() failed" );
- title_w = ripped_w;
+ if ( !ripped_w_top )
+ throw NCursesError( "ripinit_top() failed" );
+ title_w = ripped_w_top;
}
+ if ( !ripped_w_bottom )
+ throw NCursesError( "ripinit_bottom() failed" );
+ status_w = ripped_w_bottom;
+
setup_screen();
UIMIL << form( "screen size %d x %d\n", lines(), cols() );
@@ -334,6 +354,8 @@
{
::wbkgd( title_w, style()(NCstyle::AppTitle) );
::wnoutrefresh( title_w );
+ ::wbkgd( status_w, style()(NCstyle::AppTitle) );
+ ::wnoutrefresh( status_w );
}
///////////////////////////////////////////////////////////////////
@@ -448,6 +470,7 @@
if ( myself && myself->initialized() ) {
UIMIL << "start refresh ..." << endl;
SetTitle( myself->title_t );
+ SetStatusLine( myself->status_line );
::clearok( ::stdscr, true );
myself->stdpan->refresh();
UIMIL << "done refresh ..." << endl;
@@ -520,6 +543,20 @@
::mvwaddstr( myself->title_w, 0, 1, myself->title_t.c_str() );
::wnoutrefresh( myself->title_w );
}
+
+}
+
+void NCurses::SetStatusLine( const string & str )
+{
+
+ if ( myself && myself->status_w ) {
+ myself->status_line = str;
+ ::wbkgd( myself->status_w, myself->style()(NCstyle::AppTitle) );
+ ::werase( myself->status_w );
+
+ ::mvwaddstr( myself->status_w, 0, 1, myself->status_line.c_str() );
+ ::wnoutrefresh( myself->status_w );
+ }
}
///////////////////////////////////////////////////////////////////
@@ -623,13 +660,16 @@
(*it)->resizeEvent();
}
- // recreate stack of visible dialogs
- for ( list