oApp():oGrid:bKeyDown := {|nKey| PrTecla(nKey,oApp():oGrid,oCont,oApp():oDlg) }
- Code: Select all Expand view
function PrTecla(nKey,oGrid,oCont,oDlg)
Do case
case nKey==VK_RETURN
PrEdita(oGrid,2,oCont,oDlg)
case nKey==VK_INSERT
PrEdita(oGrid,1,oCont,oDlg)
case nKey==VK_DELETE
PrBorra(oGrid,oCont)
case nKey==VK_ESCAPE
oDlg:End()
otherwise
if nKey >= 96 .AND. nKey <= 105
PrBusca(oGrid,STR(nKey-96,1),oCont,oDlg)
if HB_ISSTRING(CHR(nKey))
PrBusca(oGrid,CHR(nKey),oCont,oDlg)
endif
EndCase
return nil
If the user press control it make error bgotfocus
the error
- Code: Select all Expand view
Application
===========
Path and name: C:\work\PRG\Libri\Libri.Exe (32 bits)
Size: 3,630,080 bytes
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6715)
FiveWin Version: FWHX 12.03
Windows version: 5.1, Build 2600 Service Pack 2
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 04-12-2012, 12:18:45
Error description: Error BASE/1005 Class: 'NIL' has no property: BGOTFOCUS
Args:
[ 1] = U
[ 2] = B {|| ... }
Stack Calls
===========
Called from: => _BGOTFOCUS( 0 )
Called from: source\PProveed.prg => PRBUSCA( 995 )
Called from: source\PProveed.prg => PRTECLA( 803 )
Called from: source\PProveed.prg => (b)PROVEEDORES( 104 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:KEYDOWN( 2610 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:KEYDOWN( 1019 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYDOWN( 2201 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1700 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11632 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 980 )
Called from: source\main.prg => TAPPLICATION:ACTIVATE( 363 )
Called from: source\main.prg => MAIN( 58 )
Any solution ?