Alaska Software Inc. - How do I have colour set to 'flash'
Username: Password:
AuthorTopic: How do I have colour set to 'flash'
Bruce Carroll How do I have colour set to 'flash'
on Mon, 10 Oct 2005 11:58:52 +0100
Hi,

I have one feature from an old clipper application that I am trying to 
convert across to Xbase++ application.  This was the flashing attribute 
on a SET COLOR command ie: using the * at the beginning of the colour 
letters.

I use multiple colours in a tdhibrow and this works very well.  However 
to mark urgent orders I need to turn on a flashing colour but can not 
find anywhere in the documentation on how to set this attribute.  I am 
sure it is possible as everything else is - it is just knowing how to!

Any help would be very welcome.

Best regards

Bruce
James Loughner Re: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 13:32:30 -0400
It isn't easy you need to start a thread for the object and change the 
color periodicly from there. The trick is telling the thread to stop 
when the object is destroyed.

Something like this might work (Untested)

    CLASS Flash FROM Thread
      PROTECTED:
          VAR terminated
      EXPORTED:
          VAR workCounter

          INLINE METHOD init
             ::Thread:init(Obj,Color1,Color2,nFreq)
             ::terminated  := .F.
             ::workCounter := 0
          RETURN self

          INLINE METHOD terminate
          RETURN ( ::terminated := .T. )

          METHOD execute, checkTermination
    ENDCLASS

     This method is executed in the thread
    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
       //will eventialy end
       DO WHILE ::workCounter < 1000000
           program code for thread
          Obj:SetColorFG(Color1)
          Sleep(nFreq)
          Obj:SetColorFG(Color2)
          Sleep(nFreq)
          ::checkTermination()
       ENDDO
    RETURN self

     This method checks whether or not the thread must
     terminate and cancels it, if necessary
    METHOD MyThread:checkTermination
       IF ::terminated
          ::terminated := .F.
          ::quit()
       ENDIF
    RETURN self



To use maybe

LOCAL Flasher := Flash():New()
LOCAL oSayX
  .....
    oSayX := TdSay(...)
    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)

....
 at the time before you destroy
    Flasher:Terminate
....
Return


You will need a Flash thread for each item you want to flash!

Jim

Bruce Carroll wrote:

> Hi,
> 
> I have one feature from an old clipper application that I am trying to 
> convert across to Xbase++ application.  This was the flashing attribute 
> on a SET COLOR command ie: using the * at the beginning of the colour 
> letters.
> 
> I use multiple colours in a tdhibrow and this works very well.  However 
> to mark urgent orders I need to turn on a flashing colour but can not 
> find anywhere in the documentation on how to set this attribute.  I am 
> sure it is possible as everything else is - it is just knowing how to!
> 
> Any help would be very welcome.
> 
> Best regards
> 
> Bruce
Bruce Carroll Re: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 20:11:40 +0100
Jim,

I think you earned a lunch with that amount of detail!  I did not 
think it would be so tricky as it is so simple in clipper.   I might 
just reconsider having a flash option and find another way to highlight 
an urgent order.  However, I will give your code a try and see how 
effective it looks and runs.

Many thanks again.

Bruce


James Loughner wrote:
> It isn't easy you need to start a thread for the object and change the 
> color periodicly from there. The trick is telling the thread to stop 
> when the object is destroyed.
> 
> Something like this might work (Untested)
> 
>    CLASS Flash FROM Thread
>      PROTECTED:
>          VAR terminated
>      EXPORTED:
>          VAR workCounter
> 
>          INLINE METHOD init
>             ::Thread:init(Obj,Color1,Color2,nFreq)
>             ::terminated  := .F.
>             ::workCounter := 0
>          RETURN self
> 
>          INLINE METHOD terminate
>          RETURN ( ::terminated := .T. )
> 
>          METHOD execute, checkTermination
>    ENDCLASS
> 
>     This method is executed in the thread
>    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
>       //will eventialy end
>       DO WHILE ::workCounter < 1000000
>           program code for thread
>          Obj:SetColorFG(Color1)
>          Sleep(nFreq)
>          Obj:SetColorFG(Color2)
>          Sleep(nFreq)
>          ::checkTermination()
>       ENDDO
>    RETURN self
> 
>     This method checks whether or not the thread must
>     terminate and cancels it, if necessary
>    METHOD MyThread:checkTermination
>       IF ::terminated
>          ::terminated := .F.
>          ::quit()
>       ENDIF
>    RETURN self
> 
> 
> 
> To use maybe
> 
> LOCAL Flasher := Flash():New()
> LOCAL oSayX
>  .....
>    oSayX := TdSay(...)
>    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)
> 
> .....
>  at the time before you destroy
>    Flasher:Terminate
> .....
> Return
> 
> 
> You will need a Flash thread for each item you want to flash!
> 
> Jim
> 
> Bruce Carroll wrote:
> 
>> Hi,
>>
>> I have one feature from an old clipper application that I am trying to 
>> convert across to Xbase++ application.  This was the flashing 
>> attribute on a SET COLOR command ie: using the * at the beginning of 
>> the colour letters.
>>
>> I use multiple colours in a tdhibrow and this works very well.  
>> However to mark urgent orders I need to turn on a flashing colour but 
>> can not find anywhere in the documentation on how to set this 
>> attribute.  I am sure it is possible as everything else is - it is 
>> just knowing how to!
>>
>> Any help would be very welcome.
>>
>> Best regards
>>
>> Bruce
James Loughner Re: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 15:36:08 -0400
Well in DOS there was a blinking text attribute that could be used but 
in Windows this is not a feature. So you have to cheat and actually 
write the function to change the color.

