intermittent color

intermittent color

Postby Silvio.Falconi » Sat Mar 28, 2020 6:09 pm

how can I create an intermittent color for a btnbmp

Image




See the image ?

now the btnbmp has the color yellow with :SetColor(CLR_RED,CLR_YELLOW)


but I would like to flash for a few seconds in different colors to make it display and say to the end user "I am here"

how can I do it?
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: intermittent color

Postby ukoenig » Sat Mar 28, 2020 9:53 pm

Silvio,

but I would like to flash for a few seconds in different colors
to make it display and say to the end user "I am here"


what do You think about painting only a colored border
with a defined pensize and transparent-level
instead of changing the buttoncolor
I think that looks better.

Image

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: intermittent color

Postby Silvio.Falconi » Sun Mar 29, 2020 9:31 pm

no I wish simulate the old clipper comand * do you remember ?
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: intermittent color

Postby Silvio.Falconi » Sun Mar 29, 2020 10:30 pm

Uwe,
Please try this test
Code: Select all  Expand view  RUN




#include "fivewin.ch"


function Test()

   local oDlg, oFont, aBtn[ 3 ]
   local nRow, nCol, n

   local ntype:="01"
   local date1 :=date()
   local date2 :=date()

   local cImage1:= "c:\work\fwh\bitmaps\alphabmp\world.bmp"
   local cImage2:= "c:\work\fwh\bitmaps\alphabmp\task.bmp"

   aData:={}

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 600,200 PIXEL TRUEPIXEL FONT oFont

   nRow  := 50
   nCol  := 30

   for n := 1 to 3
      @ nRow, nCol BTNBMP aBtn[ n ] RESOURCE cImage1 ;
         PROMPT LTrim( Str( n ) ) + " " ;
         SIZE 64,64 PIXEL OF oDlg FLAT TOP  NOBORDER

       
      nCol  += 80
   next n


  ACTIVATE DIALOG oDlg CENTERED;
                                        ON INIT ( Lamp( aBtn[ 3 ] ) )
   RELEASE FONT oFont

   return nil
//----------------------------------------------------------------//

Function Lamp(oBtn)
local n
       For n=1 to 10
         oBtn:SetColor(CLR_RED,CLR_YELLOW)
        syswait(0.08)
        oBtn:SetColor(CLR_RED,CLR_GREEN)
         syswait(0.08)
        oBtn:SetColor(CLR_RED,CLR_YELLOW)
        n++
      next
      RETURN NIL
//-----------------------------------------------------------//


I wish change the background color of btnbmp many times for simulate the intermittet color as to create a blink
How I can resolve ?
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: intermittent color

Postby ukoenig » Mon Mar 30, 2020 10:21 am

Silvio,

try this

Code: Select all  Expand view  RUN

#include "fivewin.ch"

// now the btnbmp has the color yellow with :SetColor(CLR_RED,CLR_YELLOW)
// but I would like to flash for a few seconds in different colors
// to make it display and say to the end user "I am here"

FUNCTION MAIN()
local oDlg, oFont, aBtn[ 3 ]
local nRow, nCol, n

local ntype:="01"
local date1 :=date()
local date2 :=date()

local cImage1:= ".\Bitmaps\world.bmp"
local cImage2:= ".\Bitmaps\task.bmp"

aData:={}

DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

DEFINE DIALOG oDlg SIZE 600,200 PIXEL TRUEPIXEL FONT oFont

nRow  := 50
nCol  := 30

FOR n := 1 to 3
      @ nRow, nCol BTNBMP aBtn[ n ] RESOURCE cImage1 ;
           PROMPT LTrim( Str( n ) ) + " " ;
           SIZE 64,64 PIXEL OF oDlg FLAT TOP  NOBORDER
      nCol  += 80
NEXT n

oDlg:bPainted := < |hDC|
    Lamp( aBtn[ 3 ] ) // don't use ON INIT !
RETURN NIL
>

ACTIVATE DIALOG oDlg CENTERED

RELEASE FONT oFont

RETURN NIL

//------------------------------

FUNCTION LAMP(oBtn)
local n, lChange := .F.

FOR n := 1 to 9 // lastcolor = yellow
    IF lChange = .F.
         oBtn:SetColor(CLR_RED,CLR_YELLOW)
         lChange := .T.
    ELSE
         oBtn:SetColor(CLR_RED,CLR_GREEN)
         lChange := .F.
    ENDIF
    oBtn:Refresh()
    syswait(0.1)
    n++
NEXT
oBtn:Refresh() // shows yellow

RETURN NIL

 


regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: intermittent color

Postby Silvio.Falconi » Mon Mar 30, 2020 12:59 pm

yes good

I knew you would find the right solution, as far as graphics are concerned you are good
for image Umbrella run good for another services not run
but this depends on the image which is too large and does not have a defined outline

I was what I have been looking for for a long time: the user searches for a customer for example "Falconi",
the procedure searches for the customer (in that date range), creates an array,

if the len of the array is one it shows the flashing otherwise it opens a dialog with the list of services
occupied by the customer during that period, then the end user can select which service to show by flashing
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests