Bug in TGet with latest xHarbour from CVS

Bug in TGet with latest xHarbour from CVS

Postby Enrico Maria Giordano » Mon Jan 15, 2007 4:50 pm

This is the sample. Try pressing a digit and you will get the separator dots on the GET.

Code: Select all  Expand view  RUN
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL nVar := 0

    DEFINE DIALOG oDlg

    @ 0, 0 GET nVar;
           PICTURE "@EZ 999,999.99";
           RIGHT

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TGet with latest xHarbour from CVS

Postby Enrico Maria Giordano » Mon Jan 15, 2007 10:24 pm

It is a bug in xHarbour's GET class:

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    LOCAL GetList := {}

    LOCAL nVar1 := 0
    LOCAL nVar2 := 0

    CLS

    @ 10, 10 GET nVar1;
             PICTURE "@EZ 999,999.99";
             WHEN ( GetList[ 1 ]:Picture := "@EZ  999999.99", .T. );
             VALID ( GetList[ 1 ]:Picture := "@EZ 999,999.99", .T. )

    @ 12, 10 GET nVar2;
             PICTURE "@EZ 999,999.99"

    READ

    RETURN NIL


Already reported to xHarbour developers list.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Nop » Tue Jan 16, 2007 12:45 am

Enrico, this is after or before this entry:

2007-01-07 16:45 UTC-0300 Eduardo Fernandes <modalsist@yahoo.com.br>
258 * source/rtl/tget.prg
259 ! fixed parsepict() method to avoid replacing commas by spaces, in
260 pictures like @Z 99,999.99.
261 Adjusted get len for negative numbers, when not exist picture on get.
User avatar
Nop
 
Posts: 107
Joined: Tue Apr 11, 2006 4:36 pm
Location: Uberaba/Brazil

Postby Antonio Linares » Tue Jan 16, 2007 3:00 am

Enrico,

> Already reported to xHarbour developers list.

Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Jan 16, 2007 7:52 am

Nop wrote:Enrico, this is after or before this entry:

2007-01-07 16:45 UTC-0300 Eduardo Fernandes <modalsist@yahoo.com.br>
258 * source/rtl/tget.prg
259 ! fixed parsepict() method to avoid replacing commas by spaces, in
260 pictures like @Z 99,999.99.
261 Adjusted get len for negative numbers, when not exist picture on get.


Thank you.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Randal » Sat Jan 27, 2007 6:53 am

Enrico,

I have a problem when pressing . to enter numbers to the right of the decimal and the original number to the left of the decimal is not cleared.

For example, I have a number 123.45. If I press .67 the 123 remains and the .67 is entered over the .45. The old behaviour was to clear the all the digits to the left of the decimal so that the result was only 0.67.

Do you get the same behaviour? I'm using PICTURE "9999.99". It seems to be a problem with latest xHarbour Jan 07 and FWH.

Thanks,
Randal Ferguson
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Enrico Maria Giordano » Sat Jan 27, 2007 12:41 pm

Please show a self-contained sample of the problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Randal » Sat Jan 27, 2007 3:34 pm

Enrico,

Thanks for the reply. I was simply compiling a small FWH sample to test. This sample works when compiled with FWH and xBuilder Mar06 but with xBuilder Oct 06 and Jan 07 I get the behaviour I described.

Thanks,
Randal Ferguson

// Testing GETs

#include "FiveWin.ch"

function Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := "Test 2"

Set century On
Set Date Ansi
Set Date format "mm/dd/yyyy"

SET _3DLOOK ON

msginfo("testget")

DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet VAR cCad OF oDlg SIZE 60, 10 // COLOR "W/G"
@ 1.8, 2 SAY "Number:" OF oDlg
@ 2, 6 GET oGet VAR nNum OF oDlg SIZE 60, 10 PICTURE "9999999.99"
@ 2.6, 2 SAY "Date:" OF oDlg
@ 3, 6 GET oGet VAR dDat OF oDlg SIZE 60, 10 // WHEN .f. // "@D"
oGet:lDisColors = .f. // don't use standard disabled colors
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL

ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "Want to end ?" )

return nil

//------------------------------------------------------------------------//

procedure appsys
return
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Enrico Maria Giordano » Sat Jan 27, 2007 4:27 pm

Confirmed. Just reported to the xHarbour developers list with the following sample:

Code: Select all  Expand view  RUN
#include "Inkey.ch"


FUNCTION MAIN()

    LOCAL GetList := {}

    LOCAL nVar := 123.45

    SETKEY( K_F2, { || GetList[ 1 ]:ToDecPos() } )

    CLS

    @ 10, 10 GET nVar;
             PICTURE "@E 999.99"

    READ

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sat Jan 27, 2007 5:06 pm

Enrico,

Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Randal » Sat Jan 27, 2007 7:02 pm

Enrico,

Thanks alot! I really appreciate you taking the time to look at this.

Best Regards,
Randal Ferguson
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Enrico Maria Giordano » Tue Jan 30, 2007 10:59 am

The bug has been fixed but the result is not what you expected. Now the xHarbour GET class behavior is Clipper compatible but you have to change FWH TGet class to get the same behavior:

Code: Select all  Expand view  RUN
if ::oGet:Type == "N" .and. ;
   ( Chr( nKey ) == "." .or. Chr( nKey ) == "," )
   if ::oGet:Clear   // EMG
      ::oGet:DelEnd()   // EMG
   endif   // EMG
   ::oGet:ToDecPos()
else


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Jan 30, 2007 11:28 am

Enrico,

Does your change work fine with Harbour too ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Jan 30, 2007 12:00 pm

Antonio Linares wrote:Enrico,

Does your change work fine with Harbour too ? thanks


Yes, it seems so.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Jan 30, 2007 12:03 pm

Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42121
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests