Author: gs Date: Thu Oct 18 11:53:06 2007 New Revision: 41451 URL: http://svn.opensuse.org/viewcvs/yast?rev=41451&view=rev Log: ported NCLogView, NCIntField Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc?rev=41451&r1=41450&r2=41451&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc Thu Oct 18 11:53:06 2007 @@ -36,14 +36,13 @@ // // DESCRIPTION : // -NCIntField::NCIntField( YWidget * parent, const YWidgetOpt & opt, - const YCPString & nlabel, +NCIntField::NCIntField( YWidget * parent, + const string & nlabel, int minV, int maxV, int initialV ) - : YIntField( opt, nlabel, + : YIntField( parent, nlabel, minV <= maxV ? minV : maxV, - maxV >= minV ? maxV : minV, - initialV ) + maxV >= minV ? maxV : minV ) , NCWidget( parent ) , lwin( 0 ) , twin( 0 ) @@ -76,19 +75,6 @@ WIDDBG << endl; } -/////////////////////////////////////////////////////////////////// -// -// -// METHOD NAME : NCIntField::nicesize -// METHOD TYPE : long -// -// DESCRIPTION : -// -long NCIntField::nicesize( YUIDimension dim ) -{ - return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H; -} - int NCIntField::preferredWidth() { return wGetDefsze().W; @@ -194,7 +180,7 @@ // // DESCRIPTION : // -void NCIntField::setLabel( const YCPString & nlabel ) +void NCIntField::setLabel( const string & nlabel ) { label = NCstring( nlabel ); label.stripHotkey(); @@ -211,8 +197,9 @@ // // DESCRIPTION : // -void NCIntField::setValue( int newValue ) +void NCIntField::setValueInternal( int newValue ) { +#if 0 if ( newValue < minValue() ) cvalue = minValue(); else if ( newValue > maxValue() ) @@ -221,6 +208,9 @@ cvalue = newValue; YIntField::setValue( cvalue ); +#endif + // checking newValue is done by YIntField + cvalue = newValue; tUpdate(); } Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h?rev=41451&r1=41450&r2=41451&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h Thu Oct 18 11:53:06 2007 @@ -70,14 +70,12 @@ public: - NCIntField( YWidget * parent, const YWidgetOpt & opt, - const YCPString & label, + NCIntField( YWidget * parent, + const string & label, int minValue, int maxValue, int initialValue ); virtual ~NCIntField(); - virtual long nicesize( YUIDimension dim ); - virtual int preferredWidth(); virtual int preferredHeight(); @@ -88,10 +86,11 @@ **/ virtual void setSize( int newWidth, int newHeight ); - virtual void setLabel( const YCPString & nlabel ); + virtual void setLabel( const string & nlabel ); - virtual void setValue( int newValue ); + virtual void setValueInternal( int newValue ); + virtual int value() { return cvalue; } virtual NCursesEvent wHandleInput( wint_t key ); virtual bool setKeyboardFocus() { @@ -99,7 +98,7 @@ return YWidget::setKeyboardFocus(); return true; } - //virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); } + virtual void setEnabled( bool do_bv ); }; Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc?rev=41451&r1=41450&r2=41451&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc Thu Oct 18 11:53:06 2007 @@ -31,7 +31,7 @@ const string & nlabel, int visibleLines, int maxLines ) - : YLogView( nlabel, visibleLines, maxLines ) + : YLogView( parent, nlabel, visibleLines, maxLines ) , NCPadWidget( parent ) { WIDDBG << endl; @@ -52,20 +52,6 @@ WIDDBG << endl; } -/////////////////////////////////////////////////////////////////// -// -// -// METHOD NAME : NCLogView::nicesize -// METHOD TYPE : long -// -// DESCRIPTION : -// -long NCLogView::nicesize( YUIDimension dim ) -{ - defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2; - return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H; -} - int NCLogView::preferredWidth() { defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2; Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc?rev=41451&r1=41450&r2=41451&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc Thu Oct 18 11:53:06 2007 @@ -200,7 +200,10 @@ NCIntField * NCWidgetFactory::createIntField( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal ) { - return 0; // FIXME: TO DO + NCIntField * intField = new NCIntField( parent, label, minVal, maxVal, initialVal ); + YUI_CHECK_NEW( intField ); + + return intField; } @@ -208,7 +211,10 @@ NCMenuButton * NCWidgetFactory::createMenuButton( YWidget * parent, const string & label ) { - return 0; // FIXME: TO DO + NCMenuButton * menuButton = new NCMenuButton( parent, label ); + YUI_CHECK_NEW( menuButton ); + + return menuButton; } Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc?rev=41451&r1=41450&r2=41451&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Thu Oct 18 11:53:06 2007 @@ -340,30 +340,6 @@ /////////////////////////////////////////////////////////////////// // -// Widget creation functions - leaf widgets -// -/////////////////////////////////////////////////////////////////// - - -YWidget * YNCursesUI::createMenuButton( YWidget * parent, YWidgetOpt & opt, - const YCPString & label ) -{ - ONCREATE; - return new NCMenuButton( parent, opt, label ); -} - - -YWidget * YNCursesUI::createIntField( YWidget * parent, YWidgetOpt & opt, - const YCPString & label, - int minValue, int maxValue, - int initialValue ) -{ - ONCREATE; - return new NCIntField( parent, opt, label, minValue, maxValue, initialValue ); -} - -/////////////////////////////////////////////////////////////////// -// // package selection // /////////////////////////////////////////////////////////////////// Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h?rev=41451&r1=41450&r2=41451&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Thu Oct 18 11:53:06 2007 @@ -137,22 +137,6 @@ virtual void closeDialog( YDialog * dialog ); /** - * Creates a menu button. - * @param label Label of the button - */ - virtual YWidget * createMenuButton( YWidget * parent, YWidgetOpt & opt, - const YCPString & label ); - - - /** - * Creates an IntField widget. - */ - virtual YWidget * createIntField( YWidget * parent, YWidgetOpt & opt, - const YCPString & label, - int minValue, int maxValue, - int initialValue ); - - /** * Fills the PackageSelector widget. */ virtual YCPValue runPkgSelection( YWidget * packageSelector ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org