×
Namespaces

Variants
Actions
Revision as of 08:15, 18 September 2012 by hamishwillee (Talk | contribs)

Simple About dialog

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: symbianyucca (30 Mar 2007)
Last edited: hamishwillee (18 Sep 2012)

Following sample code illustrates how you could use CAknMessageQueryDialog to show your application’s about dialog. With the example the about text is defined as constant literal (you could use other ways as well) and the about dialogs title is set to show the application’s name:


Source code

in your l01-file:

#define about_text "App Name\n"\
"Version x.xx.xxx\n"\
"For S60 Symbian OS 9\n"\
"\n"\
"(c) Author\n"\
"2009, All right reserved.\n"\
"\n"\
"EMail:\n"\
"your_address@mail.com"

in rls-file you should include necessary files:

#ifdef LANGUAGE_01
#include "YourProject.l01"
#endif

in your rss-file you should define:

#include "YourProject.rls"
 
RESOURCE TBUF r_about_text { buf = about_text; }


in app ui file:

#include <aknmessagequerydialog.h>
#include "YourRssFile.rsg"
 
void CYourClass::ShowAboutInfoL()
{
_LIT( KtxApplicationName, "Your App Name" );
TBuf<512> mess;
HBufC *aboutText = StringLoader::LoadLC(R_ABOUT_TEXT);
TPtr ptr = aboutText->Des ();
CAknMessageQueryDialog *dlg = CAknMessageQueryDialog::NewL(ptr);
dlg->PrepareLC(R_ABOUT_DIALOG);
dlg->SetHeaderTextL (KtxApplicationName);
dlg->RunLD();
CleanupStack::PopAndDestroy(aboutText);
}

Resource definition

RESOURCE DIALOG r_about_dialog
{
flags=EEikDialogFlagNoDrag |EEikDialogFlagCbaButtons |EEikDialogFlagWait;
buttons = R_AVKON_SOFTKEYS_BACK;
items =
{
DLG_LINE
{
type = EAknCtPopupHeadingPane;
id = EAknMessageQueryHeaderId;
control = AVKON_HEADING
{
headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS;
};
},
DLG_LINE
{
type = EAknCtMessageQuery;
id = EAknMessageQueryContentId;
control = AVKON_MESSAGE_QUERY
{
message = "";
};
}
};
}
 
58 page views in the last 30 days.