×
Namespaces

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

Querying Numbers

From Nokia Developer 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;
};
};
}
};
}
33 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.

×