×
Namespaces

Variants
Actions

How to use the Symbian C++ List Query Dialog?

From Nokia Developer Wiki
Jump to: navigation, search

This code snippet shows how to create a List Query Dialog in Symbian C++. This dialog displays a list of options, one of which can be selected by the user.

Article Metadata
Article
Created: eswar_illuri (28 May 2007)
Last edited: hamishwillee (30 Jan 2012)
TInt selectedOption( 0 );
 
CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(10);
CleanupStack::PushL(array);
 
TBuf<10> palabra;
for (TInt num= 0; num< 10; num++)
{
palabra.Format(_L("option %d"), num);
array->AppendL(palabra);
}
 
CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog( &selectedOption );
dlg->PrepareLC(R_UPDATE_QUERY_DIALOG);
dlg->SetItemTextArray(array);
dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
dlg->RunLD();
 
CleanupStack::PopAndDestroy(); //array

RSS file:

RESOURCE AVKON_LIST_QUERY r_update_query_dialog
{
flags = EGeneralQueryFlags;
softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
AVKON_LIST_QUERY_DLG_LINE
{
control = AVKON_LIST_QUERY_CONTROL
{
listtype = EAknCtSinglePopupMenuListBox;
listbox = AVKON_LIST_QUERY_LIST
{
};
heading = "Select Option";
};
}
};
}
This page was last modified on 30 January 2012, at 04:48.
21 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.

×