uifw/AvKon/src/aknchoicelist.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 0 2f259fa3e83a
child 23 3d340a0166ff
equal deleted inserted replaced
9:aabf2c525e0f 10:9f56a4e1b8ab
   163 /**
   163 /**
   164 *  Control container for choice list
   164 *  Control container for choice list
   165 */
   165 */
   166 NONSHARABLE_CLASS( CAknChoiceListPopup ) : public CCoeControl,
   166 NONSHARABLE_CLASS( CAknChoiceListPopup ) : public CCoeControl,
   167                   public MEikListBoxObserver,                  
   167                   public MEikListBoxObserver,                  
   168                   MEikCommandObserver
   168                   MEikCommandObserver,
       
   169                   public MCoeForegroundObserver
   169     {
   170     {
   170 public:      
   171 public:      
   171     CAknChoiceListPopup() : iIndex( -1 ), iCancelled( EFalse )
   172     CAknChoiceListPopup() : iIndex( -1 ), iCancelled( EFalse )
   172         {
   173         {
   173         AKNTASHOOK_ADD( this, "CAknChoiceListPopup" );
   174         AKNTASHOOK_ADD( this, "CAknChoiceListPopup" );
   243             SetFocus( EFalse );            
   244             SetFocus( EFalse );            
   244 
   245 
   245             iAvkonAppUi->RemoveFromStack( this );
   246             iAvkonAppUi->RemoveFromStack( this );
   246             iEikonEnv->BringForwards( EFalse );
   247             iEikonEnv->BringForwards( EFalse );
   247             AknGlobalPopupPriorityController::ShowPopup(*this, EFalse);
   248             AknGlobalPopupPriorityController::ShowPopup(*this, EFalse);
       
   249             DrawableWindow()->SetNonFading( EFalse );
       
   250             iCoeEnv->RemoveForegroundObserver( *this );
   248             
   251             
   249             if ( AknLayoutUtils::PenEnabled() )
   252             if ( AknLayoutUtils::PenEnabled() )
   250                 {
   253                 {
   251                 SetPointerCapture( EFalse );
   254                 SetPointerCapture( EFalse );
   252                 }
   255                 }
   389         iIsDisplayed = ETrue;
   392         iIsDisplayed = ETrue;
   390         AknGlobalPopupPriorityController::AddPopupToControlStackL( *this );
   393         AknGlobalPopupPriorityController::AddPopupToControlStackL( *this );
   391         iEikonEnv->BringForwards( ETrue );
   394         iEikonEnv->BringForwards( ETrue );
   392         DrawableWindow()->SetOrdinalPosition( 0 );    
   395         DrawableWindow()->SetOrdinalPosition( 0 );    
   393         AknGlobalPopupPriorityController::ShowPopup(*this, ETrue);
   396         AknGlobalPopupPriorityController::ShowPopup(*this, ETrue);
   394         
   397         DrawableWindow()->SetNonFading( ETrue );
       
   398         iCoeEnv->AddForegroundObserverL( *this );
       
   399        
   395         // this will fix possibly corrupted index        
   400         // this will fix possibly corrupted index        
   396         if ( iIndex < iList->Model()->ItemTextArray()->MdcaCount() && iIndex >= 0 )
   401         if ( iIndex < iList->Model()->ItemTextArray()->MdcaCount() && iIndex >= 0 )
   397             {
   402             {
   398             iList->SetCurrentItemIndex( iIndex );
   403             iList->SetCurrentItemIndex( iIndex );
   399             }
   404             }
   478                 CloseChoiceList();
   483                 CloseChoiceList();
   479                 return EKeyWasConsumed;                
   484                 return EKeyWasConsumed;                
   480                 }            
   485                 }            
   481             }
   486             }
   482         return EKeyWasNotConsumed;          
   487         return EKeyWasNotConsumed;          
       
   488         }
       
   489     
       
   490     void HandleGainingForeground()
       
   491         {
       
   492         }
       
   493 
       
   494     void HandleLosingForeground()
       
   495         {
       
   496         CloseChoiceList();   
   483         }
   497         }
   484 
   498 
   485 private:
   499 private:
   486 
   500 
   487      // ---------------------------------------------------------
   501      // ---------------------------------------------------------