FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A Question about function < WaitSeconds( 0.3 ) >
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
A Question about function < WaitSeconds( 0.3 ) >
Posted: Sat Sep 13, 2008 09: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.



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 :-)
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.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
A Question about function &lt; WaitSeconds( 0.3 ) &gt;
Posted: Wed Sep 17, 2008 07: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

Continue the discussion