A Question about function < WaitSeconds( 0.3 ) >

A Question about function < WaitSeconds( 0.3 ) >

Postby ukoenig » Sat Sep 13, 2008 9:58 pm

Hello,

I wanted to use the function < WaitSeconds( 0.3 ) >
( internal used in FWH - Wait-functions )
to change on click 0.3 seconds to a new color of a bitmap.
After the time, i want to show the old color again.

Image

Code: Select all  Expand view

REDEFINE BITMAP oBmp4  ID 210 ADJUST RESOURCE "Blanc"  OF oDlg

oBmp4:bMMoved := { || cursorhand() }

// On click, i want to change the color of the bitmap for about 0.3 seconds
// and after i want to show the old color again. ( button-click-effect )

oBmp4:bLClicked := {|| oBMP4:bPainted := ;
{ |hDC|OnPaintV( hDC,oBMP4, 128,15779475,0, ;
"Vertical  Button", oBfont1, 0 ,"TEST.BMP" ,4 ), oBmp4:Refresh(), ;
WaitSeconds( 0.3 ) }, ;
oBMP4:bPainted := { |hDC|OnPaintV( hDC,oBMP4, ;
13003573,15779475,0, "Vertical  Button", oBfont1, 0 ,"TEST.BMP" ,4 ) }, ;
oBmp4:Refresh(), DIALOG_1() }

// The original start-color
oBMP4:bPainted := { |hDC|OnPaintV( hDC,oBMP4, ;
13003573,15779475,0, "Vertical  Button", oBfont1, 0 ,"TEST.BMP" ,4 ) }

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

FUNCTION DIALOG_1()

MsgAlert( "I am  Your Function 1" )

RETURN( NIL )



The 1. oBmp4:Refresh() doesn't show a new color ( 128 = Red on Blue )
Waitseconds works, but only the 2. color is shown.
Is there something wrong with the use of < Waitseconds > ?

If i do a click on the bitmap, following happens :

1. WaitSeconds( 0.3 ) starts
2. the MsgAlert( "I am Your Function 1" ) is shown
3. The 2. Color is shown AFTER !!! the Alert.

I need it this way :

1. The 1. Color is shown ( new color )
2. WaitSeconds( 0.3 )
3. The 2. Color is shown ( old color )
4. The Alert ( function starts )

Regards
Uwe :lol:
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

Postby Antonio Linares » Wed Sep 17, 2008 7:59 pm

Uwe,

I guess you should use a timer instead of make the user wait.

Just a suggestion :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 84 guests