Bug PICTURE "@R " - URGENTE - Antonio Linares

Post Reply
User avatar
ericmagaldi
Posts: 37
Joined: Tue Feb 20, 2007 9:26 am
Location: São Paulo - Brazil
Contact:

Bug PICTURE "@R " - URGENTE - Antonio Linares

Post by ericmagaldi »

Olá Antonio..

Percebi que ao selecionar o primeiro dígito (SHIFT + SETA) e inserir outro, bagunça a máscara na tela, e fazendo parte no valor da variável.

Code: Select all

  Exemplo:
   cSeek:=SPACE(08)
   @  7, 8 GET cCep PICTURE '@R 99.999-999"
Isso ocorre tanto @ get / ReDefine...

Mas uma que esse FiveWin me apronta...
virtually,
Éric
xHarbour.org + Borland C + FiveWin (2.8/6.12) + Pelles C + HBMake + ADSCDX
São Paulo - Brasil
http://xBaseSuporte.freeforums.org
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Éric,

This sample seems to work fine:

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg, cCep := SPACE( 8 )
    
   DEFINE DIALOG oDlg  
    
   @  2, 2 GET cCep PICTURE "@R 99.999-999"
   
   ACTIVATE DIALOG oDlg CENTERED

return nil
How to reproduce the error ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ericmagaldi
Posts: 37
Joined: Tue Feb 20, 2007 9:26 am
Location: São Paulo - Brazil
Contact:

Post by ericmagaldi »

Code: Select all

How to reproduce the error ?
É como descrevi:
Selecionar o primeiro dígito (SHIFT+Seta Direita), inserir outro.

Code: Select all

de: (antes deve selecionar o primeiro digito)
// @R 99.999-999
12.345-678 
ficará: (digitado o numeor 4)
4..45--78
virtually,
Éric
xHarbour.org + Borland C + FiveWin (2.8/6.12) + Pelles C + HBMake + ADSCDX
São Paulo - Brasil
http://xBaseSuporte.freeforums.org
User avatar
Maurilio Viana
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil
Contact:

Post by Maurilio Viana »

Antonio,

I don't tested it but what Eric says is:

When you use @R picture and select the text using shift key + right arrow characters from picture mask "mix" with the get value.
If you use "@R 99.999-999" picture and fill the get with "12345678" it will be (correctly) displayed to "12.345-679", but if you select the text with shift + right arrow the get value turn into the "4..45--78" ("." and "-" mix with get value).
I don't tryed it. I'm only translating what Eric wanted to say ;)

Regards!
Maurilio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurilio,

Thanks. Yes, we have confirmed the bug.

Its on our todo list to fix it asap.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
ericmagaldi
Posts: 37
Joined: Tue Feb 20, 2007 9:26 am
Location: São Paulo - Brazil
Contact:

Post by ericmagaldi »

Antonio Linares wrote:Thanks. Yes, we have confirmed the bug.

Its on our todo list to fix it asap.
Please Antonio,
what code used for fix.

I temporarily (quebra-galho), deny few keys:

Code: Select all

METHOD KeyDown( nKey, nFlags ) CLASS MGet

if ::oGet:Type='C' .and. ! EMPTY(::oGet:PICTURE) .and. ;
    (nKey == VK_LEFT .OR. nKey == VK_RIGHT .or. ;
    nKey == VK_END .or. nKey == VK_HOME) .and. ;
    GetKeyState( VK_SHIFT )

else
   Super:KeyDown( nKey, nFlags )

endif

return self

virtually,
Éric
xHarbour.org + Borland C + FiveWin (2.8/6.12) + Pelles C + HBMake + ADSCDX
São Paulo - Brasil
http://xBaseSuporte.freeforums.org
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Eric,

This seems to be a good fix for it:

Code: Select all

METHOD GetDelSel( nStart, nEnd ) CLASS TGet

   ::oGet:buffer = Left( ::oGet:buffer, Min( nEnd, nStart ) ) ;
                   + Right( ::oGet:buffer, ;
                            Len( ::oGet:buffer ) - Max( nEnd, nStart ) ) ;
                   + Space( Abs( nStart - nEnd ) )

   if ! Empty( ::oGet:Picture )         // New !
      ::SendMsg( WM_KILLFOCUS )  // New !
      ::SendMsg( WM_SETFOCUS )   // New !
   endif                                         // New ! 

   ::oGet:Assign()
   ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply