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.

Revision as of 12:32, 29 September 2009 by chetanknanda (Talk | contribs)

Querying Numbers

From Wiki
Jump to: navigation, search
Reviewer Approved    Thumbs up icon sm.jpg

The CAknNumberQueryDialog API is designed for querying numbers from the user. The following function shows how to use it:

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();
}

Like all dialogs the CAknNumberQueryDialog also requires resource definition. This example function uses the following resource definition:

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;
};
};
}
};
}
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.

×