Symbian如何使用等待对话框
2010-05-24 17:00:00 来源:WEB开发网Symbian如何使用等待对话框
一、在View的头文件中添加
1、
#include
2、
class CAknWaitDialog;
3、
class CContainerView : public CAknView
,public MMyEncryptAndDecryptObserver
,public MProgressDialogCallback
4、
private:
void StartWaitDialog(const TDesC& aLabel);
void StopWaitDialog();
void DialogDismissedL(TInt aButtonId);
5、
private:
CAknWaitDialog* iWaitDialog;
二、在View的实现文件中添加
1、
#include
2、
void CContainerView::DialogDismissedL(TInt aButtonId)
{
if (-1 == aButtonId)
{//用户选择取消
iMyEncryptAndDecrypt->Cancel();
}
}
3、
void CContainerView::StartWaitDialog(const TDesC& aLabel)
{
if(iWaitDialog)
{
delete iWaitDialog;
iWaitDialog = NULL;
}
// For the wait dialog
iWaitDialog = new (ELeave) CAknWaitDialog(
REINTERPRET_CAST(CEikDialog**, &iWaitDialog));
iWaitDialog->SetCallback(this);
iWaitDialog->SetTextL(aLabel);
iWaitDialog->ExecuteLD(R_GENERAL_WAIT_NOTE);
}
4、
void CContainerView::StopWaitDialog()
{
// For wait dialog
iWaitDialog->ProcessFinishedL();
iWaitDialog = NULL;
}
三、添加资源
1、
RESOURCE DIALOG r_general_wait_note
{
flags = EAknWaitNoteFlags;
buttons = R_AVKON_SOFTKEYS_CANCEL;
items =
{
DLG_LINE
更多精彩
赞助商链接