Resolved issue N_SE-39048
[apps/osp/Calendar.git] / src / ClDayPanel.cpp
index 5897a57..9d01b3d 100644 (file)
@@ -1103,6 +1103,7 @@ DayEventPanel::CollapseAllDayEventList(void)
 DayPanel::DayPanel(void)
        : __pPm(null)
        , __pPanningAnimationManager(null)
+       , __pGoToDatePopup(null)
 {
        memset((void *)__pPanelDayEvent, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
 }
@@ -1146,6 +1147,9 @@ DayPanel::OnInitializing(void)
        pPanel->SetScrollEventListener(*this);
        __pPanelDayEvent[VIEW_SCROLL_EFFECT_CURRENT] = pPanel;
 
+       __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
+       __pGoToDatePopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -1155,6 +1159,12 @@ DayPanel::OnTerminating(void)
        AppLogDebug("Enter");
        __pPm->RemoveCalendarEventChangedEventListener(*this);
        __pPm->RemoveCurrentDateChangedEventListener(*this);
+
+       if (__pGoToDatePopup)
+       {
+               __pGoToDatePopup->Destroy();
+       }
+
        return E_SUCCESS;
 }
 
@@ -1168,7 +1178,7 @@ DayPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                __pPm->SetTodayToCurrentDate();
                break;
        case IDA_SUB_MENU_GO_TO_DATE:
-               GoToDatePopup::RequestGoToDate(__pPm->GetCurrentDate(), this);
+               __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
                break;
        case IDA_MAIN_FORM_FOOTER_CREATE:
        {