calendarui/views/src/calenweekview.cpp
branchRCL_3
changeset 36 9c5b1510919f
parent 0 f979ecb2b13e
child 67 1539a383d7b6
--- a/calendarui/views/src/calenweekview.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/views/src/calenweekview.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -44,6 +44,9 @@
 #include "calendar.hrh"
 
 
+// Button position of the MSK CBA button
+const TInt KSK2CBAPosition = 2;
+
 //  LOCAL CONSTANTS AND MACROS
 #define iWeekContainer static_cast<CCalenWeekContainer*>( iContainer )
 
@@ -163,12 +166,20 @@
 // (other items were commented in a header).
 // ----------------------------------------------------------------------------
 //
-void CCalenWeekView::DoActivateImplL( const TVwsViewId& /*aPrevViewId*/,
-                                      TUid /*aCustomMessageId*/,
+void CCalenWeekView::DoActivateImplL( const TVwsViewId& aPrevViewId,
+                                      TUid aCustomMessageId,
                                       const TDesC8& /*aCustomMessage*/ )
     {
     TRACE_ENTRY_POINT;
-
+    if( aPrevViewId.iAppUid == KUidCalendar )    // switch from internal view
+            {
+            iShowBackButtonOnCba =
+                ( aCustomMessageId == KUidCalenShowBackCba ? ETrue : EFalse );
+            }
+        else
+            {
+            iShowBackButtonOnCba = EFalse;
+            }
     iWeekContainer->SetCursorToActiveDayL();
     //SetStatusPaneFromActiveContextL();
     
@@ -367,7 +378,14 @@
             iServices.IssueCommandL( aCommand );
             }
             break;
-
+        case EAknSoftkeyBack:
+            {
+            
+            SetCbaL( R_CALEN_MONTH_AND_WEEK_VIEW_CBA );
+            
+            iServices.IssueNotificationL(ECalenNotifyWeekViewClosed);
+            }
+            break;
         default:
             CCalenNativeView::HandleCommandL( aCommand );
             break;
@@ -375,6 +393,29 @@
 
     TRACE_EXIT_POINT;
     }
+// ---------------------------------------------------------
+// CCalenWeekView::UpdateCbaL
+// Set context menubar and also CBA button back / exit.
+// (other items were commented in a header).
+// ---------------------------------------------------------
+//
+void CCalenWeekView::UpdateCbaL()
+    {
+    TRACE_ENTRY_POINT;
+
+    if( iShowBackButtonOnCba )
+        {
+        CEikButtonGroupContainer*  cba = Cba();
+        cba->SetCommandL( KSK2CBAPosition, R_CALEN_BACK_CBA_BUTTON);
+        cba->DrawNow();
+        }
+    else
+        {
+        SetCbaL(R_CALEN_MONTH_AND_WEEK_VIEW_CBA);
+        }
+ 
+    TRACE_EXIT_POINT;
+    }
 
 // ----------------------------------------------------------------------------
 // CCalenWeekView::Id