Click here to Skip to main content
Click here to Skip to main content

Animated Dialog Windows

By , 17 Apr 2000
 
  • Download demo project - 24 Kb
  • Download source files - 5 Kb

    animated screen shot

    Introduction

    Often in modern GUI you can see a some sort of window or menu animation that can give a more user friendly "cool" look. Fading or sliding menus, poping dialog boxes look neat and provide visual feedback with user actions. Currently, however there is no simple way to do this under MS Windows, other than XORed lines and polygons (besides the AnimateWindow() function).

    The AnimEffect class provides quite an easy and extensible way to add animation to your code.

    Usage

    Using the class is rather simple. Just add the following code to the dialogs OnCreate and OnDestroy functions.

     AnimEffect ef;
     // exploding window effect
     ef.Open( rcWnd );
     // or imploding window effect
     ef.Close( rcWnd );
    

    You can customize the effect by calling the Setup( int iSteps, int iAfterimages, int iDelay ) member function, and change the animation type by Effect( EffectType effect ), where EffectType is :

       enum EffectType {
         Random=-1,       // default
         Spin=0,          
         Vortex,
         ScatterGather,
         Spike,
         Fireworks
       };
    

    Included is a simple demo project that shows a bunch of effects. Feel free to use this code.

  • License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Anton Stuck
    Russian Federation Russian Federation
    Member
    No Biography provided

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    GeneralMy vote of 5membersariqkhan21 Nov '12 - 1:29 
    awome
    GeneralIt won't work with Vista Aeromemberjulio.debroy16 Oct '07 - 13:19 
    This code is great, but sad to say it wont work under vista if aero theme is activated, and need to change (programmatically) to vista basic theme for it to work.
    GeneralGreat codememberEl Chapulin Colorado3 May '07 - 1:17 
    I have been coding a MasterMind game where you have to guess the colors combination choosen by the computer, which gives you information about the answer via black and white figures.
     
    I had to find a nice and funny way to display a message when the user finally finds the answer, and to make him happy for winning the game. So I decided to use your animated dialog for this, and many people who played the MasterMind game noticed it and found it very pleasant and nice.
     
    So I have to congratulate you for this simple and smart idea, and let you know that your code is being used and greatly appreciated.
     
    Thank you again !
    GeneralSIMPLYmemberHugo.Pereira21 Dec '06 - 1:25 
    GOOD
    GeneralHats offmemberBalkrishna Talele11 Dec '03 - 22:41 
    Amazing, enchanting, truly the creativity is divine inside and out, You made me unspoken . I lull before you imagination.
    GeneralI bow before thy creativitymemberabhinaba10 Dec '03 - 18:42 
    Amazing!!!! Just do not have words to praise your creativity. All the code you have used are simple yet the effect is incredible OMG | :OMG:
     
    ==========================
    AB => Code and let code
    Go to my home
    ==========================
    GeneralAmazing!sussT.S. Prasad21 Apr '03 - 18:04 
    When I thought everything in GUI development is over, this article came as a bolt from blue. Hence I give highest possible rating.
     
    T.S. Prasad
    GeneralI finally found this class!memberiProgram (WangYue)12 Jan '03 - 23:26 
    It takes our Chinese guys a long time to guess how to make this awesome effect. Thanks Anton. Great job.Eek! | :eek:
    GeneralThis is soooo cooool !!memberWREY27 Sep '02 - 23:21 
    It shows that you have the power of creativity!!
     
    Simply great!
     
    Cool | :cool:
     
    William
    GeneralOnly one little note...sussAV9 Oct '00 - 21:34 
    void AnimEffect::ChooseFunc()
    {
    bool bRandom = false;
     
    if (m_Effect == Random) {
     
    srand(time(NULL));<--------------- //TO DO THIS.

    bRandom = true;
    Effect((EffectType)(rand() % 5));
    }
    .........

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Permalink | Advertise | Privacy | Mobile
    Web01 | 2.6.130523.1 | Last Updated 18 Apr 2000
    Article Copyright 2000 by Anton Stuck
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid