You Are Here:

Community: Wiki

This page was last modified on 29 September 2009, at 12:33.

Querying selection with list

From Forum Nokia Wiki

Reviewer Approved   

The CAknListQueryDialog API is designed for asking user to select options presented as a list. The following function shows how to use it:

TInt ShowQueryDialogL(CArrayPtr< CGulIcon >* aIcons,
CDesCArray* aSelectArrray, CArrayFixFlat<TInt>* aSelectedItems)
{
CAknListQueryDialog* dialog =
new(ELeave)CAknListQueryDialog(aSelectedItems);
dialog->PrepareLC(R_SELECTION_QUERY);
 
dialog->SetItemTextArray(aSelectArrray);
dialog->SetOwnershipType(ELbmDoesNotOwnItemArray);
 
dialog->SetIconArrayL(aIcons);
 
return dialog->RunLD();
}

The aIcons argument variable should be an icon array that includes two icons with masks. The first is for selected items and the second is for unselected items. The aSelectArray should have the text item array used with the listbox. The text strings also need to include the icon index and with two icons the index for text string icons should be 1. The aSelectedItems argument variable will hold indices of the selected items when finished.

Like all dialogs the CAknListQueryDialog also requires resource definition. This example function uses the following resource definition:

RESOURCE DIALOG r_selection_query
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtListQueryControl;
id = EListQueryControl;
control = AVKON_LIST_QUERY_CONTROL
{
listtype = EAknCtSingleGraphicPopupMenuListBox;
listbox = LISTBOX
{
flags = EAknListBoxMultiselectionList;
height = 3;
width = 3;
};
heading = "Select";
};
}
};
}

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fE25E455E25A6E2582E25E454E25BE44E2595E25E455E259CE25A8E25E456E2594E25B6E25E454E25BBE25B6E25E457E25AE45E25B1E25E455E2588E259BE25E455E25BBE25BAE25E457E259FE25AE44E25E454E25BFE25A1X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx5E2E0000X