[yast-commit] r41137 - in /branches/tmp/sh/mod-ui/ncurses/src: NCInputField.cc NCInputField.h
Author: gs Date: Thu Sep 27 15:25:06 2007 New Revision: 41137 URL: http://svn.opensuse.org/viewcvs/yast?rev=41137&view=rev Log: remove obsolete getText/setText, add params maxInput, maxFld Modified: branches/tmp/sh/mod-ui/ncurses/src/NCInputField.cc branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h Modified: branches/tmp/sh/mod-ui/ncurses/src/NCInputField.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCInputField.cc?rev=41137&r1=41136&r2=41137&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCInputField.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCInputField.cc Thu Sep 27 15:25:06 2007 @@ -39,15 +39,17 @@ // NCInputField::NCInputField( YWidget * parent, const string & nlabel, - bool passwordMode ) + bool passwordMode, + unsigned maxInput, + unsigned maxFld ) : YInputField( parent, nlabel, passwordMode ) , NCWidget( parent ) , mayedit( true ) , passwd( passwordMode ) , lwin( 0 ) , twin( 0 ) - , maxFldLength ( 0 ) - , maxInputLength( 0 ) + , maxFldLength ( maxFld ) + , maxInputLength( maxInput ) , fldstart ( 0 ) , fldlength( 0 ) , curpos ( 0 ) @@ -87,19 +89,6 @@ WIDDBG << endl; } -/////////////////////////////////////////////////////////////////// -// -// -// METHOD NAME : NCInputField::nicesize -// METHOD TYPE : long -// -// DESCRIPTION : -// -long NCInputField::nicesize( YUIDimension dim ) -{ - return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H; -} - int NCInputField::preferredWidth() { return wGetDefsze().W; @@ -218,25 +207,6 @@ /////////////////////////////////////////////////////////////////// // // -// METHOD NAME : NCInputField::setText -// METHOD TYPE : void -// -// DESCRIPTION : -// -void NCInputField::setText( const YCPString & ntext ) -{ - buffer = NCstring( ntext ).str(); - if ( maxInputLength && buffer.length() > maxInputLength ) { - buffer = buffer.erase( maxInputLength ); - } - fldstart = 0; - curpos = buffer.length(); - tUpdate(); -} - -/////////////////////////////////////////////////////////////////// -// -// // METHOD NAME : NCInputField::setValue // METHOD TYPE : void // @@ -271,22 +241,6 @@ /////////////////////////////////////////////////////////////////// // // -// METHOD NAME : NCInputField::getText -// METHOD TYPE : YCPString -// -// DESCRIPTION : -// -YCPString NCInputField::getText() - -{ - NCstring text( buffer ); - - return text.YCPstr(); -} - -/////////////////////////////////////////////////////////////////// -// -// // METHOD NAME : NCInputField::setValidChars // METHOD TYPE : void // Modified: branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h?rev=41137&r1=41136&r2=41137&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h Thu Sep 27 15:25:06 2007 @@ -91,15 +91,16 @@ public: NCInputField( YWidget * parent, - const string & label, - bool passwordMode ); + const string & label, + bool passwordMode = false, + unsigned maxInput = 0, + unsigned maxFld = 0 + ); virtual ~NCInputField(); void setFldtype( FTYPE t ) { fldtype = t; } void setReturnOnReturn( bool on_br ) { returnOnReturn_b = on_br; } - virtual long nicesize( YUIDimension dim ); - virtual int preferredWidth(); virtual int preferredHeight(); @@ -112,17 +113,13 @@ virtual void setLabel( const string & nlabel ); - virtual void setText( const YCPString & ntext ); - virtual YCPString getText(); - - virtual void setValue( const std::string & ntext ); // new for setText() - virtual string value(); // new for getText() + virtual void setValue( const std::string & ntext ); + virtual string value(); virtual void setValidChars( const string & validchars ); 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
participants (1)
-
gs@svn.opensuse.org