×
Namespaces

Variants
Actions

简易“关于”对话框

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
kcomex 在 01 Apr 2007 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

下面的代码示例演示了如何使用CAknMessageQueryDialog类来显示你的应用程序的“关于”对话框。注意,本例中的“关于”文本实在原代码文件(cpp)中集成的,你同样可以使用读取自RSS资源文件的方式来显示他们:


C++源代码

_LIT(KtxAbbout, "My application and its version \n\n" \
"Copyright me 1999-2007, All right" \
"reserved.\n\nemail:\nme@mymail.com\n" \
"Homepage:\nwww.myhome.com");
_LIT(KtxApplicationName ,"My Application");
 
 
HBufC* Abbout = KtxAbbout().AllocLC();
TPtr Pointter(Abbout->Des());
CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
dlg->PrepareLC(R_ABOUT_HEADING_PANE);
dlg->SetHeaderTextL(KtxApplicationName);
dlg->RunLD();
 
CleanupStack::PopAndDestroy(Abbout);

资源文件定义

RESOURCE DIALOG r_about_heading_pane
{
flags=EEikDialogFlagNoDrag |EEikDialogFlagCbaButtons |EEikDialogFlagWait;
buttons = R_AVKON_SOFTKEYS_BACK;
items =
{
DLG_LINE
{
type = EAknCtPopupHeadingPane;
id = EAknMessageQueryHeaderId;
control = AVKON_HEADING
{
};
},
DLG_LINE
{
type = EAknCtMessageQuery;
id = EAknMessageQueryContentId;
control = AVKON_MESSAGE_QUERY
{
message = "";
};
}
};
}
This page was last modified on 15 December 2011, at 13:38.
57 page views in the last 30 days.
×