×
Namespaces

Variants
Actions

How to select an item in CAknSelectionListDialog

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: rihoe (01 Nov 2007)
Last edited: hamishwillee (30 May 2013)

You should inherit your class from CAknSelectionListDialog and overwrite PostLayoutDynInitL

class CMySelectionListDialog : public CAknSelectionListDialog
{
public:
static CMySelectionListDialog *NewL( TInt &aOpenedItem, MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aCommand = 0 );
protected:
CMySelectionListDialog ( TInt &aIndex, MDesCArray *aArray, MEikCommandObserver *aCommand );
void PostLayoutDynInitL();
TInt iSelIndex;
};
CMySelectionListDialog::CMySelectionListDialog( TInt &aIndex, MDesCArray *aArray, MEikCommandObserver *aCommand )
: CAknSelectionListDialog(aIndex,aArray,aCommand)
{
iSelIndex=aIndex;
}
 
CMySelectionListDialog *CMySelectionListDialog::NewL( TInt &aOpenedItem, MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aCommand )
{
CMySelectionListDialog * self = new (ELeave)CMySelectionListDialog(aOpenedItem, aArray, aCommand );
CleanupStack::PushL(self);
self->ConstructL(aMenuBarResourceId);
CleanupStack::Pop(); // self;
return self;
 
}
 
void CMySelectionListDialog::PostLayoutDynInitL()
{
ListBox()->SetCurrentItemIndex(iSelIndex);
}
This page was last modified on 30 May 2013, at 07:34.
39 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.

×