WEB开发网
开发学院手机开发Symbian 开发 Symbian 中各种提示、输入对话框的使用 阅读

Symbian 中各种提示、输入对话框的使用

 2010-03-10 16:19:00 来源:WEB开发网   
核心提示://初始化进度条CAknProgressDialog* iProgressDialog;CEikProgressInfo* iProgressInfo;iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast( &iProgressDia

//初始化进度条

CAknProgressDialog* iProgressDialog;

CEikProgressInfo* iProgressInfo;

iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast

( &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;

};

}

};

}

4、等待对话框

等待对话框要用到的类:

CAknGlobalNote

头文件:aknglobalnote.h

lib:aknnotify.lib eiksrv.lib

使用方法:

Code:

//显示等待对话框

CAknGlobalNote* globalNote = CAknGlobalNote::NewL();

CleanupStack::PushL( globalNote );

TInt iWaitNoteId = globalNote->ShowNoteL( EAknGlobalWaitNote,

上一页  1 2 3 4 5 6  下一页

Tags:Symbian 各种 提示

编辑录入:coldstar [复制链接] [打 印]
赞助商链接