uifw/AvKon/src/aknview.cpp
branchRCL_3
changeset 8 71dd06cfe933
parent 5 aabf2c525e0f
child 9 0aa5fbdfbc30
equal deleted inserted replaced
7:08e69e956a8c 8:71dd06cfe933
    80         void CreateAndSetToolbarL( TInt aResourceId ); 
    80         void CreateAndSetToolbarL( TInt aResourceId ); 
    81         
    81         
    82     public:
    82     public:
    83         TBool iToolbarVisible; 
    83         TBool iToolbarVisible; 
    84         TBool iToolbarFocusing; 
    84         TBool iToolbarFocusing; 
    85         TBool iViewActivated;
       
    86     private: // data
    85     private: // data
    87         CAknToolbar* iToolbar;
    86         CAknToolbar* iToolbar;
    88         CAknToolbar* iFixedToolbar;
    87         CAknToolbar* iFixedToolbar;
    89         CAknView* iView;
    88         CAknView* iView;
    90     };
    89     };
   426 		delete iMenu;
   425 		delete iMenu;
   427 		}
   426 		}
   428 
   427 
   429 	delete iCba;
   428 	delete iCba;
   430 	delete iExtension;
   429 	delete iExtension;
       
   430 
       
   431     AknItemActionMenuRegister::RemoveConstructingMenuBarOwner( this );
   431 	}
   432 	}
   432 
   433 
   433 // -----------------------------------------------------------------------------
   434 // -----------------------------------------------------------------------------
   434 // CAknView::BaseConstructL
   435 // CAknView::BaseConstructL
   435 // Second-phase base class constructor. Must be called from a derived classes
   436 // Second-phase base class constructor. Must be called from a derived classes
   457         CleanupStack::PopAndDestroy(); // r
   458         CleanupStack::PopAndDestroy(); // r
   458         }
   459         }
   459         
   460         
   460     Extension()->CreateToolbarL( iViewInfo.iToolbar );
   461     Extension()->CreateToolbarL( iViewInfo.iToolbar );
   461 
   462 
   462     if ( iViewInfo.iMenu )
   463     AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
   463         {
       
   464         AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
       
   465         }
       
   466     }
   464     }
   467 
   465 
   468 // -----------------------------------------------------------------------------
   466 // -----------------------------------------------------------------------------
   469 // CAknView::AppUi
   467 // CAknView::AppUi
   470 // Accessor for the app UI as a CAknViewAppUi.
   468 // Accessor for the app UI as a CAknViewAppUi.
   578 // Called by the application UI when a view is activated.
   576 // Called by the application UI when a view is activated.
   579 // -----------------------------------------------------------------------------
   577 // -----------------------------------------------------------------------------
   580 //
   578 //
   581 EXPORT_C void CAknView::AknViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage )
   579 EXPORT_C void CAknView::AknViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage )
   582 	{
   580 	{
       
   581     AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
   583 	ConstructMenuAndCbaL( ETrue );
   582 	ConstructMenuAndCbaL( ETrue );
   584 
   583 
   585     if ( !iViewInfo.iMenu )
       
   586         {
       
   587         AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
       
   588         }
       
   589     
   584     
   590 	Extension()->PrepareToolbar();
   585 	Extension()->PrepareToolbar();
   591 
   586 
   592 	DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
   587 	DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
   593 
       
   594     if ( !Extension()->iViewActivated || !iViewInfo.iMenu )
       
   595         {
       
   596         // Reset menu bar owner when view first activated
       
   597         AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( NULL );
       
   598         Extension()->iViewActivated = ETrue;
       
   599         }
       
   600 
       
   601 #ifdef RD_SCALABLE_UI_V2
       
   602     if ( iAvkonAppUi->TouchPane() )
       
   603         {
       
   604         iAvkonAppUi->TouchPane()->RefreshL();
       
   605         }
       
   606 #endif // RD_SCALABLE_UI_V2
       
   607 
   588 
   608 	ProcessForegroundEventL( ETrue );
   589 	ProcessForegroundEventL( ETrue );
   609 	}
   590 	}
   610 
   591 
   611 // -----------------------------------------------------------------------------
   592 // -----------------------------------------------------------------------------
   619 
   600 
   620     Extension()->StopDisplayingToolbar( EFalse );
   601     Extension()->StopDisplayingToolbar( EFalse );
   621 
   602 
   622 	DoDeactivate();
   603 	DoDeactivate();
   623 
   604 
       
   605 	AknItemActionMenuRegister::RemoveConstructingMenuBarOwner( this );
       
   606 	
   624 	if ( iCba )
   607 	if ( iCba )
   625 		{
   608 		{
   626 		iCba->MakeVisible( EFalse );
   609 		iCba->MakeVisible( EFalse );
   627 		}
   610 		}
   628 	}
   611 	}