TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 7:38 am
Dear Antonio,
Not run
on tled class I insert on new method
if ! Empty( ::oWnd:hWnd )
::Create()
::Default()
::oWnd:AddControl( Self )
else
::oWnd:DefControl( Self )
endif
IF ::lBlink
DEFINE TIMER ::oTmr INTERVAL ::nInterval ACTION ::Blink() OF self
Endif
on Paint method at the init I Insert
IF ::lBlink
IF !::oTmr=NIL
::lStatus:=.t.
::oTmr:Activate()
ENDIF
ENDIF
and this is the blink method
METHOD Blink() CLASS TLED
Local nOpen:= ::nColorLedON
Local nClose:= ::nColorLedOFF
if ::lStatus
::nColorLedON := nClose
else
::nColorLedON := nOpen
endif
::Refresh()
::lStatus := ! ::lStatus
return NIL
I saw when the timer in active the color is before 8388608 and the is nil and it continue
I insert at init on Paint method this line :
::nColorLedON := IIF (::lBlink,::Blink(),::nColorLedON)
It seem to run but the when the lstatus is .f. it not put the right color but NIL
and ::oTmr is allways NIL
Not run
on tled class I insert on new method
if ! Empty( ::oWnd:hWnd )
::Create()
::Default()
::oWnd:AddControl( Self )
else
::oWnd:DefControl( Self )
endif
IF ::lBlink
DEFINE TIMER ::oTmr INTERVAL ::nInterval ACTION ::Blink() OF self
Endif
on Paint method at the init I Insert
IF ::lBlink
IF !::oTmr=NIL
::lStatus:=.t.
::oTmr:Activate()
ENDIF
ENDIF
and this is the blink method
METHOD Blink() CLASS TLED
Local nOpen:= ::nColorLedON
Local nClose:= ::nColorLedOFF
if ::lStatus
::nColorLedON := nClose
else
::nColorLedON := nOpen
endif
::Refresh()
::lStatus := ! ::lStatus
return NIL
I saw when the timer in active the color is before 8388608 and the is nil and it continue
I insert at init on Paint method this line :
::nColorLedON := IIF (::lBlink,::Blink(),::nColorLedON)
It seem to run but the when the lstatus is .f. it not put the right color but NIL
and ::oTmr is allways NIL