Symbian 控件架构之对话框
2010-04-20 15:44:00 来源:WEB开发网Code:
CEikonEnv::Static()->InfoWinL(_L("note:"), _L("text"));
为方便使用,常定义宏来使用这类提示框,如:
Code:
#define DEBUG_DIALOG(x) iEikonEnv->AlertWin(##x);
#define DEBUG_DIALOG1(x) CEikonEnv::Static()->InfoWinL(_L("note:"), ##x);
#define DEBUG_DIALOG2(x,y) CEikonEnv::Static()->InfoWinL(##x, ##y);
可以这么使用:
TBuf<32> buf;
buf.Copy(_L("test"));
DEBUG_DIALOG(buf);
DEBUG_DIALOG1(buf);
DEBUG_DIALOG2(buf,_L("text"));
此类提示框阻塞线程,只有用户按键退出提示框后,后面的程序才能接着运行。
3、进度条对话框
进度条对话框类为:
CAknProgressDialog
头文件:aknprogressdialog.h
lib: avkon.lib eikcdlg.lib eikctl.lib
使用方法:
Code:
//初始化进度条
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;
更多精彩
赞助商链接