It was no big thing I just copied one of the thread examples and did a 
few edits.

Let me know if it works this is untested code.

Just be sure you terminate the thread before you destroy the object

Also you may want to add a  ::checkTermination() before each of the 
obj:SetColorBG() calls. Because of the delays it could be that you tell 
the thread to terminate then destroy the object and the thead is still 
running and tries to set a color of an object that has been destroyed.

Jim

Bruce Carroll wrote:
> Jim,
> 
> I think you earned a lunch with that amount of detail!  I did not 
> think it would be so tricky as it is so simple in clipper.   I might 
> just reconsider having a flash option and find another way to highlight 
> an urgent order.  However, I will give your code a try and see how 
> effective it looks and runs.
> 
> Many thanks again.
> 
> Bruce
> 
> 
> James Loughner wrote:
> 
>> It isn't easy you need to start a thread for the object and change the 
>> color periodicly from there. The trick is telling the thread to stop 
>> when the object is destroyed.
>>
>> Something like this might work (Untested)
>>
>>    CLASS Flash FROM Thread
>>      PROTECTED:
>>          VAR terminated
>>      EXPORTED:
>>          VAR workCounter
>>
>>          INLINE METHOD init
>>             ::Thread:init(Obj,Color1,Color2,nFreq)
>>             ::terminated  := .F.
>>             ::workCounter := 0
>>          RETURN self
>>
>>          INLINE METHOD terminate
>>          RETURN ( ::terminated := .T. )
>>
>>          METHOD execute, checkTermination
>>    ENDCLASS
>>
>>     This method is executed in the thread
>>    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
>>       //will eventialy end
>>       DO WHILE ::workCounter < 1000000
>>           program code for thread
>>          Obj:SetColorFG(Color1)
>>          Sleep(nFreq)
>>          Obj:SetColorFG(Color2)
>>          Sleep(nFreq)
>>          ::checkTermination()
>>       ENDDO
>>    RETURN self
>>
>>     This method checks whether or not the thread must
>>     terminate and cancels it, if necessary
>>    METHOD MyThread:checkTermination
>>       IF ::terminated
>>          ::terminated := .F.
>>          ::quit()
>>       ENDIF
>>    RETURN self
>>
>>
>>
>> To use maybe
>>
>> LOCAL Flasher := Flash():New()
>> LOCAL oSayX
>>  .....
>>    oSayX := TdSay(...)
>>    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)
>>
>> .....
>>  at the time before you destroy
>>    Flasher:Terminate
>> .....
>> Return
>>
>>
>> You will need a Flash thread for each item you want to flash!
>>
>> Jim
>>
>> Bruce Carroll wrote:
>>
>>> Hi,
>>>
>>> I have one feature from an old clipper application that I am trying 
>>> to convert across to Xbase++ application.  This was the flashing 
>>> attribute on a SET COLOR command ie: using the * at the beginning of 
>>> the colour letters.
>>>
>>> I use multiple colours in a tdhibrow and this works very well.  
>>> However to mark urgent orders I need to turn on a flashing colour but 
>>> can not find anywhere in the documentation on how to set this 
>>> attribute.  I am sure it is possible as everything else is - it is 
>>> just knowing how to!
>>>
>>> Any help would be very welcome.
>>>
>>> Best regards
>>>
>>> Bruce
Brent Dubs Re: How do I have colour set to 'flash'
on Tue, 11 Oct 2005 11:57:56 -0500
You could also just use a flag in the eventloop and the timeout setting 
of AppEvent() to show or hide the static. Seems like less coding and no 
need for a second thread.

