I’m trying to retrieve an integer value from a DLG_LINE on a S60 device. Below is a sample from my *.rss file that defines a part of the interface.
I use the following code to obtain a reference to the editor, and then call GetTextAsInteger(Tint x) to retrieve the value entered by the user.
type = EAknCtQuery;
id = EGeneralAmountQuery;
control = AVKON_DATA_QUERY
layout = ENumberLayout;
label = "Amount (£):";
control = AVKON_INTEGER_EDWIN
min = 1;
max = 10;
The above code causes a runtime error. I found that this is caused by the nested control struct in the DLG_LINE. If I remove the outer control struct (and therefore also the label and layout fields of that struct) the code works fine and the values can be retrieved.
CAknIntegerEdwin* amountEditor = static_cast<CAknIntegerEdwin*>(ControlOrNull(EGeneralAmountQuery));
CAknNumericEdwin::TValidationStatus amountStatus = amountEditor->GetTextAsInteger(tmpAmount);
All books and online examples seem to have an outer control struct of type AVKON_DATA_QUERY with an inner control struct of type AVKON_INTEGER_EDWIN (for example), but nowhere can I find the code to retrieve the values entered by the user.
Summary: Does anyone have any code or can offer any help in retrieving values from an interface defined by the rss code at the top of this post.