TO ANTONIO HELP FOR BLINK

TO ANTONIO HELP FOR BLINK

Postby Silvio.Falconi » 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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6865
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Postby Antonio Linares » Tue May 28, 2013 8:06 am

Silvio,

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

DEFINE TIMER ...

ACTIVATE TIMER ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41436
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TO ANTONIO HELP FOR BLINK

Postby Silvio.Falconi » Tue May 28, 2013 8:28 am

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6865
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Postby Silvio.Falconi » Tue May 28, 2013 8:44 am

...
Last edited by Silvio.Falconi on Fri Apr 08, 2016 9:05 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6865
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Postby Silvio.Falconi » Tue May 28, 2013 9:56 am

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!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6865
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Postby Antonio Linares » Tue May 28, 2013 10:14 am

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
Antonio Linares
Site Admin
 
Posts: 41436
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TO ANTONIO HELP FOR BLINK

Postby Silvio.Falconi » Tue May 28, 2013 10:34 am

ok , but I wish finish it . on myself then, as I sad to you in private mail, I can publish the class.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6865
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO ANTONIO HELP FOR BLINK

Postby Antonio Linares » Tue May 28, 2013 10:57 am

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
Antonio Linares
Site Admin
 
Posts: 41436
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TO ANTONIO HELP FOR BLINK

Postby fafi » Tue May 28, 2013 12:32 pm

Hello..

If you don't mind please test this..

Thank you
Best Regards
Fafi

Code: Select all  Expand view

#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
fafi
 
Posts: 169
Joined: Mon Feb 25, 2008 2:42 am

Re: TO ANTONIO HELP FOR BLINK

Postby Silvio.Falconi » Tue May 28, 2013 5:40 pm

I resolved antonio
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6865
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: jair and 42 guests