Every time the choice list's status changes, e.g. when the user opens or closed the list or selects an item from the list, the client application is informed through the MCoeControlObserver interface.
Notifications are received by the HandleControlEventL callback function in the class MCoeControlObserver . The event is EEventStateChanged .
After receiving the event, the client application can use the choice list's SelectedIndex method to request if the selection has changed.
void CMyAppContainer::HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ) { if ( aControl == iChoiceList ) { switch ( aEventType ) { case EEventStateChanged: { TInt newSelection = iChoiceList->SelectedIndex(); if ( iSelection != newSelection ) { // selected item changed iSelection = newSelection; } } break; default: break; } } }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.