Author: gs Date: Wed Jun 25 14:30:40 2008 New Revision: 48529 URL: http://svn.opensuse.org/viewcvs/yast?rev=48529&view=rev Log: select tab if widget i snot active, send event on KEY_LEFT/RIGHT Modified: trunk/ncurses/src/NCDumbTab.cc Modified: trunk/ncurses/src/NCDumbTab.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCDumbTab.cc?rev=48529&r1=48528&r2=48529&view=diff ============================================================================== --- trunk/ncurses/src/NCDumbTab.cc (original) +++ trunk/ncurses/src/NCDumbTab.cc Wed Jun 25 14:30:40 2008 @@ -73,6 +73,7 @@ void NCDumbTab::setEnabled( bool do_bv ) { + yuiMilestone() << "Set enabled" << endl; NCWidget::setEnabled( do_bv ); YDumbTab::setEnabled( do_bv ); } @@ -100,6 +101,14 @@ { currentIndex--; wRedraw(); + + ret = NCursesEvent::menu; + item = itemAt( currentIndex ); + if ( item ) + { + yuiMilestone() << "Show tab: " << item->label() << endl; + ret.selection = (YMenuItem *)item; + } } break; @@ -108,9 +117,17 @@ { currentIndex++; wRedraw(); + + ret = NCursesEvent::menu; + item = itemAt( currentIndex ); + if ( item ) + { + yuiMilestone() << "Show tab: " << item->label() << endl; + ret.selection = (YMenuItem *)item; + } } break; - +#if 0 case KEY_RETURN: ret = NCursesEvent::menu; item = itemAt( currentIndex ); @@ -120,6 +137,7 @@ ret.selection = (YMenuItem *)item; } break; +#endif } return ret; @@ -167,12 +185,36 @@ while ( listIt != tabList.end() ) { - nonActive = (i == currentIndex)?false:true; - (*listIt).drawAt( *win, - NCstyle::StWidget( widgetStyle( nonActive) ), - wpos( 0, labelPos ), - wsze( 1, winWidth ), - NC::TOPLEFT, false ); + nonActive = (i == currentIndex)?false:true; + if ( GetState() == NC::WSactive ) + { + + (*listIt).drawAt( *win, + NCstyle::StWidget( widgetStyle( nonActive) ), + wpos( 0, labelPos ), + wsze( 1, winWidth ), + NC::TOPLEFT, false ); + } + else + { + if ( !nonActive ) + { + (*listIt).drawAt( *win, + A_REVERSE, + A_REVERSE, + wpos( 0, labelPos ), + wsze( 1, winWidth ), + NC::TOPLEFT, false ); + } + else + { + (*listIt).drawAt( *win, + NCstyle::StWidget( frameStyle() ), + wpos( 0, labelPos ), + wsze( 1, winWidth ), + NC::TOPLEFT, false ); + } + } labelPos += (*listIt).width() + 2; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org