IE;
     DO WHILE !lClose
        nEvent := AppEvent( @mp1, @mp2, @oXbp ,100)
        IF nEvent == 0
          lOn := !lOn
          IF lOn
            oBlinkingStatic:hide()
          ELSE
            oBlinkingStatic:show()
          ENDIF
        ELSE
          oXbp:handleEvent( nEvent, mp1, mp2 )
        ENDIF
     ENDDO


-Brent


Bruce Carroll wrote:

> Jim,
> 
> I think you earned a lunch with that amount of detail!  I did not 
> think it would be so tricky as it is so simple in clipper.   I might 
> just reconsider having a flash option and find another way to highlight 
> an urgent order.  However, I will give your code a try and see how 
> effective it looks and runs.
> 
> Many thanks again.
> 
> Bruce
> 
> 
> James Loughner wrote:
> 
>> It isn't easy you need to start a thread for the object and change the 
>> color periodicly from there. The trick is telling the thread to stop 
>> when the object is destroyed.
>>
>> Something like this might work (Untested)
>>
>>    CLASS Flash FROM Thread
>>      PROTECTED:
>>          VAR terminated
>>      EXPORTED:
>>          VAR workCounter
>>
>>          INLINE METHOD init
>>             ::Thread:init(Obj,Color1,Color2,nFreq)
>>             ::terminated  := .F.
>>             ::workCounter := 0
>>          RETURN self
>>
>>          INLINE METHOD terminate
>>          RETURN ( ::terminated := .T. )
>>
>>          METHOD execute, checkTermination
>>    ENDCLASS
>>
>>     This method is executed in the thread
>>    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
>>       //will eventialy end
>>       DO WHILE ::workCounter < 1000000
>>           program code for thread
>>          Obj:SetColorFG(Color1)
>>          Sleep(nFreq)
>>          Obj:SetColorFG(Color2)
>>          Sleep(nFreq)
>>          ::checkTermination()
>>       ENDDO
>>    RETURN self
>>
>>     This method checks whether or not the thread must
>>     terminate and cancels it, if necessary
>>    METHOD MyThread:checkTermination
>>       IF ::terminated
>>          ::terminated := .F.
>>          ::quit()
>>       ENDIF
>>    RETURN self
>>
>>
>>
>> To use maybe
>>
>> LOCAL Flasher := Flash():New()
>> LOCAL oSayX
>>  .....
>>    oSayX := TdSay(...)
>>    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)
>>
>> .....
>>  at the time before you destroy
>>    Flasher:Terminate
>> .....
>> Return
>>
>>
>> You will need a Flash thread for each item you want to flash!
>>
>> Jim
>>
>> Bruce Carroll wrote:
>>
>>> Hi,
>>>
>>> I have one feature from an old clipper application that I am trying 
>>> to convert across to Xbase++ application.  This was the flashing 
>>> attribute on a SET COLOR command ie: using the * at the beginning of 
>>> the colour letters.
>>>
>>> I use multiple colours in a tdhibrow and this works very well.  
>>> However to mark urgent orders I need to turn on a flashing colour but 
>>> can not find anywhere in the documentation on how to set this 
>>> attribute.  I am sure it is possible as everything else is - it is 
>>> just knowing how to!
>>>
>>> Any help would be very welcome.
>>>
>>> Best regards
>>>
>>> Bruce
James Loughner Re: How do I have colour set to 'flash'
on Tue, 11 Oct 2005 13:03:16 -0400
Trouble with that is that you start adding things to the event loop you 
begin to have a slow loop. I try to avoid this when ever possible.

Jim

