[yast-commit] r40989 - /branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc
Author: gs Date: Thu Sep 20 16:31:46 2007 New Revision: 40989 URL: http://svn.opensuse.org/viewcvs/yast?rev=40989&view=rev Log: YTree::selectItem added in wHandleInput Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc?rev=40989&r1=40988&r2=40989&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc Thu Sep 20 16:31:46 2007 @@ -71,7 +71,7 @@ } Append( new NCTableCol( YCPString( string( prefixLen(), ' ' ) - + yitem.label() ) ) ); // FIXME ??? was yitem.getText()->value() + + yitem.label() ) ) ); } virtual ~NCTreeLine() { delete [] prefix; } @@ -362,20 +362,14 @@ void NCTree::selectItem( int index ) { - NCDBG << "Select item (index) called" << endl; YTree::deselectAllItems(); YItem * item = YTree::itemAt( index ); if ( item ) { -#ifdef VERBOSE_SELECTION - y2debug( "%s \"%s\": Selecting item \"%s\"", - widgetClass(), - debugLabel().c_str(), - item->label().c_str() ); -#endif - + NCMIL << "selectItem: " << item->label().c_str() << endl; item->setSelected( true ); + // FIXME - call myPad()->ShowItem() ??? } else YUI_THROW( YUIException( "Can't find selected item" ) ); @@ -475,6 +469,7 @@ { NCursesEvent ret = NCursesEvent::none; const YTreeItem * oldCurrentItem = getCurrentItem(); + if ( ! handleInput( key ) ) { switch ( key ) { @@ -482,17 +477,22 @@ case KEY_RETURN: if ( notify() ) { - NCDBG << "Return: NCursesEvent::Activated" << endl; return NCursesEvent::Activated; } break; } } - - if ( notify() && oldCurrentItem != getCurrentItem() ) + + const YItem * currentItem = getCurrentItem(); + YUI_CHECK_PTR( currentItem ); + YTree::selectItem( const_cast<YItem *>(currentItem), true ); + + NCMIL << "Old item: " << oldCurrentItem->label() << " Current: " << currentItem->label() << endl; + // FIXME !!!!! (oldCurrentItem != getCurrentItem()) is NOT true ??? + if ( notify() && (oldCurrentItem != getCurrentItem()) ) ret = NCursesEvent::SelectionChanged; - NCDBG << "Notify: " << (notify()?"true":"false") << " Return event: " << ret << endl; + NCMIL << "Notify: " << (notify()?"true":"false") << " Return event: " << ret << endl; return ret; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn.opensuse.org