Author: gs Date: Thu Jun 26 10:11:47 2008 New Revision: 48541 URL: http://svn.opensuse.org/viewcvs/yast?rev=48541&view=rev Log: createMenuEvent added Modified: trunk/ncurses/src/NCDumbTab.cc trunk/ncurses/src/NCDumbTab.h Modified: trunk/ncurses/src/NCDumbTab.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCDumbTab.cc?rev=48541&r1=48540&r2=48541&view=diff ============================================================================== --- trunk/ncurses/src/NCDumbTab.cc (original) +++ trunk/ncurses/src/NCDumbTab.cc Thu Jun 26 10:11:47 2008 @@ -92,7 +92,6 @@ NCursesEvent NCDumbTab::wHandleInput( wint_t key ) { NCursesEvent ret = NCursesEvent::none; - YItem * item; switch ( key ) { @@ -102,13 +101,7 @@ currentIndex--; wRedraw(); - ret = NCursesEvent::menu; - item = itemAt( currentIndex ); - if ( item ) - { - yuiMilestone() << "Show tab: " << item->label() << endl; - ret.selection = (YMenuItem *)item; - } + ret = createMenuEvent( currentIndex ); } break; @@ -118,31 +111,34 @@ currentIndex++; wRedraw(); - ret = NCursesEvent::menu; - item = itemAt( currentIndex ); - if ( item ) - { - yuiMilestone() << "Show tab: " << item->label() << endl; - ret.selection = (YMenuItem *)item; - } + ret = createMenuEvent( currentIndex ); } break; -#if 0 + case KEY_RETURN: - ret = NCursesEvent::menu; - item = itemAt( currentIndex ); - if ( item ) - { - yuiMilestone() << "Show tab: " << item->label() << endl; - ret.selection = (YMenuItem *)item; - } + ret = createMenuEvent( currentIndex ); break; -#endif + } return ret; } +NCursesEvent NCDumbTab::createMenuEvent( unsigned int index ) +{ + NCursesEvent ret = NCursesEvent::menu; + YItem * item; + + item = itemAt( index ); + if ( item ) + { + yuiMilestone() << "Show tab: " << item->label() << endl; + ret.selection = (YMenuItem *)item; + } + + return ret; +} + void NCDumbTab::addItem( YItem * item ) { YDumbTab::addItem( item ); Modified: trunk/ncurses/src/NCDumbTab.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCDumbTab.h?rev=48541&r1=48540&r2=48541&view=diff ============================================================================== --- trunk/ncurses/src/NCDumbTab.h (original) +++ trunk/ncurses/src/NCDumbTab.h Thu Jun 26 10:11:47 2008 @@ -36,7 +36,7 @@ vector <NClabel> tabList; unsigned int currentIndex; - + protected: virtual const char * location() const { return "NCDumbTab"; } @@ -69,6 +69,7 @@ return true; } + NCursesEvent createMenuEvent( unsigned int index); }; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org