forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


AnimateWindow

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Jul 24, 2003 4:44 am    Post subject: AnimateWindow Reply with quote

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
View user's profile Send private message Send e-mail
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jul 24, 2003 5:19 am    Post subject: Reply with quote

Nice one. Incidentally I was just about to release this code Smile .
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 642
Location: Eastern Indiana

PostPosted: Sun Mar 28, 2004 8:20 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Visit poster's website
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sun Mar 28, 2004 9:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 642
Location: Eastern Indiana

PostPosted: Mon Mar 29, 2004 3:27 am    Post subject: Reply with quote

awesome Very Happy

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 Smile
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 29, 2004 8:52 am    Post subject: Reply with quote

good job snarling sheep...cool effect Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group