Brent Dubs wrote:
> You could also just use a flag in the eventloop and the timeout setting 
> of AppEvent() to show or hide the static. Seems like less coding and no 
> need for a second thread.
> 
> IE;
>     DO WHILE !lClose
>        nEvent := AppEvent( @mp1, @mp2, @oXbp ,100)
>        IF nEvent == 0
>          lOn := !lOn
>          IF lOn
>            oBlinkingStatic:hide()
>          ELSE
>            oBlinkingStatic:show()
>          ENDIF
>        ELSE
>          oXbp:handleEvent( nEvent, mp1, mp2 )
>        ENDIF
>     ENDDO
> 
> 
> -Brent
> 
> 
> Bruce Carroll wrote:
> 
>> Jim,
>>
>> I think you earned a lunch with that amount of detail!  I did not 
>> think it would be so tricky as it is so simple in clipper.   I 
>> might just reconsider having a flash option and find another way to 
>> highlight an urgent order.  However, I will give your code a try and 
>> see how effective it looks and runs.
>>
>> Many thanks again.
>>
>> Bruce
>>
>>
>> James Loughner wrote:
>>
>>> It isn't easy you need to start a thread for the object and change 
>>> the color periodicly from there. The trick is telling the thread to 
>>> stop when the object is destroyed.
>>>
>>> Something like this might work (Untested)
>>>
>>>    CLASS Flash FROM Thread
>>>      PROTECTED:
>>>          VAR terminated
>>>      EXPORTED:
>>>          VAR workCounter
>>>
>>>          INLINE METHOD init
>>>             ::Thread:init(Obj,Color1,Color2,nFreq)
>>>             ::terminated  := .F.
>>>             ::workCounter := 0
>>>          RETURN self
>>>
>>>          INLINE METHOD terminate
>>>          RETURN ( ::terminated := .T. )
>>>
>>>          METHOD execute, checkTermination
>>>    ENDCLASS
>>>
>>>     This method is executed in the thread
>>>    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
>>>       //will eventialy end
>>>       DO WHILE ::workCounter < 1000000
>>>           program code for thread
>>>          Obj:SetColorFG(Color1)
>>>          Sleep(nFreq)
>>>          Obj:SetColorFG(Color2)
>>>          Sleep(nFreq)
>>>          ::checkTermination()
>>>       ENDDO
>>>    RETURN self
>>>
>>>     This method checks whether or not the thread must
>>>     terminate and cancels it, if necessary
>>>    METHOD MyThread:checkTermination
>>>       IF ::terminated
>>>          ::terminated := .F.
>>>          ::quit()
>>>       ENDIF
>>>    RETURN self
>>>
>>>
>>>
>>> To use maybe
>>>
>>> LOCAL Flasher := Flash():New()
>>> LOCAL oSayX
>>>  .....
>>>    oSayX := TdSay(...)
>>>    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)
>>>
>>> .....
>>>  at the time before you destroy
>>>    Flasher:Terminate
>>> .....
>>> Return
>>>
>>>
>>> You will need a Flash thread for each item you want to flash!
>>>
>>> Jim
>>>
>>> Bruce Carroll wrote:
>>>
>>>> Hi,
>>>>
>>>> I have one feature from an old clipper application that I am trying 
>>>> to convert across to Xbase++ application.  This was the flashing 
>>>> attribute on a SET COLOR command ie: using the * at the beginning of 
>>>> the colour letters.
>>>>
>>>> I use multiple colours in a tdhibrow and this works very well.  
>>>> However to mark urgent orders I need to turn on a flashing colour 
>>>> but can not find anywhere in the documentation on how to set this 
>>>> attribute.  I am sure it is possible as everything else is - it is 
>>>> just knowing how to!
>>>>
>>>> Any help would be very welcome.
>>>>
>>>> Best regards
>>>>
>>>> Bruce
> 
>
Brent Dubs Re: How do I have colour set to 'flash'
on Tue, 11 Oct 2005 15:37:50 -0500
I agree in theory, but I think it depends on the use. I would not 
suggest adding extra stuff to an event loop that is constantly used. 
But if I had a modal window that pops up to show a warning or some short 
input, and then goes away, then I might.  In such as situation one could 
argue that the processing overhead of having another thread running, 
could be greater that having a condition in the event loop. It would 
depend on the amount of events that you expect would be processed.

-Brent


