FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TO ANTONIO HELP FOR BLINK
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 07:38 AM
Dear Antonio,
Not run

on tled class I insert on new method
if ! Empty( ::hWnd )
::Create()
::Default()
::AddControl( Self )
else
::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
::=.t.
::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 March-April 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 08:06 AM

Silvio,

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

DEFINE TIMER ...

ACTIVATE TIMER ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 08: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 March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 08:44 AM

...

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 09: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( ::hWnd )
::Create()
::AddControl( Self )
else
::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 March-April 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: 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 March-April 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: 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
Posts: 169
Joined: Mon Feb 25, 2008 02:42 AM
Re: TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 12:32 PM
Hello..

If you don't mind please test this..

Thank you
Best Regards
Fafi

Code (fw): Select all Collapse
#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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO ANTONIO HELP FOR BLINK
Posted: Tue May 28, 2013 05:40 PM

I resolved antonio

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion