From 1c3e9b14ca89c7ce1e09e7ed1a667fd6dcd45ad1 Mon Sep 17 00:00:00 2001 From: Walter Negro Date: Thu, 21 Feb 2002 06:01:09 +0000 Subject: [PATCH] 2002-02-21 06:00 UTC-0300 Walter Negro METHOD ::ParsePict() - The change is because if ::Original it is not numeric, it would generate an error. METHOD ::Undo() - Delete assignment to ::buffer because ::VarPut( ::Original, .t. ) makes this assignment. METHOD ::VarPut() - Delete ::nDispLen := NIL line, because ::Picture() makes this assignment. - Revert changes of Ignacio Ortiz because the problem was with ::nDispLen and not with empty cPicture. METHOD ::Block() - Delete ::nDispLen := NIL line, because ::Picture() makes this assignment. METHOD ::Picture() - Add ::nDispLen := NIL line, reset the variable. Only ::ParsePict() can load a value that can differ of nMaxLen. METHOD ::KillFocus() - Change position of lines, hasfocus should be before the call to Putmask. This makes that in numeric fields, points or comas are not shown before the numbers. --- harbour/source/rtl/tget.prg | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 1cb5113d7c..99dc7d1dd0 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -268,7 +268,7 @@ METHOD ParsePict( cPicture ) CLASS Get case ::type == "N" - cNum := Str( ::Original ) + cNum := Str( ::VarGet() ) if ( nAt := At( iif( ::lDecRev, ",", "." ), cNum ) ) > 0 ::cPicMask := Replicate( '9', nAt - 1 ) + iif( ::lDecRev, ",", "." ) ::cPicMask += Replicate( '9', Len( cNum ) - Len( ::cPicMask ) ) @@ -384,9 +384,8 @@ return Self METHOD Undo() CLASS Get if ::hasfocus - ::buffer := ::PutMask( ::original ) + ::VarPut( ::Original, .t. ) ::pos := 1 - ::VarPut( ::Original, .f. ) endif return Self @@ -431,8 +430,8 @@ METHOD KillFocus() CLASS Get ::Assign() - ::buffer := ::PutMask() ::hasfocus := .f. + ::buffer := ::PutMask() ::pos := NIL ::Display() @@ -452,10 +451,7 @@ METHOD VarPut( xValue, lReFormat ) CLASS Get ::Original := xValue endif ::Type := ValType( xValue ) - ::nDispLen := NIL - if !Empty( ::cPicture ) - ::Picture( ::cPicture ) - endif + ::Picture( ::cPicture ) endif endif @@ -1192,6 +1188,8 @@ METHOD Picture( cPicture ) CLASS Get if cPicture != NIL + ::nDispLen := NIL + ::cPicture := cPicture ::ParsePict( cPicture ) @@ -1225,9 +1223,9 @@ METHOD Block( bBlock ) CLASS Get ::Original := ::VarGet() ::Type := ValType( ::Original ) - ::nDispLen := NIL ::Picture( ::Picture ) endif return ::bBlock +