James Loughner wrote:
> Trouble with that is that you start adding things to the event loop you 
> begin to have a slow loop. I try to avoid this when ever possible.
> 
> Jim
> 
> Brent Dubs wrote:
> 
>> You could also just use a flag in the eventloop and the timeout 
>> setting of AppEvent() to show or hide the static. Seems like less 
>> coding and no need for a second thread.
>>
>> IE;
>>     DO WHILE !lClose
>>        nEvent := AppEvent( @mp1, @mp2, @oXbp ,100)
>>        IF nEvent == 0
>>          lOn := !lOn
>>          IF lOn
>>            oBlinkingStatic:hide()
>>          ELSE
>>            oBlinkingStatic:show()
>>          ENDIF
>>        ELSE
>>          oXbp:handleEvent( nEvent, mp1, mp2 )
>>        ENDIF
>>     ENDDO
>>
>>
>> -Brent
>>
>>
>> Bruce Carroll wrote:
>>
>>> Jim,
>>>
>>> I think you earned a lunch with that amount of detail!  I did not 
>>> think it would be so tricky as it is so simple in clipper.   I 
>>> might just reconsider having a flash option and find another way to 
>>> highlight an urgent order.  However, I will give your code a try and 
>>> see how effective it looks and runs.
>>>
>>> Many thanks again.
>>>
>>> Bruce
>>>
>>>
>>> James Loughner wrote:
>>>
>>>> It isn't easy you need to start a thread for the object and change 
>>>> the color periodicly from there. The trick is telling the thread to 
>>>> stop when the object is destroyed.
>>>>
>>>> Something like this might work (Untested)
>>>>
>>>>    CLASS Flash FROM Thread
>>>>      PROTECTED:
>>>>          VAR terminated
>>>>      EXPORTED:
>>>>          VAR workCounter
>>>>
>>>>          INLINE METHOD init
>>>>             ::Thread:init(Obj,Color1,Color2,nFreq)
>>>>             ::terminated  := .F.
>>>>             ::workCounter := 0
>>>>          RETURN self
>>>>
>>>>          INLINE METHOD terminate
>>>>          RETURN ( ::terminated := .T. )
>>>>
>>>>          METHOD execute, checkTermination
>>>>    ENDCLASS
>>>>
>>>>     This method is executed in the thread
>>>>    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
>>>>       //will eventialy end
>>>>       DO WHILE ::workCounter < 1000000
>>>>           program code for thread
>>>>          Obj:SetColorFG(Color1)
>>>>          Sleep(nFreq)
>>>>          Obj:SetColorFG(Color2)
>>>>          Sleep(nFreq)
>>>>          ::checkTermination()
>>>>       ENDDO
>>>>    RETURN self
>>>>
>>>>     This method checks whether or not the thread must
>>>>     terminate and cancels it, if necessary
>>>>    METHOD MyThread:checkTermination
>>>>       IF ::terminated
>>>>          ::terminated := .F.
>>>>          ::quit()
>>>>       ENDIF
>>>>    RETURN self
>>>>
>>>>
>>>>
>>>> To use maybe
>>>>
>>>> LOCAL Flasher := Flash():New()
>>>> LOCAL oSayX
>>>>  .....
>>>>    oSayX := TdSay(...)
>>>>    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)
>>>>
>>>> .....
>>>>  at the time before you destroy
>>>>    Flasher:Terminate
>>>> .....
>>>> Return
>>>>
>>>>
>>>> You will need a Flash thread for each item you want to flash!
>>>>
>>>> Jim
>>>>
>>>> Bruce Carroll wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have one feature from an old clipper application that I am trying 
>>>>> to convert across to Xbase++ application.  This was the flashing 
>>>>> attribute on a SET COLOR command ie: using the * at the beginning 
>>>>> of the colour letters.
>>>>>
>>>>> I use multiple colours in a tdhibrow and this works very well.  
>>>>> However to mark urgent orders I need to turn on a flashing colour 
>>>>> but can not find anywhere in the documentation on how to set this 
>>>>> attribute.  I am sure it is possible as everything else is - it is 
>>>>> just knowing how to!
>>>>>
>>>>> Any help would be very welcome.
>>>>>
>>>>> Best regards
>>>>>
>>>>> Bruce
>>
>>
>>
James Loughner Re: How do I have colour set to 'flash'
on Tue, 11 Oct 2005 17:18:47 -0400
Agreed

