分类: 嵌入式
2011-01-29 12:29:27
The CAknTimeQueryDialog API is designed for querying time and date values from the user. The following function shows how you can use it:
TInt ShowQueryDialogL(const TDesC& aTitle, TTime& aTime)Like all dialogs the CAknTimeQueryDialog also requires resource definition. In this example function you could use one of the following resource definition. The R_DATE_QUERY can be used to query date values and R_TIME_QUERY can be used to query time values.
RESOURCE DIALOG r_date_queryTo query both date and time same time, you could utilize CAknMultiLineDataQueryDialog API. The following sample code shows how it is used:
TInt ShowQueryDialogL(TTime& aDate,TTime& aTime)The resource definitions for this sample code:
RESOURCE DIALOG r_date_time_query常用数据查询对话框
类型 | 类 | 布局 | 控件 |
无格式文本 | CAknTextQueryDialog | EDataLayout | EDWIN |
电话号码 | CAknTextQueryDialog | EPhoneLayout | EDWIN |
PIN | CAknTextQueryDialog | EPinLayout | SECRETED |
口令 | CAknTextQueryDialog | ECodeLayout | SECRETED |
日期 | CAknTextQueryDialog | EDateLayout | DATE_EDITOR |
时间 | CAknTextQueryDialog | ETimeLayout | TIME_EDITOR |
持续期 | CAknDurationQueryDialog | EDurationLayout | TIME_EDITOR |
浮点数 | CAknFloatingPointQueryDialog | EFloatintPointLayout | FLPTED |
多行 | CAknMultiLineDataQueryDialog | EAknMultiLineDataQueryLayout | 根据使用而不同 |
数字 | CAknNumberQueryDialog | ENumberLayout | AVKON_INTEGR_EDWIN |