FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xBrowse
Posts: 297
Joined: Fri Apr 14, 2006 05:52 PM
xBrowse
Posted: Thu May 03, 2007 10:19 AM
tengo un xbrowse en una ventana y no se porque capturando el metodo
bkeydown me ejecuta el resultado 2 veces, es decir:

...
...
 ::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!!
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
xBrowse
Posted: Thu May 03, 2007 10:57 AM
Mike,

En la Clase TXBrowse realiza esta modificación:
METHOD KeyDown( nKey, nFlags ) CLASS TXBrowse

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

   ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
xBrowse
Posted: Thu May 03, 2007 10:59 AM
Mike,

Mejor, preferiblemente, elimina esas líneas:
   if ::bKeyDown != nil
      Eval( ::bKeyDown, nKey, nFlags )
   endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 297
Joined: Fri Apr 14, 2006 05:52 PM
xBrowse
Posted: Thu May 03, 2007 11:34 AM

Funcionó correctamente, Gracias Antonio :)

Continue the discussion