Quando executo o exemplo abaixo, toda vez que teclo "barra de espaço", no campo em foco aparece o numero "1", porque ?
Code: Select all
#include "FiveWin.ch"
function Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := Date()
local nScrlMouse := WheelScroll()
SetWheelScroll( 1 )
Set century On
Set Date Ansi
Set Date format "mm/dd/yyyy"
SET _3DLOOK ON
DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet VAR cCad OF oDlg SIZE 60, 10 COLOR "W/G" PICTURE "@X40"
@ 1.8, 2 SAY "Number:" OF oDlg
@ 2, 6 GET oGet VAR nNum OF oDlg SIZE 60, 10 PICTURE "9999999.99"
@ 2.6, 2 SAY "Date:" OF oDlg
@ 3, 6 GET oGet VAR dDat PICTURE "@E" OF oDlg SIZE 60, 10 // "@D"
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
return nil
********************
function WheelScroll( lRefresh )
********************
#ifndef HKEY_CURRENT_USER
#define HKEY_CURRENT_USER 2147483649 // 0x80000001
#endif
static nScrLines && := nil
local oReg
DEFAULT lRefresh := .F.
*return 1 && Se tirar o comentario desta linha, volta a funcionar normal
if lRefresh
nScrLines := nil
endif
if nScrLines == nil
oReg := TReg32():New( HKEY_CURRENT_USER, "Control Panel\Desktop" )
nScrLines := oReg:Get( "WheelScrollLines" )
oReg:Close()
if Empty( nScrLines )
nScrLines := 1
else
nScrLines := Val( nScrLines )
endif
endif
return nScrLines
***********************
function SetWheelScroll( nScrLines )
***********************
#ifndef HKEY_CURRENT_USER
#define HKEY_CURRENT_USER 2147483649 // 0x80000001
#endif
local oReg
DEFAULT nScrLines := 1
oReg := TReg32():New( HKEY_CURRENT_USER, "Control Panel\Desktop" )
oReg:Set( "WheelScrollLines", alltrim(str(nScrLines)) )
oReg:Close()
return WheelScroll( .T. )