Jump to content
Fivewin Brasil

Alguém pode me ajudar nisso, por favor ???


gibaf

Recommended Posts

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 !!!

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...