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 04:48, 30 January 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

From 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.
34 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.

×