una corrección

Post Reply
fleal
Posts: 234
Joined: Tue Oct 25, 2005 12:39 am
Location: México, DF

una corrección

Post by fleal »

Antonio,

Con el último build obtengo este error.
El bkeydown se evalua dos veces, en mi caso he optado por tomar el tget.prg de la FW712 y he comentado las lineas para evitar que truene.
con ésta modificación hecha funciona bien.

METHOD KeyDown( nKey, nFlags ) CLASS TGet

local nHi, nLo, nPos, nLastHi := -1


::nLastKey = nKey

// if ::bKeyDown != nil

// if Eval( ::bKeyDown, nKey, nFlags, Self ) == 0
// return 0
// endif
//
// endif

do case
case nKey == VK_UP



Este es el error

Application
===========
Path and name: E:\ap\Captura\Digital.exe (32 bits)
Size: 2,400,768 bytes
Time from start: 0 hours 0 mins 23 secs
Error occurred at: 03/12/2007, 18:45:17
Error description: Error BASE/1070 Argument error: ==
Args:
[ 1] = L .T.
[ 2] = N 0

Stack Calls
===========
Called from: Digital.prg => TGET:KEYDOWN(677)
Called from: Digital.prg => TGETFER:KEYDOWN(159)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: Digital.prg => TGET:HANDLEEVENT(486)
Called from: Digital.prg => TGETFER:HANDLEEVENT(82)
Called from: WINDOW.PRG => _FWH(0)
Called from: => DIALOGBOX(0)
Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
Called from: DSuper.prg => DOBLECAPTURA(2388)
Called from: DSuper.prg => (b)DSUPER(189)
Called from: Digital.prg => TGETFER:LVALID(1002)
Called from: CONTROL.PRG => TGETFER:FWLOSTFOCUS(0)
Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: Digital.prg => TGET:HANDLEEVENT(486)
Called from: Digital.prg => TGETFER:HANDLEEVENT(82)
Called from: WINDOW.PRG => _FWH(0)
Called from: => SYSREFRESH(0)



Fernando Leal
México, DF
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Fernando,

Es que hay que modificar ::bKeyDown para que devuelva cero ó nil

pero vamos a modificar la clase para mantener compatibilidad con el código anterior :-)
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 »

Fernando,

Code: Select all

   if ::bKeyDown != nil
      if ValType( uVal := Eval( ::bKeyDown, nKey, nFlags, Self ) ) == "N" .and. ;
         uVal == 0
         return 0
      endif   
   endif   
Como al final se llama a Super:KeyDown() se debe estar llamando dos veces a bKeyDown. A ver como lo solucionamos. Gracias!
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 »

Fernando,

En window.prg hay que modificar esto en el método KeyDown:

Code: Select all

   if Upper( ::ClassName() ) != "TGET" .and. ::bKeyDown != nil
      return Eval( ::bKeyDown, nKey, nFlags )
   endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
fleal
Posts: 234
Joined: Tue Oct 25, 2005 12:39 am
Location: México, DF

Gracias

Post by fleal »

Antonio,

Mil Gracias!!!

Fernando
Post Reply