View previous topic :: View next topic |
Author |
Message |
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Jul 24, 2003 4:44 am Post subject: AnimateWindow |
|
|
Good effect when showing/hiding/closing your Dialog.
Looks complicated, but mostly just comments, simple to use and easier than doing your own slide in/out effects.
Code: |
REM Styles are:
REM AW_SHOW Uses roll animation.
%%AW_SHOW = $00020000
REM AW_SLIDE Uses slide animation.
%%AW_SLIDE = $00040000
REM ROLL/SLIDE need to be used with one of the following:
%%AW_RIGHT = $00000001
%%AW_LEFT = $0000002
%%AW_DOWN = $0000004
%%AW_EUP = $0000008
REM Add RIGHT/LEFT with UP/DOWN for diagonal effects.
REM ::
REM AW_BLEND Uses a fade effect.Can be used only if hwnd is a top-level window.
REM Win 2000 or higher
%%AW_BLEND = $00080000
REM ::
REM AW_CENTER Makes the window appear to collapse inward if AW_HIDE is used or expand
REM outward if the AW_HIDE is not used.
%%AW_CENTER = $00000010
REM ::
%%AW_HIDE = $00010000
REM ::
REM Amount of time animation takes, in milliseconds.
%%AWTime = 500
REM If you use SLIDERIGHT/SLIDEDOWN you might want to make
REM SLIDELEFT/SLIDEUP+SW_HIDE as the Close Style.
REM CENTER doesn't seem to work with HIDE?
Title AnimateWindow Test
DIALOG CREATE,AnimateWindow Test,200,200,244,72,CLASS SheepAWTest
DIALOG ADD,BUTTON,Exit,24,85,64,24,Exit
LOADLIB user32.dll
%%AWHwnd = @STRDEL(@WINEXISTS(#SheepAWTest),1,1)
%x = @LIB(user32,AnimateWindow,INT,%%AWHwnd,%%AWTime,@SUM(%%AW_SLIDE,%%AW_DOWN))
DIALOG SHOW
:Evloop
wait event
goto @event()
:ExitBUTTON
:Close
%x = @LIB(user32,AnimateWindow,INT,%%AWHwnd,%%AWTime,@SUM(%%AW_HIDE,@SUM(%%AW_SLIDE,%%AW_LEFT)))
exit
|
_________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 24, 2003 5:19 am Post subject: |
|
|
Nice one. Incidentally I was just about to release this code . _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
vtol Valued Contributor
Joined: 05 Feb 2004 Posts: 642 Location: Eastern Indiana
|
Posted: Sun Mar 28, 2004 8:20 pm Post subject: |
|
|
Cool
Is there a way to hook that to the edge of my main program.
That would be neat if you click a INFO button and that would protrude out the side with some information for example. I've seen it done before on commercial software.
Nice job SnarlingSheep |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sun Mar 28, 2004 9:33 pm Post subject: |
|
|
Something like this:
Code: |
OPTION SCALE,96
REM Styles are:
REM AW_SHOW Uses roll animation.
%%AW_SHOW = $00020000
REM AW_SLIDE Uses slide animation.
%%AW_SLIDE = $00040000
REM ROLL/SLIDE need to be used with one of the following:
%%AW_RIGHT = $00000001
%%AW_LEFT = $0000002
%%AW_DOWN = $0000004
%%AW_UP = $0000008
REM Add RIGHT/LEFT with UP/DOWN for diagonal effects.
REM ::
REM AW_BLEND Uses a fade effect.Can be used only if hwnd is a top-level window.
REM Win 2000 or higher
%%AW_BLEND = $00080000
REM ::
REM AW_CENTER Makes the window appear to collapse inward if AW_HIDE is used or expand
REM outward if the AW_HIDE is not used.
%%AW_CENTER = $00000010
REM ::
%%AW_HIDE = $00010000
REM ::
REM Amount of time animation takes, in milliseconds.
%%AWTime = 500
REM If you use SLIDERIGHT/SLIDEDOWN you might want to make
REM SLIDELEFT/SLIDEUP+SW_HIDE as the Close Style.
REM CENTER doesn't seem to work with HIDE?
Title AnimateWindow Test
DIALOG CREATE,AnimateWindow Test,200,200,244,72,CLASS SheepAWTest
DIALOG ADD,BUTTON,Show,24,85,74,24,Show Child
DIALOG SHOW
DIALOG CREATE,AnimateWindow Child,200,70,100,72,CLASS SheepAWTestChild,NOSYS
LOADLIB user32.dll
%%AWHwnd = @STRDEL(@WINEXISTS(#SheepAWTestChild),1,1)
%%ChildShowing = 0
:Evloop
wait event
goto @event()
:ShowBUTTON
if @EQUAL(%%ChildShowing,0)
%x = @LIB(user32,AnimateWindow,INT,%%AWHwnd,%%AWTime,@SUM(%%AW_SLIDE,%%AW_LEFT))
DIALOG SELECT,1
DIALOG SHOW
DIALOG SELECT,0
DIALOG SET,Show,Hide Child
%%ChildShowing = 1
else
%x = @LIB(user32,AnimateWindow,INT,%%AWHwnd,%%AWTime,@SUM(%%AW_HIDE,@SUM(%%AW_SLIDE,%%AW_RIGHT)))
DIALOG SELECT,0
DIALOG SET,Show,Show Child
%%ChildShowing = 0
end
goto evloop
:Close
%x = @LIB(user32,AnimateWindow,INT,%%AWHwnd,%%AWTime,@SUM(%%AW_HIDE,@SUM(%%AW_SLIDE,%%AW_RIGHT)))
exit
|
_________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
vtol Valued Contributor
Joined: 05 Feb 2004 Posts: 642 Location: Eastern Indiana
|
Posted: Mon Mar 29, 2004 3:27 am Post subject: |
|
|
awesome
But it has a small gap and I noticed when you drag the window, they're not connected any longer(when you click button again), maybe its too much trouble for what its worth.
But that was amazing |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Mar 29, 2004 8:52 am Post subject: |
|
|
good job snarling sheep...cool effect
serge _________________
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|