uifw/AvKon/src/aknchoicelist.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 0 2f259fa3e83a
child 23 3d340a0166ff
--- a/uifw/AvKon/src/aknchoicelist.cpp	Fri Mar 12 15:43:43 2010 +0200
+++ b/uifw/AvKon/src/aknchoicelist.cpp	Mon Mar 15 12:41:34 2010 +0200
@@ -165,7 +165,8 @@
 */
 NONSHARABLE_CLASS( CAknChoiceListPopup ) : public CCoeControl,
                   public MEikListBoxObserver,                  
-                  MEikCommandObserver
+                  MEikCommandObserver,
+                  public MCoeForegroundObserver
     {
 public:      
     CAknChoiceListPopup() : iIndex( -1 ), iCancelled( EFalse )
@@ -245,6 +246,8 @@
             iAvkonAppUi->RemoveFromStack( this );
             iEikonEnv->BringForwards( EFalse );
             AknGlobalPopupPriorityController::ShowPopup(*this, EFalse);
+            DrawableWindow()->SetNonFading( EFalse );
+            iCoeEnv->RemoveForegroundObserver( *this );
             
             if ( AknLayoutUtils::PenEnabled() )
                 {
@@ -391,7 +394,9 @@
         iEikonEnv->BringForwards( ETrue );
         DrawableWindow()->SetOrdinalPosition( 0 );    
         AknGlobalPopupPriorityController::ShowPopup(*this, ETrue);
-        
+        DrawableWindow()->SetNonFading( ETrue );
+        iCoeEnv->AddForegroundObserverL( *this );
+       
         // this will fix possibly corrupted index        
         if ( iIndex < iList->Model()->ItemTextArray()->MdcaCount() && iIndex >= 0 )
             {
@@ -481,6 +486,15 @@
             }
         return EKeyWasNotConsumed;          
         }
+    
+    void HandleGainingForeground()
+        {
+        }
+
+    void HandleLosingForeground()
+        {
+        CloseChoiceList();   
+        }
 
 private: