diff -r 9c5b1510919f -r bf573002ff72 calendarui/commonutils/src/CalenStatusPaneUtilsImpl.cpp --- a/calendarui/commonutils/src/CalenStatusPaneUtilsImpl.cpp Wed Jun 09 09:40:23 2010 +0300 +++ b/calendarui/commonutils/src/CalenStatusPaneUtilsImpl.cpp Mon Jun 21 15:38:59 2010 +0300 @@ -20,6 +20,7 @@ #include "calencontext.h" #include "CalenStatusPaneUtilsImpl.h" #include "calentitlepane.h" + #include "calencustomnavilabel.h" #include #include @@ -102,7 +103,13 @@ AknTextUtils::DisplayTextLanguageSpecificNumberConversion(naviDes); iNaviLabel = iNaviContainer->Top(); - if(iNaviLabel != NULL) + if(iNaviLabel != NULL && iNaviLabel->ControlType() != CAknNavigationDecorator::ENaviLabel) + { + HideNaviPane(); + } + // iNaviLabel should be of type CAknNavigationDecorator::ENaviLabel for + // displaying date in navi pane. + if(iNaviLabel != NULL && iNaviLabel->ControlType() == CAknNavigationDecorator::ENaviLabel) { CCoeControl* coeRes = iNaviLabel->DecoratedControl(); CAknNaviLabel *actualLabel = static_cast(coeRes); @@ -130,6 +137,48 @@ TRACE_EXIT_POINT; return iNaviLabel; } + // ----------------------------------------------------------------------------- + // ?classname::?member_function + // ?implementation_description + // (other items were commented in a header). + // ----------------------------------------------------------------------------- + // + CAknNavigationDecorator* CCalenStatusPaneUtilsImpl::ShowNaviPaneL( const TDesC& aName, const TRgb aColor ) + { + TRACE_ENTRY_POINT; + + iNaviLabel = iNaviContainer->Top(); + if(iNaviLabel != NULL && iNaviLabel->ControlType() != CAknNavigationDecorator::ENotSpecified) + { + HideNaviPane(); + } + // iNaviLabel should be of type CAknNavigationDecorator::ENotSpecified for + // displaying calendar name and icon in navi pane. + if(iNaviLabel != NULL && iNaviLabel->ControlType() == CAknNavigationDecorator::ENotSpecified) + { + CCoeControl* coeRes = iNaviLabel->DecoratedControl(); + CCustomNaviControl *actualLabel = static_cast(coeRes); + actualLabel->SetCalendarNameAndColor(aName, aColor); + actualLabel->DrawDeferred(); + iNaviContainer->ReplaceL(*iNaviLabel, *iNaviLabel); + } + else + { + CCustomNaviControl *customControl = CCustomNaviControl::NewL(aName, aColor); + CleanupStack::PushL(customControl); + customControl->SetContainerWindowL(*iNaviContainer); + CleanupStack::Pop( customControl ); // customControl + + iNaviLabel = CAknNavigationDecorator::NewL(iNaviContainer, customControl, CAknNavigationDecorator::ENotSpecified); + + iNaviLabel->SetContainerWindowL( *iNaviContainer ); + iNaviLabel->SetControlContext( iNaviContainer ); + iNaviLabel->MakeScrollButtonVisible(EFalse); + iNaviContainer->PushL(*iNaviLabel); + } + TRACE_EXIT_POINT; + return iNaviLabel; + } // ----------------------------------------------------------------------------- // ?classname::?member_function