Jim
Brent Dubs wrote:
> I agree in theory, but I think it depends on the use. I would not 
> suggest adding extra stuff to an event loop that is constantly used. But 
> if I had a modal window that pops up to show a warning or some short 
> input, and then goes away, then I might.  In such as situation one could 
> argue that the processing overhead of having another thread running, 
> could be greater that having a condition in the event loop. It would 
> depend on the amount of events that you expect would be processed.
> 
> -Brent
> 
> 
> James Loughner wrote:
> 
>> Trouble with that is that you start adding things to the event loop 
>> you begin to have a slow loop. I try to avoid this when ever possible.
>>
>> Jim
>>
>> Brent Dubs wrote:
>>
>>> You could also just use a flag in the eventloop and the timeout 
>>> setting of AppEvent() to show or hide the static. Seems like less 
>>> coding and no need for a second thread.
>>>
>>> IE;
>>>     DO WHILE !lClose
>>>        nEvent := AppEvent( @mp1, @mp2, @oXbp ,100)
>>>        IF nEvent == 0
>>>          lOn := !lOn
>>>          IF lOn
>>>            oBlinkingStatic:hide()
>>>          ELSE
>>>            oBlinkingStatic:show()
>>>          ENDIF
>>>        ELSE
>>>          oXbp:handleEvent( nEvent, mp1, mp2 )
>>>        ENDIF
>>>     ENDDO
>>>
>>>
>>> -Brent
>>>
>>>
>>> Bruce Carroll wrote:
>>>
>>>> Jim,
>>>>
>>>> I think you earned a lunch with that amount of detail!  I did not 
>>>> think it would be so tricky as it is so simple in clipper.   I 
>>>> might just reconsider having a flash option and find another way to 
>>>> highlight an urgent order.  However, I will give your code a try and 
>>>> see how effective it looks and runs.
>>>>
>>>> Many thanks again.
>>>>
>>>> Bruce
>>>>
>>>>
>>>> James Loughner wrote:
>>>>
>>>>> It isn't easy you need to start a thread for the object and change 
>>>>> the color periodicly from there. The trick is telling the thread to 
>>>>> stop when the object is destroyed.
>>>>>
>>>>> Something like this might work (Untested)
>>>>>
>>>>>    CLASS Flash FROM Thread
>>>>>      PROTECTED:
>>>>>          VAR terminated
>>>>>      EXPORTED:
>>>>>          VAR workCounter
>>>>>
>>>>>          INLINE METHOD init
>>>>>             ::Thread:init(Obj,Color1,Color2,nFreq)
>>>>>             ::terminated  := .F.
>>>>>             ::workCounter := 0
>>>>>          RETURN self
>>>>>
>>>>>          INLINE METHOD terminate
>>>>>          RETURN ( ::terminated := .T. )
>>>>>
>>>>>          METHOD execute, checkTermination
>>>>>    ENDCLASS
>>>>>
>>>>>     This method is executed in the thread
>>>>>    METHOD Flash:execute(Obj,Color1,Color2,nFreq)
>>>>>       //will eventialy end
>>>>>       DO WHILE ::workCounter < 1000000
>>>>>           program code for thread
>>>>>          Obj:SetColorFG(Color1)
>>>>>          Sleep(nFreq)
>>>>>          Obj:SetColorFG(Color2)
>>>>>          Sleep(nFreq)
>>>>>          ::checkTermination()
>>>>>       ENDDO
>>>>>    RETURN self
>>>>>
>>>>>     This method checks whether or not the thread must
>>>>>     terminate and cancels it, if necessary
>>>>>    METHOD MyThread:checkTermination
>>>>>       IF ::terminated
>>>>>          ::terminated := .F.
>>>>>          ::quit()
>>>>>       ENDIF
>>>>>    RETURN self
>>>>>
>>>>>
>>>>>
>>>>> To use maybe
>>>>>
>>>>> LOCAL Flasher := Flash():New()
>>>>> LOCAL oSayX
>>>>>  .....
>>>>>    oSayX := TdSay(...)
>>>>>    Flasher:Start(  ,oSayX,GRA_CLR_BLUE,GRA_CLR_RED,50)
>>>>>
>>>>> .....
>>>>>  at the time before you destroy
>>>>>    Flasher:Terminate
>>>>> .....
>>>>> Return
>>>>>
>>>>>
>>>>> You will need a Flash thread for each item you want to flash!
>>>>>
>>>>> Jim
>>>>>
>>>>> Bruce Carroll wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have one feature from an old clipper application that I am 
>>>>>> trying to convert across to Xbase++ application.  This was the 
>>>>>> flashing attribute on a SET COLOR command ie: using the * at the 
>>>>>> beginning of the colour letters.
>>>>>>
>>>>>> I use multiple colours in a tdhibrow and this works very well.  
>>>>>> However to mark urgent orders I need to turn on a flashing colour 
>>>>>> but can not find anywhere in the documentation on how to set this 
>>>>>> attribute.  I am sure it is possible as everything else is - it is 
>>>>>> just knowing how to!
>>>>>>
>>>>>> Any help would be very welcome.
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> Bruce
>>>
>>>
>>>
>>>
>
Eric BreddamRe: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 12:35:48 -0700
> The trick is telling the thread to stop
> when the object is destroyed.

My general solution to this sort of thing might be to sub-class thread and
include the object as a VAR of the new class...

CLASS MyFlashingThing FROM Thread
       VAR guiObject

Then in the create method, after the thread is created, create the gui
object and etc... for pushbuttons, list/combo boxes, etc, this would get
tricky with the activation and callbacks but for simple visual gui objects
(i.e. statics), it should work fine... any reason not to?

