×
Namespaces

Variants
Actions

Querying Numbers

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: symbianyucca (09 Apr 2007)
Last edited: hamishwillee (18 Sep 2012)

TheCAknNumberQueryDialog 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;
};
};
}
};
}
This page was last modified on 18 September 2012, at 08:35.
50 page views in the last 30 days.
×