Page 1 of 1

Daniel Garcia - TGET, ACTION, VALID problema? (RESOLVIDO)

Posted: Thu Jul 08, 2010 11:56 am
by MGA
Daniel,

Referente ao código abaixo:

redefine get oget[1] var n1 id 100 of odlg picture "99" valid !empty(n1) bitmap "LUPA" action(msg("lupa get 1"))
redefine get oget[2] var n2 id 101 of odlg picture "99" valid !empty(n3) bitmap "LUPA" action(msg("lupa get 2"))

Foco no GET[1], se eu clicar no botão do GET[2], o VALID do GET[1] não é executado.
Acredito que o problema ocorre porque no:


METHOD CreateButton() CLASS TGet
...
::oBtn:lCancel = .T. // so the GET VALID is not fired when the button is focused

Porem se eu comentar o código, ex:

//::oBtn:lCancel = .T.

O VALID do GET[1] não me deixa clicar no botão do proprio GET[1].

Como resolver esta situação?

Obrigado

Re: Daniel Garcia - TGET, ACTION, VALID problema?

Posted: Thu Jul 08, 2010 12:14 pm
by MGA
RESOLVIDO ASSIM:

METHOD CreateButton() CLASS TGet
...
// Passei a controlar em GOTFOCUS/LOSTFOCUS
//::oBtn:lCancel = .T. // so the GET VALID is not fired when the button is focused

METHOD LostFocus( hCtlFocus ) CLASS TGet
if ::oBtn != nil
::oBtn:lCancel = .F. // so the GET VALID is not fired when the button is focused
endif

METHOD GotFocus( hCtlLost ) CLASS TGet
if ::oBtn != nil
::oBtn:lCancel = .T. // so the GET VALID is not fired when the button is focused
endif
Não sei se é a melhor maneira. :D

Obrigado

Re: Daniel Garcia - TGET, ACTION, VALID problema? (RESOLVIDO)

Posted: Thu Jul 08, 2010 1:56 pm
by Daniel Garcia-Gil
SGS


Bien :D :D