Author: gs Date: Wed Aug 1 14:54:47 2007 New Revision: 39870 URL: http://svn.opensuse.org/viewcvs/yast?rev=39870&view=rev Log: add addItem() Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc?rev=39870&r1=39869&r2=39870&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc Wed Aug 1 14:54:47 2007 @@ -52,24 +52,6 @@ WIDDBG << endl; } -/////////////////////////////////////////////////////////////////// -// -// -// METHOD NAME : NCSelectionBox::nicesize -// METHOD TYPE : long -// -// DESCRIPTION : -// -long NCSelectionBox::nicesize( YUIDimension dim ) -{ - wsze sze = ( biglist ) ? myPad()->tableSize() + 2 : wGetDefsze(); - if (dim == YD_HORIZ) { - return sze.W > (int)(labelWidht()+2) ? sze.W : (labelWidht()+2); - } else { - return sze.H; - } -} - int NCSelectionBox::preferredWidth() { wsze sze = ( biglist ) ? myPad()->tableSize() + 2 : wGetDefsze(); @@ -113,6 +95,7 @@ { if ( !myPad()->Lines() ) return -1; + NCMIL << "Current pos: " << myPad()->CurPos().L << endl; return myPad()->CurPos().L; } @@ -168,6 +151,8 @@ // // DESCRIPTION : // +// still used in NCPkgPopupDeps +// void NCSelectionBox::itemAdded( const YCPString& str, int index, bool selected ) { vector<NCTableCol*> Items( 1U, 0 ); @@ -181,6 +166,29 @@ /////////////////////////////////////////////////////////////////// // // +// METHOD NAME : NCSelectionBox::addItem +// METHOD TYPE : void +// +// DESCRIPTION : +// +void NCSelectionBox::addItem( YItem * item ) +{ + vector<NCTableCol*> Items( 1U, 0 ); + + if ( item ) + { + YSelectionBox::addItem ( item ); + Items[0] = new NCTableCol( item->label() ); + myPad()->Append( Items ); + DrawPad(); + if ( item->selected() ) + myPad()->ScrlLine( myPad()->Lines() ); + } +} + +/////////////////////////////////////////////////////////////////// +// +// // METHOD NAME : NCSelectionBox::setLabel // METHOD TYPE : void // Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h?rev=39870&r1=39869&r2=39870&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h Wed Aug 1 14:54:47 2007 @@ -67,8 +67,9 @@ void setBigList( const bool big ) { biglist = big; } virtual void itemAdded( const YCPString& string, int index, bool selected ); - virtual long nicesize( YUIDimension dim ); + virtual void addItem( YItem *item ); + virtual int preferredWidth(); virtual int preferredHeight(); @@ -86,7 +87,6 @@ virtual NCursesEvent wHandleInput( wint_t key ); - //virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); } virtual void setEnabled( bool do_bv ); virtual bool setKeyboardFocus() { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org