Note, I'm not saying subclass from both classes, just make Thread the
primary class and include an XBP as a (protected) VAR ...
James Loughner Re: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 16:10:04 -0400
Well for Topdown you could sub class the TDSay class and add an init 
which would start the thread and a destroy to end it. Or your way would 
work also. The trick is to be sure that the thread stops updating he 
object when destroyed. The main problem with your method is now you are 
working with a thread object not an XBP so you lose the interface to the 
XBP object also you may have event problems because the GUI object is 
running in a different thread so you might need an event loop in the 
thread. Also you might have problems if there is a linked database in a 
SLE type object.

Jim

Eric Breddam wrote:

>>The trick is telling the thread to stop
>>when the object is destroyed.
> 
> 
> My general solution to this sort of thing might be to sub-class thread and
> include the object as a VAR of the new class...
> 
> CLASS MyFlashingThing FROM Thread
>        VAR guiObject
> 
> Then in the create method, after the thread is created, create the gui
> object and etc... for pushbuttons, list/combo boxes, etc, this would get
> tricky with the activation and callbacks but for simple visual gui objects
> (i.e. statics), it should work fine... any reason not to?
> 
> Note, I'm not saying subclass from both classes, just make Thread the
> primary class and include an XBP as a (protected) VAR ...
> 
>
Joe Carrick Re: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 15:03:50 -0700
Hi Bruce,

Since you have much more control of colors and text attributes in GUI 
mode, you might rethink exactly what you want to use to indicate urgent 
orders.



Bruce Carroll wrote:
> Hi,
> 
> I have one feature from an old clipper application that I am trying to 
> convert across to Xbase++ application.  This was the flashing attribute 
> on a SET COLOR command ie: using the * at the beginning of the colour 
> letters.
> 
> I use multiple colours in a tdhibrow and this works very well.  However 
> to mark urgent orders I need to turn on a flashing colour but can not 
> find anywhere in the documentation on how to set this attribute.  I am 
> sure it is possible as everything else is - it is just knowing how to!
> 
> Any help would be very welcome.
> 
> Best regards
> 
> Bruce
Joe Carrick Re: How do I have colour set to 'flash'
on Mon, 10 Oct 2005 15:13:27 -0700
Joe Carrick wrote:

> Hi Bruce,
> 
> Since you have much more control of colors and text attributes in GUI 
> mode, you might rethink exactly what you want to use to indicate urgent 
> orders.
> 
> 

IOW,

Perhaps Bold Red Text on a Yellow BackGround ---- or something else of 
your choosing.

> 
> Bruce Carroll wrote:
> 
>> Hi,
>>
>> I have one feature from an old clipper application that I am trying to 
>> convert across to Xbase++ application.  This was the flashing 
>> attribute on a SET COLOR command ie: using the * at the beginning of 
>> the colour letters.
>>
>> I use multiple colours in a tdhibrow and this works very well.  
>> However to mark urgent orders I need to turn on a flashing colour but 
>> can not find anywhere in the documentation on how to set this 
>> attribute.  I am sure it is possible as everything else is - it is 
>> just knowing how to!
>>
>> Any help would be very welcome.
>>
>> Best regards
>>
>> Bruce
Bruce Carroll Re: How do I have colour set to 'flash'
on Tue, 11 Oct 2005 09:35:57 +0100
All great suggestions - I will be busy trying some now.  Many thanks for 
all you responses once again.

Best regards

Bruce

Joe Carrick wrote:
> Joe Carrick wrote:
> 
>> Hi Bruce,
>>
>> Since you have much more control of colors and text attributes in GUI 
>> mode, you might rethink exactly what you want to use to indicate 
>> urgent orders.
>>
>> 
> 
> 
> IOW,
> 
> Perhaps Bold Red Text on a Yellow BackGround ---- or something else of 
> your choosing.
> 
>>
>> Bruce Carroll wrote:
>>
>>> Hi,
>>>
>>> I have one feature from an old clipper application that I am trying 
>>> to convert across to Xbase++ application.  This was the flashing 
>>> attribute on a SET COLOR command ie: using the * at the beginning of 
>>> the colour letters.
>>>
>>> I use multiple colours in a tdhibrow and this works very well.  
>>> However to mark urgent orders I need to turn on a flashing colour but 
>>> can not find anywhere in the documentation on how to set this 
>>> attribute.  I am sure it is possible as everything else is - it is 
>>> just knowing how to!
>>>
>>> Any help would be very welcome.
>>>
>>> Best regards
>>>
>>> Bruce
Carmelo RiofloridoRe: How do I have colour set to 'flash'
on Sat, 15 Oct 2005 23:42:47 -0700
Hi Bruce,

