Symbian 对话框用法
2010-03-05 06:11:00 来源:WEB开发网buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtQuery;
id = EGeneralQuery;
control= AVKON_DATA_QUERY
{
layout = ENumberLayout;
label = qtn_aknexquery_num_label_text;
control = AVKON_INTEGER_EDWIN
// 这个AKNEXQUERY_NUMBER_EDITOR_MIN在帮助中没有找到 设置上下限 这个在UI设计中可以再属性列表下找到
{
min = AKNEXQUERY_NUMBER_EDITOR_MIN;
max = AKNEXQUERY_NUMBER_EDITOR_MAX;
};
};
}
};
}
数字请求对话框对应的类是:CAknNumberQueryDialog。下面代码示例之:
#include
TInt number(123456);
// create dialog instance; number is the descriptor that is used for // the editor
CAknNumberQueryDialog* dlg = new (ELeave) CAknNumberQueryDialog (number);
// Prepares the dialog, constructing it from the specified resource
dlg->PrepareLC(R_AKNEXQUERY_NUMBER_LAYOUT);
// Set maximum and minimum to editor. This overrides values given in // resource. - optional
dlg->SetMinimumAndMaximum( 0, 1000000 );
//这里又设置下 有点不懂 查帮助 Set minimum and maximum number to editor. 上面是定义资源 这里才是实现
// Launch the dialog
if (dlg->RunLD())
{
// ok pressed, number is the entered number in the editor.
}
以下这些都来自网络 本人没有仔细分析 请楼下的大牛帮助本人 谢谢
时间/日期请求对话框
RESOURCE DIALOG r_aknexquery_time_query
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtQuery;
id = EGeneralQuery;
更多精彩
赞助商链接