Page 1 of 2

efectos para dialogos

PostPosted: Fri Feb 15, 2008 2:51 am
by horacio
Aqui les dejo codigo para algunos efectos para dialogos. Espero le gusten

#include 'fivewin.ch'
#define AW_HOR_POSITIVE 1 // Animates the window from left to right. This flag can be used with roll or slide animation.
#define AW_HOR_NEGATIVE 2 // Animates the window from right to left. This flag can be used with roll or slide animation.
#define AW_VER_POSITIVE 4 // Animates the window from top to bottom. This flag can be used with roll or slide animation.
#define AW_VER_NEGATIVE 8 // Animates the window from bottom to top. This flag can be used with roll or slide animation.
#define AW_CENTER 16 // Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used.
#define AW_HIDE 65536 // Hides the window. By default, the window is shown.
#define AW_ACTIVATE 131072 // Activates the window.
#define AW_SLIDE 262144 // Uses slide animation. By default, roll animation is used.
#define AW_BLEND 524288 // Uses a fade effect. This flag can be used only if hwnd is a top-level window.

Function Main()

Local oDlg
Local oBtn
Define Dialog oDlg From 10, 10 To 300, 500 Pixel

@ 10, 10 Button oBtn Size 50, 10 Of oDlg Pixel Action oDlg : End()

Activate Dialog oDlg On Init Centra( oDlg ) Centered Valid( Fade( oDlg ), .t. )
Return 0


Function fade( oDlg )

If( AnimateWindow( oDlg : hWnd, 1000, AW_BLEND + AW_HIDE ) == 0 )
oDlg : Hide()
endif
Return 0
Function Centra( oDlg )

AnimateWindow( oDlg : hWnd, 200, AW_CENTER )
Return 0


DLL32 function AnimateWindow( hWnd As LONG, dwTime As LONG, dwFlags As LONG ) AS LONG PASCAL ;
from "AnimateWindow" lib "user32.DLL"

PostPosted: Fri Feb 15, 2008 7:31 am
by Carles
Horacio,

Muy bueno, gracias

PostPosted: Fri Feb 15, 2008 8:37 am
by pymsoft
Horacio,


Buenisimo!!

PostPosted: Fri Feb 15, 2008 11:50 am
by karinha
Image

Image

PostPosted: Fri Feb 15, 2008 4:15 pm
by cuatecatl82
Horacio:

Muy buenos efectos para los dialogos mis felicitaciones, solo una duda, porque con dialogos con imagenes en jpg no muestra las imagenes..?

Estuve haciendo pruebas con dialogos desde recursos y no muestra la imagen..


Saludos..

PostPosted: Fri Feb 15, 2008 4:33 pm
by horacio
cuatecatl82, fijate de hacer un refresh al dialogo después de correr el efecto. Eso es lo que yo hago

PostPosted: Fri Feb 15, 2008 10:28 pm
by cuatecatl82
Probado, funciona de maravillas, gracias por el aporte..

PostPosted: Sat Feb 16, 2008 8:08 am
by Vital
Perfecto, funciona y se ve muy bien.

PostPosted: Sat Feb 16, 2008 9:00 am
by Johnson
:lol: muito show

PostPosted: Sat Feb 16, 2008 3:14 pm
by Ruben D. Fernandez
Espectacular !!!!

Podria alguien postear un ejemplo de las otras
posibilidades?


Saludos y gracias

Ruben Fernandez

PostPosted: Sat Feb 16, 2008 3:45 pm
by Willi Quintana
Suban alguna imagen plisss..

Salu2

PostPosted: Sat Feb 16, 2008 4:26 pm
by JOSEMAR
!!!!!!!!!!!!!!!!!!!!!!!! DE CHIPOCLES MAESE
NADA MAS NOSE DONDE PONER EL ODLG:REFRES()
NO ME REFRESCA AL ENTRA EL DIALOGO
FELICIDADES POR EL APORTE

PostPosted: Sat Feb 16, 2008 4:49 pm
by JOSEMAR
YA LE ENCONTRE ENDONDE
PAR LOS QUE NO.

FUNCTION CENTRA (ODLG)
...
ODLG:REFRESH()
RETURN 0

PostPosted: Sat Feb 16, 2008 6:04 pm
by cuatecatl82
Me tome la libertad de hacer unas modificaciones que permiten ver el efecto de forma aleatoria, para darle un poco de mas vista al ejemplo..


FUNCTION Centra( oDlg )

LOCAL nSel:= nRandom(4)
LOCAL cAni:= ""

IF nSel == 1
cAni:= AW_HOR_POSITIVE
ELSEIF nSel == 2
cAni:= AW_HOR_NEGATIVE
ELSEIF nSel == 3
cAni:= AW_VER_POSITIVE
ELSEIF nSel == 4
cAni:= AW_VER_NEGATIVE
ELSEIF nSel == 0
cAni:= AW_BLEND
ENDIF


AnimateWindow( oDlg : hWnd, 200, cAni )
oDlg:Refresh()

RETURN 0

Saludos desde México.. :lol:

PostPosted: Sat Feb 16, 2008 6:22 pm
by MauroArevalo
Horacio:

!Espectacular¡ Gracias.

Rubén:

De lo que entendi.

Efecto de izquierda a derecha

*-----------------------------
Function Izquierda( oDlg )

AnimateWindow( oDlg : hWnd, 200, AW_HOR_POSITIVE)
oDlg:refres()
Return 0

Efecto de derecha izquierda

*-----------------------------
Function Derecha( oDlg )

AnimateWindow( oDlg : hWnd, 200, AW_HOR_NEGATIVE)
oDlg:refres()
Return 0

Efecto de arriba hacia abajo

*-----------------------------
Function Arriba( oDlg )

AnimateWindow( oDlg : hWnd, 200, AW_VER_POSITIVE)
oDlg:refres()
Return 0

Efecto de abajo hacia arriba

*-----------------------------
Function Abajo( oDlg )

AnimateWindow( oDlg : hWnd, 200, AW_VER_NEGATIVE)
oDlg:refres()
Return 0

El 200 es tiempo y si haces la prueba y aumentas a 500 o 1000 se te demora mucho más el efecto.

Saludos,