I use this routine for highlighting a "Flagged" customer or order in my
hybrid app. Very crude and very embarrassing to share but it works for me.

Someone can probably convert this to an xBase++ routine.

Carmelo


*****************
       if upper(status) = "F"
            ?? chr(7)
            @ 6,2 say remarks
            do while inkey() = 0
               @ 5,13 say "Alert!!!" color "??/?"
               mtime := 0
               do while mtime < 50
                  mtime++
               enddo
               @ 5,13 say "        "
               mtime := 0
               do while mtime < 50
                  mtime++
               enddo
            enddo
            exit
         else
*********


"Bruce Carroll" <bruce.carroll@microman2000.co.uk> wrote in message
news:2kYQY7jzFHA.5608@S15147418...
> All great suggestions - I will be busy trying some now.  Many thanks for
> all you responses once again.
>
> Best regards
>
> Bruce
>
> Joe Carrick wrote:
> > Joe Carrick wrote:
> >
> >> Hi Bruce,
> >>
> >> Since you have much more control of colors and text attributes in GUI
> >> mode, you might rethink exactly what you want to use to indicate
> >> urgent orders.
> >>
> >> 
> >
> >
> > IOW,
> >
> > Perhaps Bold Red Text on a Yellow BackGround ---- or something else of
> > your choosing.
> >
> >>
> >> Bruce Carroll wrote:
> >>
> >>> Hi,
> >>>
> >>> I have one feature from an old clipper application that I am trying
> >>> to convert across to Xbase++ application.  This was the flashing
> >>> attribute on a SET COLOR command ie: using the * at the beginning of
> >>> the colour letters.
> >>>
> >>> I use multiple colours in a tdhibrow and this works very well.
> >>> However to mark urgent orders I need to turn on a flashing colour but
> >>> can not find anywhere in the documentation on how to set this
> >>> attribute.  I am sure it is possible as everything else is - it is
> >>> just knowing how to!
> >>>
> >>> Any help would be very welcome.
> >>>
> >>> Best regards
> >>>
> >>> Bruce
Bruce Carroll Re: How do I have colour set to 'flash'
on Sun, 16 Oct 2005 16:28:45 +0100
Carmelo,

Thank you for sharing that - never feel embarrased at sharing knowledge 
- Thank you.

Best regards

Bruce


Carmelo Rioflorido wrote:
> Hi Bruce,
> 
> I use this routine for highlighting a "Flagged" customer or order in my
> hybrid app. Very crude and very embarrassing to share but it works for me.
> 
> Someone can probably convert this to an xBase++ routine.
> 
> Carmelo
> 
> 
> *****************
>        if upper(status) = "F"
>             ?? chr(7)
>             @ 6,2 say remarks
>             do while inkey() = 0
>                @ 5,13 say "Alert!!!" color "??/?"
>                mtime := 0
>                do while mtime < 50
>                   mtime++
>                enddo
>                @ 5,13 say "        "
>                mtime := 0
>                do while mtime < 50
>                   mtime++
>                enddo
>             enddo
>             exit
>          else
> *********
> 
> 
> "Bruce Carroll" <bruce.carroll@microman2000.co.uk> wrote in message
> news:2kYQY7jzFHA.5608@S15147418...
> 
>>All great suggestions - I will be busy trying some now.  Many thanks for
>>all you responses once again.
>>
>>Best regards
>>
>>Bruce
>>
>>Joe Carrick wrote:
>>
>>>Joe Carrick wrote:
>>>
>>>
>>>>Hi Bruce,
>>>>
>>>>Since you have much more control of colors and text attributes in GUI
>>>>mode, you might rethink exactly what you want to use to indicate
>>>>urgent orders.
>>>>
>>>>
>>>
>>>
>>>IOW,
>>>
>>>Perhaps Bold Red Text on a Yellow BackGround ---- or something else of
>>>your choosing.
>>>
>>>
>>>>Bruce Carroll wrote:
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I have one feature from an old clipper application that I am trying
>>>>>to convert across to Xbase++ application.  This was the flashing
>>>>>attribute on a SET COLOR command ie: using the * at the beginning of
>>>>>the colour letters.
>>>>>
>>>>>I use multiple colours in a tdhibrow and this works very well.
>>>>>However to mark urgent orders I need to turn on a flashing colour but
>>>>>can not find anywhere in the documentation on how to set this
>>>>>attribute.  I am sure it is possible as everything else is - it is
>>>>>just knowing how to!
>>>>>
>>>>>Any help would be very welcome.
>>>>>
>>>>>Best regards
>>>>>
>>>>>Bruce
> 
> 
>