diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 82e7cbbbb7..ab892f6662 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,10 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-09-29 12:00 UTC+0700 Andi Jahja + * source/rtl/tget.prg + ! fixed get (value and display) involving negative (with decimal) + number whose value is less than 1. 2002-09-28 21:50 UTC-0300 Horacio Roldan * source/compiler/hbusage.c diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 6420e9f21b..3f6a1c9b5e 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -209,8 +209,6 @@ METHOD New( nRow, nCol, bVarBlock, cVarName, cPicture, cColorSpec ) CLASS Get #ifdef HB_COMPAT_C53 ::Caption := "" #endif - - return Self //---------------------------------------------------------------------------// @@ -353,9 +351,14 @@ return Self METHOD Display( lForced ) CLASS Get local nOldCursor := SetCursor( SC_NONE ) + local xbuffer := ::buffer DEFAULT lForced TO .t. + if !Empty(::DecPos ) .and. ::minus .and. !( "-" $ xbuffer ) + xbuffer := space(::DecPos-2) + "-." + substr(::buffer,::Decpos+1) + endif + if ::HasScroll() .and. ::Pos != NIL if ::nDispLen > 8 ::nDispPos := Max( 1, Min( ::Pos - ::nDispLen + 4, ::nMaxLen - ::nDispLen + 1 ) ) @@ -364,9 +367,9 @@ METHOD Display( lForced ) CLASS Get endif endif - if ::buffer != NIL .and. ( lForced .or. ( ::nDispPos != ::nOldPos ) ) + if xbuffer != NIL .and. ( lForced .or. ( ::nDispPos != ::nOldPos ) ) DispOutAt( ::Row, ::Col + if( ::cDelimit == NIL, 0, 1 ),; - Substr( ::buffer, ::nDispPos, ::nDispLen ), ; + Substr( xbuffer, ::nDispPos, ::nDispLen ), ; hb_ColorIndex( ::ColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) if !(::cDelimit == NIL) DispOutAt( ::Row, ::Col, Substr( ::cDelimit, 1, 1), hb_ColorIndex( ::ColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) @@ -407,6 +410,8 @@ METHOD End() CLASS Get ::Display( .f. ) endif + ::minus := NIL + return Self //---------------------------------------------------------------------------// @@ -472,7 +477,9 @@ METHOD SetFocus() CLASS Get if ::type == "N" ::decpos := At( iif( ::lDecRev .or. "E" $ ::cPicFunc, ",", "." ), ::buffer ) - ::minus := ( ::VarGet() < 0 ) + if !::minus + ::minus := ( ::VarGet() < 0 ) + endif else ::decpos := NIL ::minus := .f. @@ -571,7 +578,9 @@ METHOD Untransform( cBuffer ) CLASS Get case ::type == "N" - ::minus := .f. + if !::minus + ::minus := .f. + endif if "X" $ ::cPicFunc if Right( cBuffer, 2 ) == "DB" ::minus := .t. @@ -1004,6 +1013,7 @@ METHOD Input( cChar ) CLASS Get do case case cChar == "-" + ::minus := .t. /* The minus symbol can be write in any place */ case cChar $ ".," @@ -1167,7 +1177,6 @@ METHOD PutMask( xValue, lEdit ) CLASS Get endif endif - If ::type == "D" .and. ::BadDate cBuffer := ::Buffer Endif @@ -1274,7 +1283,7 @@ METHOD DeleteAll() CLASS Get ::minus := .f. case ::type == "D" xValue := CToD( "" ) - ::BadDate := .f. + ::BadDate := .f. case ::type == "L" xValue := .f. endcase