gibaf Posted January 13, 2015 Author Report Share Posted January 13, 2015 ola a todos primeiramente, muito obrigado a todos q responderam... a principio poderia, sim, utilizar o bKeyDown, com um pequeno detalhe (hehehe): no demo q fiz, usei a classe TGET, mas na app, eh usado a classe VGET. com a classe GET funciona perfeitamente, como preciso, mas com a classe VGET q eh a q vou ter usar, nao funciona o bKeyDown, tipo, nao executa a funcao ValidaGet(), dei um alert no _Key mas nao sae com o ENTER nem com o TAB: segue o bloco, com o VGET: #Include "FiveWin.ch" #Include "\Sistemas\Include\VGet.ch" *-------------- Function Main() *-------------- Private oFonGet := TFont():New("Ms Sans Serif",06,07 ,,.F.,,,,,,,,,,,,) Private oDlgMain DEFINE DIALOG oDlgMain From 00,00 to 540,795 TITLE "Teste." PIXEL COLORS CLR_WHITE,CLR_WHITE STYLE nOr(DS_MODALFRAME) @ 10,10 BUTTON "Faz Get" OF oDlgMain SIZE 100,30 PIXEL ACTION FazGet() ACTIVATE DIALOG oDlgMain Return(Nil) *----------------------- Static Function FazGet() *----------------------- Local oFonGet := TFont():New("Ms Sans Serif",06,07 ,,.F.,,,,,,,,,,,,) Private oDlg,oGet,oBtn,oGrp Private wVar := Space(15) , lCloseGet := .F. , lRetOk := .F. DEFINE DIALOG oDlg FROM 200,100 TO 300,400 PIXEL STYLE nOr( WS_POPUP, WS_VISIBLE ) OF oDlgMain @ 20,20 VGET oGet VAR wVar OF oDlg PIXEL SIZE 115,15 COLOR CLR_BLACK,CLR_WHITE FONT oFonGet oGet:bKeyDown := { | nKey | ValidaGet(nKey) } ACTIVATE DIALOG oDlg VALID lCloseGet ON INIT oDlg:oClient:=oGet //ON PAINT ValidaGet() hb_gcAll() Return(Nil) *------------------------------ Static Function ValidaGet(_Key) *------------------------------ Local lRet := .F. If _Key = 9 .or. _Key = 13 //9=Tab ; 13=Enter lRet := .T. // Faz a Validacao e retorna .T. ou .F. lRetOk := lRet MsgAlert( iif( lRet , "Valido" , "Invalido" ) ) If lRet lCloseGet := .T. oDlg:End() Endif Endif Return(lRet) SE alguem q usa o VGET puder me ajudar nisso, acho q resolvo de vez.... desde ja: MUITO OBRIGADO !!! Quote Link to comment Share on other sites More sharing options...
sambomb Posted January 13, 2015 Report Share Posted January 13, 2015 Verifica na vGet pois ela provavelmente já tem tratamento para as suas teclas Quote Link to comment Share on other sites More sharing options...
gibaf Posted January 13, 2015 Author Report Share Posted January 13, 2015 outra coisa... vamos dizer q seja usado (nao vai ser) o GET na validacao, mesmo lançando dados, onde esta em negrito, a variavel wVar esta vazio, mesmo dando refresh... e agora ???? #Include "FiveWin.ch" #Include "\Sistemas\Include\VGet.ch" *-------------- Function Main() *-------------- Private oFonGet := TFont():New("Ms Sans Serif",06,07 ,,.F.,,,,,,,,,,,,) Private oDlgMain DEFINE DIALOG oDlgMain From 00,00 to 540,795 TITLE "Teste." PIXEL COLORS CLR_WHITE,CLR_WHITE STYLE nOr(DS_MODALFRAME) @ 10,10 BUTTON "Faz Get" OF oDlgMain SIZE 100,30 PIXEL ACTION FazGet() ACTIVATE DIALOG oDlgMain Return(Nil) *----------------------- Static Function FazGet() *----------------------- Local oFonGet := TFont():New("Ms Sans Serif",06,07 ,,.F.,,,,,,,,,,,,) Private oDlg,oGet,oBtn,oGrp Private wVar := Space(15) , lCloseGet := .F. , lRetOk := .F. DEFINE DIALOG oDlg FROM 200,100 TO 300,400 PIXEL STYLE nOr( WS_POPUP, WS_VISIBLE ) OF oDlgMain @ 20,20 GET oGet VAR wVar OF oDlg PIXEL SIZE 115,15 COLOR CLR_BLACK,CLR_WHITE FONT oFonGet oGet:bKeyDown := { | nKey | ValidaGet(nKey) } ACTIVATE DIALOG oDlg VALID lCloseGet ON INIT oDlg:oClient:=oGet //ON PAINT ValidaGet() hb_gcAll() Return(Nil) *------------------------------ Static Function ValidaGet(_Key) *------------------------------ Local lRet := .F. If _Key = 9 .or. _Key = 13 //9=Tab ; 13=Enter //oGet:Refresh //SysRefresh() lRet := !Empty(Alltrim(wVar)) // Faz a Validacao e retorna .T. ou .F. lRetOk := lRet MsgAlert( iif( lRet , "Valido" , "Invalido" ) ) If lRet lCloseGet := .T. oDlg:End() Endif Endif Return(lRet) Quote Link to comment Share on other sites More sharing options...
gibaf Posted January 13, 2015 Author Report Share Posted January 13, 2015 Verifica na vGet pois ela provavelmente já tem tratamento para as suas teclas ola obrigado por responder... mas, verificar, onde exatamente ?? Quote Link to comment Share on other sites More sharing options...
Eduardo Bilato Posted January 13, 2015 Report Share Posted January 13, 2015 Boa tarde GIBAF Creio que o Samir quis dizer pra você dar uma olhada na pasta SOURCE, lá estão os PRGs das classes do FW Não conheço a vGet então não posso ajudá-lo =/ Quote Link to comment Share on other sites More sharing options...
sambomb Posted January 13, 2015 Report Share Posted January 13, 2015 ola obrigado por responder... mas, verificar, onde exatamente ?? Você tem o fonte da VGet para poder analisar? A equivalência para a TGET seria: PastaFW\Source\Classes\Tget.prg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.