#include "fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oSay, oGet, cGet := "Testing Fade IN / OUT", oBtn[7]
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 300, 250 PIXEL TRUEPIXEL FONT oFont ;
TITLE "Fade IN / OUT" ;
COLOR CLR_BLACK,CLR_WHITE
@ 30, 50 SAY oSay PROMPT "Testing Fade IN / OUT" OF oDlg SIZE 150, 25 PIXEL FONT oFont
@ 80, 50 GET oGet VAR cGet OF oDlg SIZE 150, 25 PIXEL
@ 130, 20 BUTTONBMP oBtn[1] ;
PROMPT "Say OUT" SIZE 80, 25 PIXEL OF oDlg ;
ACTION ( FADE_INOUT( oSay, 30, 50, 150, 25, .F., 0.12 ) ) // In
@ 130, 120 BUTTONBMP oBtn[2] ;
PROMPT "Say IN" SIZE 80, 25 PIXEL OF oDlg ;
ACTION ( FADE_INOUT( oSay, 30, 50, 150, 25, .T., 0.12 ) ) // Out
@ 170, 20 BUTTONBMP oBtn[3] ;
PROMPT "Get OUT" SIZE 80, 25 PIXEL OF oDlg ;
ACTION ( FADE_INOUT( oGet, 80, 50, 150, 25, .F., 0.12 ) ) // In
@ 170, 120 BUTTONBMP oBtn[4] ;
PROMPT "Get IN" SIZE 80, 25 PIXEL OF oDlg ;
ACTION ( FADE_INOUT( oGet, 80, 50, 150, 25, .T., 0.12 ) ) // Out
@ 210, 20 BUTTONBMP oBtn[5] ;
PROMPT "Btn OUT" SIZE 80, 25 PIXEL OF oDlg ;
ACTION ( FADE_INOUT( oBtn[7], 170, 220, 50, 25, .F., 0.12 ) ) // In
@ 210, 120 BUTTONBMP oBtn[6] ;
PROMPT "Btn IN" SIZE 80, 25 PIXEL OF oDlg ;
ACTION ( FADE_INOUT( oBtn[7], 170, 220, 50, 25, .T., 0.12 ) ) // Out
@ 170, 220 BUTTONBMP oBtn[7] ;
PROMPT "Exit" SIZE 50, 25 PIXEL OF oDlg ;
ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
RETURN NIL
// -----------------
STATIC FUNCTION FADE_INOUT( oObject, nTop, nLeft, nWidth, nHeight, lType, nSpeed )
LOCAL nHStep, nWStep
nHStep := nHeight / 5
nWStep := nWidth / 5
IF lType = .F. // Fade IN
FOR I := 1 TO 10
oObject:nTop := nTop+= ( nHStep / 2 )
oObject:nLeft := nLeft+= ( nWStep / 2 )
oObject:nHeight := nHeight-= nHStep
oObject:nWidth := nWidth-= nWStep
oObject:Refresh()
SYSWAIT(nSpeed)
NEXT
ELSE
// zero position top left
nTop := nTop + ( nHeight / 2 )
nLeft := nLeft + ( nWidth / 2 )
nHeight := 0
nWidth := 0
FOR I := 1 TO 10
oObject:nTop := nTop-= nHStep / 4
oObject:nLeft := nLeft-= nWStep / 4
oObject:nHeight := nHeight+= ( nHStep / 2 )
oObject:nWidth := nWidth+= ( nWStep / 2 )
oObject:Refresh()
SYSWAIT(nSpeed)
NEXT
ENDIF
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 75 guests