Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

数字输入对话框

From Wiki
Jump to: navigation, search
Article Metadata

文章
翻译:
翻译自: Querying Numbers
hoolee
最后由 hamishwillee 在 22 Dec 2011 编辑

详细说明

CAknNumberQueryDialog API用来让用户输入数字。下列代码用来显示:

TInt ShowQueryDialogL(const TDesC& aTitle,TInt& aNumber)
{
CAknNumberQueryDialog* Dialog = CAknNumberQueryDialog::NewL(aNumber,CAknQueryDialog::ENoTone);
Dialog->PrepareLC(R_SC_DIALOG);
Dialog->SetPromptL(aTitle);
return Dialog->RunLD();
}

跟所有的对话框一样 CAknNumberQueryDialog 也需要定义资源,下列代码显示了资源如何被定义:

RESOURCE DIALOG R_SC_DIALOG
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtQuery;
id = EGeneralQuery;
control= AVKON_DATA_QUERY
{
layout = ENumberLayout;
control = AVKON_INTEGER_EDWIN
{
min = 0;
max = 9;
};
};
}
};
}
This page was last modified on 22 December 2011, at 05:04.
60 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×