xBrowse

Post Reply
Mike Serra
Posts: 287
Joined: Fri Apr 14, 2006 5:52 pm
Location: Córdoba (España)

xBrowse

Post by Mike Serra »

tengo un xbrowse en una ventana y no se porque capturando el metodo
bkeydown me ejecuta el resultado 2 veces, es decir:

Code: Select all

...
...
 ::oBrowse:bKeydown:={|nkey|press_on_browse(nKey,self)}
...
...

function press_on_browse(nKey,self)
        do case 
            case nkey = VK_F2 .and. ::lInsertButton
                ::lInsertMode:=.t.
                ::lModifyMode:=.f.
                ::Insert() 
            case nkey = VK_F3 .and. ::lModifyButton
                ::lInsertMode:=.f.
                ::lModifyMode:=.t.
                ::Modify() 
            case nkey = VK_F4 .and. ::lDeleteButton
                ::Delete() 
            case nkey = VK_F5 .and. ::lSearchButton
                ::Search() 
            case nkey = VK_F6 .and. ::lListButton
                ::List()
            case nkey = VK_ESCAPE 
                ::Destroy() 
        end case
return
con este código, si pulso sobre F2 entra 2 veces en Insert()

¿Que puede ser?

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

Post by Antonio Linares »

Mike,

En la Clase TXBrowse realiza esta modificación:

Code: Select all

METHOD KeyDown( nKey, nFlags ) CLASS TXBrowse

   if ::bKeyDown != nil
      Eval( ::bKeyDown, nKey, nFlags )
      return nil
   endif   

   ...
regards, saludos

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

Post by Antonio Linares »

Mike,

Mejor, preferiblemente, elimina esas líneas:

Code: Select all

   if ::bKeyDown != nil
      Eval( ::bKeyDown, nKey, nFlags )
   endif   
regards, saludos

Antonio Linares
www.fivetechsoft.com
Mike Serra
Posts: 287
Joined: Fri Apr 14, 2006 5:52 pm
Location: Córdoba (España)

Post by Mike Serra »

Funcionó correctamente, Gracias Antonio :)
Post Reply