TO ANTONIO HELP FOR BLINK

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

TO ANTONIO HELP FOR BLINK

Post by Silvio.Falconi »

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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TO ANTONIO HELP FOR BLINK

Post by Antonio Linares »

Silvio,

In your code, Activate the timer right after creating it:

DEFINE TIMER ...

ACTIVATE TIMER ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Post by Silvio.Falconi »

I modify on New method
IF ::lBlink
DEFINE TIMER ::oTmr INTERVAL ::nInterval ACTION ::Blink() OF self
ACTIVATE TIMER ::oTmr
ENDIF

but not run also

the procedure not activate the time and not change the colors of Leds
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Post by Silvio.Falconi »

...
Last edited by Silvio.Falconi on Fri Apr 08, 2016 9:05 am, edited 1 time in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Post by Silvio.Falconi »

I modify now:
DATA oOut READONLY
DATA nTime READONLY AS NUMERIC INIT 0
METHOD Initiate( hDlg ) INLINE Super:Initiate( hDlg ), ::Default()

on New method
if ! Empty( ::oWnd:hWnd )
::Create()
::oWnd:AddControl( Self )
else
::oWnd:DefControl( Self )
endif

on Default method
IF ::lBlink
DEFINE TIMER ::oOut INTERVAL ::nInterval OF ::oWnd ACTION ( ::nTime ++,::Blink())
ACTIVATE TIMER ::oOut
ENDIF


Now on interval change the color but then not return that was before!!
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TO ANTONIO HELP FOR BLINK

Post by Antonio Linares »

Silvio,

If you don't know how to fix your code, post your class source code here and we will test it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Post by Silvio.Falconi »

ok , but I wish finish it . on myself then, as I sad to you in private mail, I can publish the class.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TO ANTONIO HELP FOR BLINK

Post by Antonio Linares »

Silvio,

if you plan to share it, why don't you share it now so others can help you ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fafi
Posts: 169
Joined: Mon Feb 25, 2008 2:42 am

Re: TO ANTONIO HELP FOR BLINK

Post by fafi »

Hello..

If you don't mind please test this..

Thank you
Best Regards
Fafi

Code: Select all

#include "fivewin.ch"

static oTimer, oSay , lOn, oSay1, oSay2

function Main()
  
  lOn := .f.
  
  define dialog oDlg from 1,1 to 200,200 pixel
  
  define timer oTimer interval 500 action Blinker(oDlg)
  
  @10,10 say oSay prompt "Blink" size 30,12 of oDlg pixel
  
  @30,10 say oSay1 prompt "(^-^)" size 30,12 of oDlg pixel
  
  @30,10 say oSay2 prompt "____" size 30,12 of oDlg pixel
  
  
  activate DIALOG oDlg CENTERED on init ( oTimer:hWndOwner := oDlg:hWnd, oTimer:Activate() )
  

return nil


static function Blinker(oDlg)

oTimer:deactivate()

if lOn
   oSay:Hide()
   oSay1:Hide()
   oSay2:Show()
else
   oSay:Show()
   oSay2:Hide()
   oSay1:Show()
endif

oDlg:cTitle := time()

lOn := !lOn

oTimer:activate()

return nil

 
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Post by Silvio.Falconi »

I resolved antonio
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply