Sr. Antonio - possivel bug na classe TGET

Sr. Antonio - possivel bug na classe TGET

Postby MGA » Fri Sep 10, 2010 12:13 pm

Sr. Antonio,

Se o OBJ do GET estiver com foco e teclar F3(obtn:click()) o sistema não valida o GET.

Ex. digite -1 no get do exemplo abaixo e tecle F3.

function Main()
local oDlg, oGet1, n1 := 0, OBTN
DEFINE DIALOG oDlg TITLE "Testing Gets"

@ 1, 1 GET oGet1 VAR n1 SIZE 80, 11 VALID n1>=0
@ 3, 11 BUTTON OBTN PROMPT "Ok" ACTION (MSGINFO("TECLANDO F3 NAO VALIDA O GET"))

odlg:bkeydown:={|nkey| if(nkey==VK_F3,obtn:click(),) }

ACTIVATE DIALOG oDlg CENTERED
return nil
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1249
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Sr. Antonio - possivel bug na classe TGET

Postby Antonio Linares » Mon Sep 13, 2010 11:14 am

Ubiratan,

En tu ejemplo estas llamando directamente al método Click() del botón por lo que no le das opción a poder validar nada. Es decir, le estas "ordenando" que ejecute la acción.

Cambia estas líneas y verás como funciona bien :-)

@ 1, 1 GET oGet1 VAR n1 SIZE 80, 11 VALID n1 > 0

y

odlg:bkeydown:={|nkey| if(nkey==VK_F3,obtn:setfocus(),) }
regards, saludos

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

Re: Sr. Antonio - possivel bug na classe TGET

Postby MGA » Mon Sep 13, 2010 12:56 pm

Sr. Antonio,

O que eu preciso é:

Quando o usuário teclar F3 já executar ação do botão, do jeito que o senhor me falou, o usuário teria que teclar F3 e depois ENTER.

function Main()
local oDlg, oGet1, n1 := 0, OBTN
DEFINE DIALOG oDlg TITLE "Testing Gets"

@ 1, 1 GET oGet1 VAR n1 SIZE 80, 11 VALID n1>=0
@ 3, 11 BUTTON OBTN PROMPT "F3-OK" ACTION (MSGINFO("TECLANDO F3 NAO VALIDA O GET"))

odlg:bkeydown:={|nkey| if(nkey==VK_F3,(obtn:setfocus(),obtn:click()),) }

ACTIVATE DIALOG oDlg CENTERED
return nil
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1249
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Sr. Antonio - possivel bug na classe TGET

Postby Antonio Linares » Mon Sep 13, 2010 8:02 pm

Prueba asi:

odlg:bkeydown:={|nkey| if(nkey==VK_F3 .and. oGet1:lValid(), obtn:click(),) }
regards, saludos

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

Re: Sr. Antonio - possivel bug na classe TGET

Postby MGA » Tue Sep 14, 2010 11:06 am

Sr. Antonio,

odlg:bkeydown:={|nkey| if(nkey==VK_F3 .and. oGet1:lValid(), obtn:click(),) }

Assim funciona
:D
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1249
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Sr. Antonio - possivel bug na classe TGET

Postby Antonio Linares » Tue Sep 14, 2010 12:07 pm

bien! :-)
regards, saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 50 guests