oGet : bGotFocus := { || oGet : nPos := 1 }
santidedos wrote:Cómo estás? No lo pude hacer andar
// \samples\JOSE.PRG
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL oDlg, oGet1, oGet2, cGet1 := "Jose Alvarez ", ;
cGet2:= "Cambiando Foco de Jose"
LOCAL lCambiaJose := .F., aGrad, oClp
aGrad := { { 0.30, CLR_WHITE, CLR_WHITE },{ 0.50, CLR_WHITE, CLR_WHITE } }
DEFINE DIALOG oDlg SIZE 400, 300 GRADIENT aGrad
oDlg:lHelpIcon := .F.
DEFINE CLIPBOARD oClp OF oDlg
@ 3, 1 GET oGet1 VAR cGet1 OF oDlg SIZE 100, 12 PICTURE "@K" UPDATE ;
VALID ( MsgInfo( "Valor antes del LostFocus " + cGet1), .T. )
// Bloquear PASTE y CTRL+V en un GET
oGet1:bGotFocus := { || oClp:SetText( '' ) }
oGet1:bChange = { || lCambiaJose := .T. }
oGet1:bLostFocus := { || If( lCambiaJose, Jose_Focus( oGet1 ), .T. ) }
@ 5, 1 GET oGet2 VAR cGet2 OF oDlg SIZE 100, 12 PICTURE "@!" UPDATE
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT( oGet1:bGotFocus := { || oGet1:SetPos( 0 ), Nil }, ;
oGet1:SetFocus() )
RETURN NIL
FUNCTION Jose_Focus( oGet1 )
LOCAL cTxtJose
cTxtJose := oGet1:cText
// MsgInfo( "FiveWin The Best: " + cTxtJose )
oGet1:bGotFocus := { || oGet1:SetPos( 0 ), Nil }
oGet1:SetFocus()
RETURN( .T. )
// FIN / END
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 38 guests