关闭

进度条对话框

366人阅读 评论(0) 收藏 举报

进度条对话框类为:CAknProgressDialog
头文件:aknprogressdialog.h
lib: avkon.lib eikcdlg.lib eikctl.lib

 

使用方法:

Code:
//初始化进度条
CAknProgressDialog* iProgressDialog;
CEikProgressInfo* iProgressInfo;
iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast
                                                        <CEikDialog**>
                                                        ( &iProgressDialog ) );
   iProgressDialog->SetCallback( this );
   iProgressDialog->PrepareLC( R_RESOURCE_PROGRESS_NOTE );   //从资源文件构造对话框,资源见下面的定义
   iProgressInfo = iProgressDialog->GetProgressInfoL();
   iProgressInfo->SetFinalValue( aMaxValue );   //设置进度条的最大值(结束值)
   iProgressDialog->RunLD();
 
   //更新进度条
   iProgressInfo->IncrementAndDraw( aStep ); 

//结束进度条
iProgressDialog->ProcessFinishedL();
delete iProgressDialog;

RESOURCE DIALOG R_RESOURCE_PROGRESS_NOTE   //进度条对话框资源
     {
     flags = EAknProgressNoteFlags;
     buttons = R_AVKON_SOFTKEYS_CANCEL;
     items =
         {
         DLG_LINE
             {
             type = EAknCtNote;
             id = EMagicBoxCtrlIdProgressNote;
             control = AVKON_NOTE
                 {
                 layout = EProgressLayout;
                 singular_label = "对话框中显示的文字";
                 plural_label = "download";
                 imagefile = AVKON_BMPFILE_NAME;    //第二版中 图标文件为 #define AVKON_BMPFILE_NAME "z://system//data//avkon.mbm"
                 imageid = EMbmAvkonQgn_note_sml;   //这两项可更改显示不同图标
                 imagemask = EMbmAvkonQgn_note_sml_mask;
                 };
             }
         };
     }

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:30003次
    • 积分:603
    • 等级:
    • 排名:千里之外
    • 原创:33篇
    • 转载:7篇
    • 译文:0篇
    • 评论:2条
    最新评论