进度条对话框

进度条对话框类为: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;
                 };
             }
         };
     }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值