WEB开发网
开发学院手机开发Symbian 开发 Symbian 控件架构之对话框 阅读

Symbian 控件架构之对话框

 2010-04-20 15:44:00 来源:WEB开发网   
核心提示:control = EDWIN{width = 5;lines = 1;maxlength = 15;};};}};}调用该类的代码TBuf<128> text; //保存用户输入信息TBuf<128> prompt(_L("Enter text:")); //提示CAknT

control = EDWIN

{

width = 5;

lines = 1;

maxlength = 15;

};

};

}

};

}

调用该类的代码

TBuf<128> text; //保存用户输入信息

TBuf<128> prompt(_L("Enter text:")); //提示

CAknTextQueryDialog *dlg = new(ELeave)CAknTextQueryDialog(text, prompt);

dlg->SetMaxLength(20);

if (dlg->ExecuteLD(R_TEXT_QUERY))

{ //OK被按下

}

2、列表询问对话框

RESOURCE AVKON_LIST_QUERY r_demo_list_query

{

flags = EGeneralQueryFlags;

softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;

items =

{

AVKON_LIST_QUERY_DLG_LINE

{

control = AVKON_LIST_QUERY_CONTROL

{

listtype = EAknCtSinglePopupMenuListBox;

listbox = AVKON_LIST_QUERY_LIST

{

array_id = r_demo_list_query_item;

};

heading = "Select one item:";

};

}

};

}

RESOURCE ARRAY r_demo_list_query_item

{

items =

{

LBUF {txt = "First item"; },

LBUF {txt = "Second item"; },

LBUF {txt = "Third item"; }

};

}

调用的代码

TInt index( 0 );

CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( &index );

if ( dlg->ExecuteLD(R_DEMO_LIST_QUERY) )

{

// ok pressed, index is the selected item index.

}

程序中动态设置列表项例子

TInt index( 0 );

CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( &index );

CDesCArrayFlat *aArray = new(ELeave)CDesCArrayFlat(3);

TBuf<16> aString;

aString.Format(_L("Item %d"), 1);

aArray->AppendL(aString);

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

Tags:Symbian 控件 架构

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