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 = EDurationLayout;
label = qtn_aknexquery_dura_label_text;
control = DURATION_EDITOR
{
minDuration = DURATION
{
};
maxDuration = DURATION
{
seconds = AKNEXQUERY_DURATION_EDITOR_MAX_SECOND;
};
flags = AKNEXQUERY_DURATION_EDITOR_FLAGS;
};
};
}
};
}
其中:
STRUCT DURATION_EDITOR
{
STRUCT minDuration; // DURATION
STRUCT maxDuration; // DURATION
BYTE flags=0; // permitted flags:
// EEikTimeWithout[Seconds][Hours]Field
}
STRUCT DURATION
{
LONG seconds=0; // must be greater than or equal to zero
}
持续时间请求对话框对应的类是:CAknDurationQueryDialog。下面代码示例之:
TTimeIntervalSeconds duration;
// create dialog instance; duration is a reference to
// TTimeIntervalSeconds object that is used for the editor
CAknDurationQueryDialog* dlg = CAknDurationQueryDialog::NewL(duration, CAknQueryDialog::ENoTone );
// launch the dialog with resource
if (dlg->ExecuteLD(R_AKNEXQUERY_DURATION_LAYOUT))
{
// ok pressed, duration is a TtimeIntervalSeconds object
// containing the entered duration in the editor.
}
浮点数请求对话框
RESOURCE DIALOG r_demo_floating_query
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtQuery;
更多精彩
赞助商链接