Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 09:38, 1 July 2008.

CS001055 - Creating a confirmation query dialog with an animation

From Forum Nokia Wiki


ID CS001055 Creation date July 1, 2008
Platform S60 3rd Edition, FP1 Tested on devices Nokia N93
Category Symbian C++ Subcategory Files/Data


Keywords (APIs, classes, methods, functions): CAknQueryDialog, BMPANIM_FRAME, BMPANIM_DATA, CAknQueryDialog::ExecuteLD()

Overview

This code snippet shows how to create a confirmation query dialog with an animation. The dialog animation is defined in the application's resource file and the class CAknQueryDialog is used to create it. This example uses four image files (Ballm.bmp and Ball2m.bmp are masks used) from folder \images.


This snippet can be self-signed.

MMP file

The following libraries are required:

LIBRARY     avkon.lib   //Avkon resources


Resource file

.mmp

//...
SOURCEPATH      ..\data
 
START RESOURCE  Animation.rss
HEADER
TARGET Animation_0xEB023C9A
TARGETPATH resource\apps
END //RESOURCE
 
 
START BITMAP Animation.mbm
HEADER
TARGETPATH  \private\EB023C9A
SOURCEPATH ..\Images
SOURCE 2 Ball.bmp 
SOURCE 2 Ballm.bmp
SOURCE 2 Ball2.bmp 
SOURCE 2 Ball2m.bmp
END
//...

.rss

//  INCLUDES
#include <eikon.rh>
#include <avkon.rsg>
#include <avkon.rh>
#include <appinfo.rh>
#include "Animation.hrh"
#include "Animation.rls"
#include <Animation.mbg>
 
//...
 
RESOURCE ARRAY r_example_animation_array
    {
    items=
        {                  
        BMPANIM_FRAME { bmpid=EMbmAnimationBall; maskid=EMbmAnimationBallm;},
        BMPANIM_FRAME { bmpid=EMbmAnimationBall2; maskid=EMbmAnimationBallm;}
        };
        }
 
 
RESOURCE BMPANIM_DATA r_example_query_animation
    {
    frameinterval = 250;
    playmode = EAknBitmapAnimationPlayModeCycle;
    bmpfile = "\private\EB023C9A\animation.mbm";  
    frames = r_example_animation_array;
    }
 
 
RESOURCE DIALOG r_example_animation_dialog
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_YES_NO;
    items=
        {
        DLG_LINE
            {
            type = EAknCtQuery;
            id = EGeneralQuery;
            control = AVKON_CONFIRMATION_QUERY
                {
                layout = EConfirmationLayout;
                label = "Yes / No";
                animation = r_example_query_animation;
                };
            }
        };
    }


.pkg

//...
"$(EPOCROOT)Epoc32\data\z\resource\apps\Animation_0xEB023C9A.rsc"
       -"!:\resource\apps\Animation_0xEB023C9A.rsc"
"$(EPOCROOT)Epoc32\data\z\private\EB023C9A\animation.mbm"
   -"!:\private\EB023C9A\animation.mbm"


Source file

#include <Animation_0xEB023C9A.rsg>
#include <aknquerydialog.h> 
 
//...   
CAknQueryDialog* exampleDialog = CAknQueryDialog::NewL();
TInt selection = exampleDialog->ExecuteLD(R_EXAMPLE_ANIMATION_DIALOG);
    
if (selection == EAknSoftkeyYes)
    {
    //"Yes" selected, do something...   
    }
else
    {
    //"No" selected, do something...
    }


Postconditions

The confirmation query dialog with an animation is shown to the user.

See also

Implementing Animation using CAknBitmapAnimation

Related Discussions
Thread Thread Starter Forum Replies Last Post
how to display a dialog from backgroung exe navjotsingh1979 General Symbian C++ 2 2006-12-03 07:53
RichText, Dialog, CharMap dialog ronald29 Symbian User Interface 0 2007-12-06 06:00
how many colors are supported in mms Michaelf General Messaging 1 2002-08-19 14:42
Multiline Query with Floating point editor gives EIKON-DIALOG 0 Shilpa13 Symbian User Interface 0 2006-04-29 09:19
UI Design aleksjej Tools and SDK Feedback 1 2007-09-19 18:09
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX