2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file ClMonthPanel.cpp
19 * @brief This is the implementation file for the MonthPanel class.
24 #include "ClEventListPresentationModel.h"
25 #include "ClEventItem.h"
26 #include "ClGoToDatePopup.h"
27 #include "ClMainForm.h"
28 #include "ClMonthPanel.h"
29 #include "ClPanningAnimationManager.h"
30 #include "ClResourceManager.h"
31 #include "ClSharePopup.h"
32 #include "ClThreeButtonPopup.h"
33 #include "ClTwoButtonPopup.h"
36 using namespace Tizen::Base;
37 using namespace Tizen::Base::Collection;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Social;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Animations;
42 using namespace Tizen::Ui::Controls;
43 using namespace Tizen::Ui::Scenes;
47 ID_ITEM_ELEMENT_COLOR_BAR,
48 ID_ITEM_ELEMENT_SUBJECT,
49 ID_ITEM_ELEMENT_DURATION,
50 ID_ITEM_ELEMENT_LOCATION,
51 ID_ITEM_ELEMENT_REPEAT_ICON,
52 ID_ITEM_ELEMENT_ALARM_ICON
55 static const RecordId ID_DEFAULT_BIRTHDAY_CALENDAR = 3;
57 static const int IDA_MONTH_PANEL_CONTEXT_MENU_EDIT = 11311;
58 static const int IDA_MONTH_PANEL_CONTEXT_MENU_SHARE = 11312;
59 static const int IDA_MONTH_PANEL_CONTEXT_MENU_DELETE = 11313;
61 static const int Y_CALENDAR = 18;
62 static const int X_WEEK = 17;
63 static const int Y_WEEK = 0;
64 static const int W_WEEK = 98;
65 static const int H_WEEK = 38;
66 static const int FONT_SIZE_WEEK = 24;
67 static const unsigned int COLOR_WEEK = Color32<57, 57, 57>::Value;
68 static const unsigned int COLOR_WEEK_SUN = Color32<171, 60, 60>::Value;
69 static const int X_DAY = 17;
70 static const int Y_DAY = 38;
71 static const int W_DAY = 98;
72 static const int H_DAY = 107;
73 static const int H_DAY_BUTTON = 100;
74 static const int X_DAY_BITMAP = 0;
75 static const int Y_DAY_BITMAP = 0;
76 static const int FONT_SIZE_DAY = 45;
77 static const unsigned int COLOR_DAY = Color32<57, 57, 57>::Value;
78 static const unsigned int COLOR_DAY_DIM = Color32<186, 186, 186>::Value;
79 static const unsigned int COLOR_DAY_SUN = Color32<171, 60, 60>::Value;
80 static const unsigned int COLOR_DAY_SUN_DIM = Color32<224, 185, 180>::Value;
81 static const unsigned int COLOR_DAY_FOCUS = Color32<255, 255, 255>::Value;
82 static const unsigned int COLOR_EVENT_LIST_BACKGROUND = Color32<248, 246, 239>::Value;
83 static const unsigned int COLOR_EVENT_LIST_DIVIDER = Color32<169, 169, 169>::Value;
84 static const unsigned int COLOR_ITEM_DELETE_TEXT = Color32<255, 255, 255>::Value;
85 static const unsigned int COLOR_ITEM_DELETE_BACKGROUND = Color32<208, 82, 82>::Value;
86 static const unsigned int COLOR_ITEM_DELETE_PRESSED_BACKGROUND = Color32<194, 71, 71>::Value;
88 static const int WEEKDAY_COUNT = 7;
89 static const int HALF_ALPHA = 128;
90 static const int FULL_ALPHA = 255;
94 , public virtual IActionEventListener
97 const DateTime& GetDate(void) const;
98 void Initialize(const EventListPresentationModel& pm, Bitmap* pBitmapEvent, Bitmap* pBitmapEventFocus, Bitmap* pBitmapFocus, Bitmap* pBitmapToday);
99 void SetDate(const DateTime& date);
100 void SetDateFocusEventListener(IDateFocusEventListener& listener);
101 void SetDayFocus(bool focus);
102 void UpdateEvent(void);
105 virtual ~DayButton(void);
107 virtual result OnInitializing(void);
108 virtual result OnTerminating(void);
110 virtual void OnActionPerformed(const Control& source, int actionId);
113 const EventListPresentationModel* __pPm;
115 IDateFocusEventListener* __pDateFocusEventListener;
116 Bitmap* __pBitmapEvent;
117 Bitmap* __pBitmapEventFocus;
118 Bitmap* __pBitmapFocus;
119 Bitmap* __pBitmapToday;
123 DayButton::DayButton(void)
125 , __pDateFocusEventListener(null)
126 , __pBitmapEvent(null)
127 , __pBitmapEventFocus(null)
128 , __pBitmapFocus(null)
129 , __pBitmapToday(null)
134 DayButton::~DayButton(void)
139 DayButton::GetDate(void) const
145 DayButton::Initialize(const EventListPresentationModel& pm, Bitmap* pBitmapEvent, Bitmap* pBitmapEventFocus, Bitmap* pBitmapFocus, Bitmap* pBitmapToday)
147 Construct(Rectangle(0, 0, W_DAY, H_DAY_BUTTON), L"");
149 __pBitmapEvent = pBitmapEvent;
150 __pBitmapEventFocus = pBitmapEventFocus;
151 __pBitmapFocus = pBitmapFocus;
152 __pBitmapToday = pBitmapToday;
156 DayButton::SetDate(const DateTime& date)
160 Bitmap* pBitmap = null;
161 if (__isFocused == true)
163 if (__pPm->GetWholeEventCount(__date) > 0)
165 pBitmap = __pBitmapEventFocus;
169 pBitmap = __pBitmapFocus;
174 if (EventListPresentationModel::IsToday(__date) == true)
176 pBitmap = __pBitmapToday;
178 else if (__pPm->GetWholeEventCount(__date) > 0)
180 pBitmap = __pBitmapEvent;
184 pBitmap = ResourceManager::GetBlankBitmap();
189 Point position(X_DAY_BITMAP, Y_DAY_BITMAP);
190 if (pBitmap != ResourceManager::GetBlankBitmap())
192 pBitmap->SetAlphaConstant(HALF_ALPHA);
193 SetDisabledBitmap(position, *pBitmap);
194 pBitmap->SetAlphaConstant(FULL_ALPHA);
195 SetNormalBitmap(position, *pBitmap);
199 SetNormalBitmap(position, *pBitmap);
200 SetDisabledBitmap(position, *pBitmap);
204 SetText(Integer::ToString(__date.GetDay()));
205 int dayOfWeek = (__pPm->GetStartDayOfWeek(__date.GetYear(), __date.GetMonth()) + __date.GetDay() - 1) % WEEKDAY_COUNT;
208 SetTextColor(Color((__isFocused == true) ? COLOR_DAY_FOCUS : COLOR_DAY_SUN));
209 SetDisabledTextColor(Color(COLOR_DAY_SUN_DIM));
213 SetTextColor(Color((__isFocused == true) ? COLOR_DAY_FOCUS : COLOR_DAY));
214 SetDisabledTextColor(Color(COLOR_DAY_DIM));
219 DayButton::SetDateFocusEventListener(IDateFocusEventListener& listener)
221 __pDateFocusEventListener = &listener;
225 DayButton::SetDayFocus(bool focus)
227 if (__isFocused != focus)
230 Bitmap* pBitmap = null;
231 if (__isFocused == true)
233 if (__pPm->GetWholeEventCount(__date) > 0)
235 pBitmap = __pBitmapEventFocus;
239 pBitmap = __pBitmapFocus;
244 if (EventListPresentationModel::IsToday(__date) == true)
246 pBitmap = __pBitmapToday;
248 else if (__pPm->GetWholeEventCount(__date) > 0)
250 pBitmap = __pBitmapEvent;
254 pBitmap = ResourceManager::GetBlankBitmap();
259 SetNormalBitmap(Point(X_DAY_BITMAP, Y_DAY_BITMAP), *pBitmap);
260 SetDisabledBitmap(Point(X_DAY_BITMAP, Y_DAY_BITMAP), *pBitmap);
264 int dayOfWeek = (__pPm->GetStartDayOfWeek(__date.GetYear(), __date.GetMonth()) + __date.GetDay() - 1) % WEEKDAY_COUNT;
267 SetTextColor(Color((__isFocused == true) ? COLOR_DAY_FOCUS : COLOR_DAY_SUN));
268 SetDisabledTextColor(Color(COLOR_DAY_SUN_DIM));
272 SetTextColor(Color((__isFocused == true) ? COLOR_DAY_FOCUS : COLOR_DAY));
273 SetDisabledTextColor(Color(COLOR_DAY_DIM));
278 DayButton::UpdateEvent(void)
280 Bitmap* pBitmap = null;
281 if (__isFocused == true)
283 if (__pPm->GetWholeEventCount(__date) > 0)
285 pBitmap = __pBitmapEventFocus;
289 pBitmap = __pBitmapFocus;
294 if (EventListPresentationModel::IsToday(__date) == true)
296 pBitmap = __pBitmapToday;
298 else if (__pPm->GetWholeEventCount(__date) > 0)
300 pBitmap = __pBitmapEvent;
304 pBitmap = ResourceManager::GetBlankBitmap();
309 Point position(X_DAY_BITMAP, Y_DAY_BITMAP);
310 if (pBitmap != ResourceManager::GetBlankBitmap())
312 pBitmap->SetAlphaConstant(HALF_ALPHA);
313 SetDisabledBitmap(position, *pBitmap);
314 pBitmap->SetAlphaConstant(FULL_ALPHA);
315 SetNormalBitmap(position, *pBitmap);
319 SetNormalBitmap(position, *pBitmap);
320 SetDisabledBitmap(position, *pBitmap);
327 DayButton::OnInitializing(void)
329 SetNormalBackgroundBitmap(*ResourceManager::GetBlankBitmap());
330 SetPressedBackgroundBitmap(*ResourceManager::GetBlankBitmap());
331 SetHighlightedBackgroundBitmap(*ResourceManager::GetBlankBitmap());
333 Bitmap* pPressedBitmap = ResourceManager::GetBitmapN(IDB_MONTH_VIEW_DAY_PRESS);
334 if (pPressedBitmap != null)
336 SetPressedBitmap(Point(X_DAY_BITMAP, Y_DAY_BITMAP), *pPressedBitmap);
337 delete pPressedBitmap;
340 SetTextSize(FONT_SIZE_DAY);
341 SetTextColor(Color(COLOR_DAY));
342 SetPressedTextColor(Color(COLOR_DAY_FOCUS));
343 SetHighlightedTextColor(Color(COLOR_DAY_FOCUS));
344 SetDisabledTextColor(Color(COLOR_DAY_DIM));
346 AddActionEventListener(*this);
351 DayButton::OnTerminating(void)
357 DayButton::OnActionPerformed(const Control& source, int actionId)
361 if (__pDateFocusEventListener != null)
363 __pDateFocusEventListener->OnDateFocused(__date);
367 class MonthCalendarPanel
369 , public virtual IDateFocusEventListener
372 const DateTime& GetDate(void) const;
373 int GetViewHeight(void) const;
374 result Initialize(const Rectangle& bounds, const DateTime& date, const EventListPresentationModel& pm);
375 void SetDate(const DateTime& date);
376 void SetDateFocusEventListener(IDateFocusEventListener& listener);
377 void SetFocusEnabled(bool enable = true);
378 void UpdateEvent(void);
380 MonthCalendarPanel(void);
381 virtual ~MonthCalendarPanel(void);
383 virtual void OnClearBackground(void);
384 virtual result OnInitializing(void);
385 virtual result OnTerminating(void);
387 virtual void OnDateFocused(const DateTime& focusedDate);
390 static const int MONTH_CALENDAR_ROW_COUNT = 6;
391 static const int MONTH_CALENDAR_WEEKDAY_COUNT = 7;
394 const EventListPresentationModel* __pPm;
395 IDateFocusEventListener* __pDateFocusEventListener;
396 int __firstDayOfWeek;
397 int __startDayColumn;
398 Label* __pLabelWeekText[MONTH_CALENDAR_WEEKDAY_COUNT];
399 DayButton* __pDayCalendars[MONTH_CALENDAR_ROW_COUNT][MONTH_CALENDAR_WEEKDAY_COUNT];
400 Bitmap* __pBitmapEvent;
401 Bitmap* __pBitmapEventFocus;
402 Bitmap* __pBitmapFocus;
403 Bitmap* __pBitmapToday;
407 MonthCalendarPanel::MonthCalendarPanel(void)
409 , __pDateFocusEventListener(null)
410 , __firstDayOfWeek(-1)
411 , __startDayColumn(-1)
412 , __pBitmapEvent(null)
413 , __pBitmapEventFocus(null)
414 , __pBitmapFocus(null)
415 , __pBitmapToday(null)
416 , __focusEnabled(false)
418 memset((void *)__pLabelWeekText, 0, sizeof(Label*) * MONTH_CALENDAR_WEEKDAY_COUNT);
419 memset((void *)__pDayCalendars, 0, sizeof(DayButton*) * MONTH_CALENDAR_ROW_COUNT * MONTH_CALENDAR_WEEKDAY_COUNT);
422 MonthCalendarPanel::~MonthCalendarPanel(void)
427 MonthCalendarPanel::GetDate(void) const
433 MonthCalendarPanel::GetViewHeight(void) const
436 DateTime::GetDaysInMonth(__date.GetYear(), __date.GetMonth(), maxDay);
437 return Y_DAY + ((maxDay + __startDayColumn - 1) / MONTH_CALENDAR_WEEKDAY_COUNT + 1) * H_DAY;
441 MonthCalendarPanel::Initialize(const Rectangle& bounds, const DateTime& date, const EventListPresentationModel& pm)
445 __startDayColumn = __pPm->GetStartDayOfWeek(__date.GetYear(), __date.GetMonth()) - EventListPresentationModel::GetFirstDayOfWeek();
446 if (__startDayColumn < 0)
448 __startDayColumn += MONTH_CALENDAR_WEEKDAY_COUNT;
451 return Construct(bounds);
455 MonthCalendarPanel::SetDate(const DateTime& date)
457 int firstDayOfWeek = EventListPresentationModel::GetFirstDayOfWeek();
458 if (EventListPresentationModel::IsSameDay(__date, date) == false || firstDayOfWeek != __firstDayOfWeek)
460 if (date.GetYear() != __date.GetYear() || date.GetMonth() != __date.GetMonth() || firstDayOfWeek != __firstDayOfWeek)
462 if (firstDayOfWeek != __firstDayOfWeek)
464 __firstDayOfWeek = firstDayOfWeek;
465 for (int col = 0; col < MONTH_CALENDAR_WEEKDAY_COUNT; ++col)
467 int dayOfWeek = (col + firstDayOfWeek) % MONTH_CALENDAR_WEEKDAY_COUNT;
468 __pLabelWeekText[col]->SetText(ResourceManager::GetWeekShortString(dayOfWeek));
469 __pLabelWeekText[col]->SetTextColor(Color((dayOfWeek == 0) ? COLOR_WEEK_SUN : COLOR_WEEK));
470 __pLabelWeekText[col]->Invalidate(false);
473 __startDayColumn = __pPm->GetStartDayOfWeek(date.GetYear(), date.GetMonth()) - __firstDayOfWeek;
474 if (__startDayColumn < 0)
476 __startDayColumn += MONTH_CALENDAR_WEEKDAY_COUNT;
481 int prevIndex = __date.GetDay() + __startDayColumn - 1;
482 int prevRow = prevIndex / MONTH_CALENDAR_WEEKDAY_COUNT;
483 int prevCol = prevIndex % MONTH_CALENDAR_WEEKDAY_COUNT;
484 __pDayCalendars[prevRow][prevCol]->SetDayFocus(false);
485 __pDayCalendars[prevRow][prevCol]->Invalidate(false);
487 int nextIndex = date.GetDay() + __startDayColumn - 1;
488 int nextRow = nextIndex / MONTH_CALENDAR_WEEKDAY_COUNT;
489 int nextCol = nextIndex % MONTH_CALENDAR_WEEKDAY_COUNT;
490 __pDayCalendars[nextRow][nextCol]->SetDayFocus(true);
491 __pDayCalendars[nextRow][nextCol]->Invalidate(false);
498 MonthCalendarPanel::SetDateFocusEventListener(IDateFocusEventListener& listener)
500 __pDateFocusEventListener = &listener;
504 MonthCalendarPanel::SetFocusEnabled(bool enable)
506 __focusEnabled = enable;
510 MonthCalendarPanel::UpdateEvent(void)
512 for (int row = 0; row < MONTH_CALENDAR_ROW_COUNT; ++row)
514 for (int col = 0; col < MONTH_CALENDAR_WEEKDAY_COUNT; ++col)
516 __pDayCalendars[row][col]->UpdateEvent();
522 MonthCalendarPanel::OnClearBackground(void)
525 Canvas* pCanvas = GetCanvasN();
526 Bitmap* pBitmapBackground = ResourceManager::GetBitmapN(IDB_MONTH_VIEW_CALENDAR_BG);
527 if (pBitmapBackground != null)
529 pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, GetWidth(), GetHeight()), *pBitmapBackground);
530 delete pBitmapBackground;
534 int firstDayOfWeek = EventListPresentationModel::GetFirstDayOfWeek();
535 if (firstDayOfWeek != __firstDayOfWeek)
537 for (int col = 0; col < MONTH_CALENDAR_WEEKDAY_COUNT; ++col)
539 int dayOfWeek = (col + firstDayOfWeek) % MONTH_CALENDAR_WEEKDAY_COUNT;
540 __pLabelWeekText[col]->SetText(ResourceManager::GetWeekShortString(dayOfWeek));
541 __pLabelWeekText[col]->SetTextColor(Color((dayOfWeek == 0) ? COLOR_WEEK_SUN : COLOR_WEEK));
542 __pLabelWeekText[col]->Invalidate(false);
544 __startDayColumn = __pPm->GetStartDayOfWeek(__date.GetYear(), __date.GetMonth()) - firstDayOfWeek;
545 if (__startDayColumn < 0)
547 __startDayColumn += MONTH_CALENDAR_WEEKDAY_COUNT;
549 __firstDayOfWeek = firstDayOfWeek;
552 DateTime date = __pDayCalendars[0][__startDayColumn]->GetDate();
553 if (date.GetYear() != __date.GetYear() || date.GetMonth() != __date.GetMonth() || date.GetDay() != 1)
556 date.AddDays(1 - __startDayColumn - date.GetDay());
557 for (int row = 0; row < MONTH_CALENDAR_ROW_COUNT; ++row)
559 for (int col = 0; col < MONTH_CALENDAR_WEEKDAY_COUNT; ++col)
561 __pDayCalendars[row][col]->SetDate(date);
562 __pDayCalendars[row][col]->SetDayFocus(EventListPresentationModel::IsSameDay(date, __date) == true);
563 __pDayCalendars[row][col]->SetEnabled(date.GetMonth() == __date.GetMonth());
564 __pDayCalendars[row][col]->SetShowState(true);
565 __pDayCalendars[row][col]->Invalidate(false);
573 MonthCalendarPanel::OnInitializing(void)
576 for (int week = 0; week < MONTH_CALENDAR_WEEKDAY_COUNT; ++week)
578 Label* pLabel = new (std::nothrow) Label();
579 pLabel->Construct(Rectangle(X_WEEK + W_DAY * week, Y_WEEK, W_WEEK, H_WEEK), L"");
580 pLabel->SetTextConfig(FONT_SIZE_WEEK, LABEL_TEXT_STYLE_NORMAL);
582 __pLabelWeekText[week] = pLabel;
586 __pBitmapEvent = ResourceManager::GetBitmapN(IDB_MONTH_VIEW_DAY_EVENT);
587 __pBitmapEventFocus = ResourceManager::GetBitmapN(IDB_MONTH_VIEW_DAY_EVENT_FOCUS);
588 __pBitmapFocus = ResourceManager::GetBitmapN(IDB_MONTH_VIEW_DAY_FOCUS);
589 __pBitmapToday = ResourceManager::GetBitmapN(IDB_MONTH_VIEW_TODAY);
592 for (int row = 0; row < MONTH_CALENDAR_ROW_COUNT; ++row)
594 for (int col = 0; col < MONTH_CALENDAR_WEEKDAY_COUNT; ++col)
596 DayButton* pButtonDay = new (std::nothrow) DayButton();
597 pButtonDay->Initialize(*__pPm, __pBitmapEvent, __pBitmapEventFocus, __pBitmapFocus, __pBitmapToday);
598 pButtonDay->SetPosition(X_DAY + col * W_DAY, Y_DAY + row * H_DAY);
599 pButtonDay->SetDateFocusEventListener(*this);
600 AddControl(pButtonDay);
601 __pDayCalendars[row][col] = pButtonDay;
609 MonthCalendarPanel::OnTerminating(void)
611 delete __pBitmapEvent;
612 delete __pBitmapEventFocus;
613 delete __pBitmapFocus;
614 delete __pBitmapToday;
619 MonthCalendarPanel::OnDateFocused(const DateTime& focusedDate)
621 if (EventListPresentationModel::IsSameDay(__date, focusedDate) == false)
623 int index = __date.GetDay() + __startDayColumn - 1;
624 int row = index / MONTH_CALENDAR_WEEKDAY_COUNT;
625 int col = index % MONTH_CALENDAR_WEEKDAY_COUNT;
626 __pDayCalendars[row][col]->SetDayFocus(false);
627 __pDayCalendars[row][col]->Invalidate(false);
629 __date = focusedDate;
630 if (__pDateFocusEventListener != null)
632 __pDateFocusEventListener->OnDateFocused(focusedDate);
638 MonthPanel::MonthPanel(void)
641 , __pListViewEvent(null)
642 , __pContextItem(null)
643 , __pContextItemNoEdit(null)
644 , __pPanningAnimationManager(null)
645 , __pSharePopup(null)
646 , __pThreeButtonPopup(null)
647 , __pTwoButtonPopup(null)
648 , __pGoToDatePopup(null)
650 memset((void *)__pPanelMonthCalendar, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
653 MonthPanel::~MonthPanel(void)
658 MonthPanel::Initialize(void)
660 static const int _MIN_SIZE = 1;
661 return Construct(Rectangle(0, 0, _MIN_SIZE, _MIN_SIZE));
665 MonthPanel::OnInitializing(void)
667 __pPm = EventListPresentationModel::GetInstance();
669 Form* pForm = dynamic_cast<Form*>(GetParent());
670 AppAssertf(pForm != null, "[E_FAILURE] Unable to get Form.");
672 Rectangle bounds = pForm->GetClientAreaBounds();
677 // Create panning animation manager
678 __pPanningAnimationManager = new (std::nothrow) PanningAnimationManager();
679 __pPanningAnimationManager->Initialize(bounds, *this);
680 __pPanningAnimationManager->SetPanningAnimationEventListener(*this);
681 AddControl(__pPanningAnimationManager);
683 MonthCalendarPanel* pPanel = new (std::nothrow) MonthCalendarPanel();
684 pPanel->Initialize(Rectangle(0, Y_CALENDAR, bounds.width, bounds.height), __pPm->GetCurrentDate(), *__pPm);
685 __pPanningAnimationManager->AddView(*pPanel, VIEW_SCROLL_EFFECT_CURRENT);
686 pPanel->SetDateFocusEventListener(*this);
687 pPanel->SetFocusEnabled(true);
688 pPanel->SetSize(pPanel->GetWidth(), pPanel->GetViewHeight());
689 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT] = pPanel;
691 __pContextItem = new (std::nothrow) ListContextItem();
692 __pContextItem->Construct();
693 __pContextItem->AddElement(IDA_MONTH_PANEL_CONTEXT_MENU_EDIT,
694 ResourceManager::GetString(IDS_CLD_SK3_EDIT), true);
695 __pContextItem->AddElement(IDA_MONTH_PANEL_CONTEXT_MENU_SHARE,
696 ResourceManager::GetString(IDS_COM_SK4_SHARE), true);
697 __pContextItem->AddElement(IDA_MONTH_PANEL_CONTEXT_MENU_DELETE,
698 ResourceManager::GetString(IDS_CLD_SK3_DELETE), true);
699 __pContextItem->SetElementBackgroundColor(IDA_MONTH_PANEL_CONTEXT_MENU_DELETE, LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL, Color(COLOR_ITEM_DELETE_BACKGROUND));
700 __pContextItem->SetElementBackgroundColor(IDA_MONTH_PANEL_CONTEXT_MENU_DELETE, LIST_CONTEXT_ITEM_ELEMENT_STATUS_PRESSED, Color(COLOR_ITEM_DELETE_PRESSED_BACKGROUND));
701 __pContextItem->SetElementBackgroundColor(IDA_MONTH_PANEL_CONTEXT_MENU_DELETE, LIST_CONTEXT_ITEM_ELEMENT_STATUS_HIGHLIGHTED, Color(COLOR_ITEM_DELETE_PRESSED_BACKGROUND));
702 __pContextItem->SetElementTextColor(IDA_MONTH_PANEL_CONTEXT_MENU_DELETE, LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL, Color(COLOR_ITEM_DELETE_TEXT));
704 __pContextItemNoEdit = new (std::nothrow) ListContextItem();
705 __pContextItemNoEdit->Construct();
706 __pContextItemNoEdit->AddElement(IDA_MONTH_PANEL_CONTEXT_MENU_SHARE,
707 ResourceManager::GetString(IDS_COM_SK4_SHARE), true);
709 bounds.y += __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT]->GetHeight();
710 bounds.height -= bounds.y;
711 __pListViewEvent = new (std::nothrow) ListView();
712 __pListViewEvent->Construct(bounds, true, SCROLL_STYLE_FADE_OUT);
713 __pListViewEvent->SetBackgroundColor(Color(COLOR_EVENT_LIST_BACKGROUND));
714 __pListViewEvent->SetItemDividerColor(Color(COLOR_EVENT_LIST_DIVIDER));
715 __pListViewEvent->SetTextOfEmptyList(ResourceManager::GetString(IDS_CLD_BODY_NO_EVENTS));
716 __pListViewEvent->SetItemProvider(*this);
717 __pListViewEvent->AddListViewItemEventListener(*this);
718 AddControl(__pListViewEvent);
719 SetControlAlwaysOnTop(*__pListViewEvent, true);
721 __pSharePopup = new (std::nothrow) SharePopup();
722 __pSharePopup->Initialize();
724 __pThreeButtonPopup = new (std::nothrow) ThreeButtonPopup();
725 __pThreeButtonPopup->Initialize();
727 __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
728 __pTwoButtonPopup->Initialize();
730 __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
731 __pGoToDatePopup->Initialize();
737 MonthPanel::OnTerminating(void)
739 __pPm->RemoveCalendarEventChangedEventListener(*this);
740 __pPm->RemoveCurrentDateChangedEventListener(*this);
744 __pSharePopup->Destroy();
746 if (__pThreeButtonPopup)
748 __pThreeButtonPopup->Destroy();
750 if (__pTwoButtonPopup)
752 __pTwoButtonPopup->Destroy();
754 if (__pGoToDatePopup)
756 __pGoToDatePopup->Destroy();
759 delete __pContextItem;
760 delete __pContextItemNoEdit;
765 MonthPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
769 case IDA_MAIN_FORM_HEADER_TODAY:
770 __pPanningAnimationManager->CancelPanningAnimationEvent();
771 __pPm->SetTodayToCurrentDate();
773 case IDA_SUB_MENU_GO_TO_DATE:
774 __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
776 case IDA_MAIN_FORM_FOOTER_CREATE:
778 LinkedList* pArgs = new (std::nothrow) LinkedList();
779 pArgs->Add(new (std::nothrow) DateTime(__pPm->GetCurrentDate()));
780 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_EDITOR,
781 SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
784 case IDA_SUB_MENU_DELETE:
785 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_DELETER,
786 SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
788 case IDA_SUB_MENU_SEARCH:
789 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_SEARCHER,
790 SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
792 case IDA_SUB_MENU_CALENDARS:
793 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_CALENDAR_LIST,
794 SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
796 case IDA_SUB_MENU_SETTING:
797 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_SETTING,
798 SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
800 case IDA_VIEW_MENU_YEAR:
801 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_YEAR,
802 SCENE_TRANSITION_ANIMATION_TYPE_LEFT,
803 SCENE_HISTORY_OPTION_NO_HISTORY));
805 case IDA_VIEW_MENU_DAY:
806 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_DAY,
807 SCENE_TRANSITION_ANIMATION_TYPE_LEFT,
808 SCENE_HISTORY_OPTION_NO_HISTORY));
810 case IDA_VIEW_MENU_LIST:
811 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_LIST,
812 SCENE_TRANSITION_ANIMATION_TYPE_LEFT,
813 SCENE_HISTORY_OPTION_NO_HISTORY));
815 case IDA_GO_TO_DATE_POPUP_DONE:
817 DateTime selectedDate = *static_cast<DateTime*>(pArgs->GetAt(0));
818 DateTime currentDate = __pPm->GetCurrentDate();
819 currentDate.SetValue(selectedDate.GetYear(), selectedDate.GetMonth(), selectedDate.GetDay(), currentDate.GetHour(), currentDate.GetMinute());
820 __pPm->SetCurrentDate(currentDate);
823 case IDA_EVENT_POPUP_DELETE:
824 __pPm->RemoveEvent(*static_cast<CalEventInstance*>(pArgs->GetAt(0)), true);
826 case IDA_EVENT_POPUP_ONLY_THIS_EVENT_DELETE:
827 __pPm->RemoveEvent(*static_cast<CalEventInstance*>(pArgs->GetAt(0)), false);
829 case IDA_EVENT_POPUP_ALL_REPETITIVE_EVENT_DELETE:
830 __pPm->RemoveEvent(*static_cast<CalEventInstance*>(pArgs->GetAt(0)), true);
832 case IDA_EVENT_POPUP_ONLY_THIS_EVENT_EDIT:
834 pArgs->Add(new (std::nothrow) Boolean(false));
835 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_EDITOR,
836 SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
840 case IDA_EVENT_POPUP_ALL_REPETITIVE_EVENT_EDIT:
842 pArgs->Add(new (std::nothrow) Boolean(true));
843 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_EDITOR,
844 SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
852 pArgs->RemoveAll(true);
858 MonthPanel::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
860 if (status == LIST_ITEM_STATUS_SELECTED)
862 LinkedList* pArgs = new (std::nothrow) LinkedList(SingleObjectDeleter);
863 pArgs->Add(new (std::nothrow) CalEventInstance(*__pPm->GetEventWithWholeIndex(__pPm->GetCurrentDate(), index)));
864 result r = SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_DETAILS,
865 SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
874 MonthPanel::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
879 MonthPanel::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus status)
881 if (status == LIST_CONTEXT_ITEM_STATUS_SELECTED)
883 const CalEventInstance* pEvent = __pPm->GetEventWithWholeIndex(__pPm->GetCurrentDate(), index);
886 case IDA_MONTH_PANEL_CONTEXT_MENU_EDIT:
887 if (__pPm->IsEditableAllEvent(*pEvent))
889 __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEvent);
893 LinkedList* pArgs = new (std::nothrow) LinkedList(SingleObjectDeleter);
894 pArgs->Add(new (std::nothrow) CalEventInstance(*pEvent));
895 pArgs->Add(new (std::nothrow) Boolean(true));
896 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_EDITOR,
897 SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
900 case IDA_MONTH_PANEL_CONTEXT_MENU_SHARE:
901 __pSharePopup->RequestShare(pEvent->GetOriginalEventId());
903 case IDA_MONTH_PANEL_CONTEXT_MENU_DELETE:
904 if (pEvent->IsRecurring())
906 __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEvent);
910 __pTwoButtonPopup->RequestPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEvent);
918 MonthPanel::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
924 MonthPanel::OnListViewItemReordered(ListView& listView, int indexFrom, int indexTo)
930 MonthPanel::GetItemCount(void)
932 return __pPm->GetWholeEventCount(__pPm->GetCurrentDate());
936 MonthPanel::CreateItem(int index, int itemWidth)
938 const CalEventInstance* pEvent = __pPm->GetEventWithWholeIndex(__pPm->GetCurrentDate(), index);
944 EventItem* pItem = new (std::nothrow) EventItem();
945 pItem->Initialize(EVENT_ITEM_STYLE_NORMAL, itemWidth);
946 pItem->SetTitle(pEvent->GetSubject());
947 pItem->SetCalendarColor(__pPm->GetCalendarColor(pEvent->GetCalendarId()));
948 pItem->SetLocation(pEvent->GetLocation());
949 if (pEvent->IsAllDayEvent() == true)
951 pItem->SetAllDayEvent();
955 DateTime startTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetStartTime());
956 DateTime endTime = ResourceManager::ConvertUtcTimeToWallTime(pEvent->GetEndTime());
957 pItem->SetDateRange(startTime, endTime, __pPm->GetCurrentDate(), __pPm->GetTimeFormatter());
959 pItem->SetReminder(pEvent->HasReminder());
960 pItem->SetRepeat(pEvent->IsRecurring());
961 pItem->SetPriority(pEvent->GetPriority());
962 pItem->UpdateElements();
964 pItem->SetContextItem((pEvent->GetCalendarId() == ID_DEFAULT_BIRTHDAY_CALENDAR) ? __pContextItemNoEdit : __pContextItem);
969 MonthPanel::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
976 MonthPanel::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
978 AppLogDebug("Enter.");
981 pArgs->RemoveAll(true);
985 __pPm->SetViewType(VIEW_TYPE_MONTHLY);
986 MonthCalendarPanel* pCurrent = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT]);
987 if (pCurrent->GetDate().GetYear() == __pPm->GetCurrentYear() && pCurrent->GetDate().GetMonth() == __pPm->GetCurrentMonth())
989 pCurrent->UpdateEvent();
990 __pListViewEvent->UpdateList();
993 DateTime maxDateTime = Calendarbook::GetMaxDateTime();
994 maxDateTime.AddYears(-1);
995 DateTime minDateTime = Calendarbook::GetMinDateTime();
996 minDateTime.AddYears(1);
997 for (int i = VIEW_SCROLL_EFFECT_NEXT; i < VIEW_SCROLL_EFFECT_COUNT; ++i)
999 if (__pPanelMonthCalendar[i] == null)
1001 MonthCalendarPanel* pPanel = new (std::nothrow) MonthCalendarPanel();
1002 DateTime date = __pPm->GetCurrentDate();
1005 case VIEW_SCROLL_EFFECT_NEXT:
1007 if (date > maxDateTime)
1009 DateTime minDate = minDateTime;
1010 date.SetValue(minDate.GetYear(), minDate.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
1012 pPanel->Initialize(Rectangle(0, Y_CALENDAR, GetWidth(), GetHeight()), date, *__pPm);
1014 case VIEW_SCROLL_EFFECT_PREVIEW:
1016 if (date < minDateTime)
1018 DateTime maxDate = maxDateTime;
1019 date.SetValue(maxDate.GetYear(), maxDate.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
1021 pPanel->Initialize(Rectangle(0, Y_CALENDAR, GetWidth(), GetHeight()), date, *__pPm);
1024 __pPanningAnimationManager->AddView(*pPanel, (ViewScrollEffect)i);
1025 pPanel->SetDateFocusEventListener(*this);
1026 __pPanelMonthCalendar[i] = pPanel;
1030 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[i])->UpdateEvent();
1034 __pPanningAnimationManager->ResetPosition();
1037 __pPm->AddCalendarEventChangedEventListener(*this);
1038 __pPm->AddCurrentDateChangedEventListener(*this);
1039 AppLogDebug("Exit.");
1043 MonthPanel::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1045 AppLogDebug("Enter.");
1046 __pPm->RemoveCalendarEventChangedEventListener(*this);
1047 __pPm->RemoveCurrentDateChangedEventListener(*this);
1049 if (nextSceneId == IDSCN_YEAR || nextSceneId == IDSCN_DAY || nextSceneId == IDSCN_LIST)
1051 __pPanningAnimationManager->RemoveView(VIEW_SCROLL_EFFECT_NEXT);
1052 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT] = null;
1053 __pPanningAnimationManager->RemoveView(VIEW_SCROLL_EFFECT_PREVIEW);
1054 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW] = null;
1056 AppLogDebug("Exit.");
1060 MonthPanel::OnCalendarEventChanged(void)
1062 AppLogDebug("Enter.");
1063 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT])->UpdateEvent();
1064 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT])->UpdateEvent();
1065 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW])->UpdateEvent();
1066 __pListViewEvent->UpdateList();
1067 AppLogDebug("Exit.");
1071 MonthPanel::OnCurrentDateChanged(const DateTime& currentDate, const DateTime& prevDate)
1073 AppLogDebug("Enter.");
1074 DateTime currentCalendarDate = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT])->GetDate();
1075 Update(currentDate.GetYear() != currentCalendarDate.GetYear() || currentDate.GetMonth() != currentCalendarDate.GetMonth());
1076 AppLogDebug("Exit.");
1080 MonthPanel::OnDateFocused(const DateTime& focusedDate)
1082 DateTime adjustFocusedDate = focusedDate;
1083 adjustFocusedDate.AddMonths(__pPm->GetCurrentMonth() - adjustFocusedDate.GetMonth());
1084 __pPm->SetCurrentDate(adjustFocusedDate);
1085 __pListViewEvent->UpdateList();
1089 MonthPanel::GetCurrentControl(void)
1091 return __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT];
1095 MonthPanel::GetNextControl(void)
1097 return __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT];
1101 MonthPanel::GetPreviewControl(void)
1103 return __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW];
1107 MonthPanel::OnPanningAnimationEnded(ViewScrollEffect direction)
1109 DateTime maxDateTime = Calendarbook::GetMaxDateTime();
1110 maxDateTime.AddYears(-1);
1111 DateTime minDateTime = Calendarbook::GetMinDateTime();
1112 minDateTime.AddYears(1);
1113 if (__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT] != null && __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW] != null)
1115 if (direction == VIEW_SCROLL_EFFECT_PREVIEW)
1117 MonthCalendarPanel* pPanel = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT]);
1118 DateTime date = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW])->GetDate();
1120 if (date < minDateTime)
1122 DateTime maxDate = maxDateTime;
1123 date.SetValue(maxDate.GetYear(), maxDate.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
1125 pPanel->SetDate(date);
1126 pPanel->RequestRedraw(false);
1128 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT] = __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT];
1129 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT] = __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW];
1130 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW] = pPanel;
1132 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT])->SetFocusEnabled(false);
1133 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT])->SetFocusEnabled(true);
1135 else if (direction == VIEW_SCROLL_EFFECT_NEXT)
1137 MonthCalendarPanel* pPanel = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW]);
1138 DateTime date = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT])->GetDate();
1140 if (date > maxDateTime)
1142 DateTime minDate = minDateTime;
1143 date.SetValue(minDate.GetYear(), minDate.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
1145 pPanel->SetDate(date);
1146 pPanel->RequestRedraw(false);
1148 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW] = __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT];
1149 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT] = __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT];
1150 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT] = pPanel;
1152 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW])->SetFocusEnabled(false);
1153 static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT])->SetFocusEnabled(true);
1155 __pPm->SetCurrentDate(static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT])->GetDate());
1156 __pListViewEvent->UpdateList();
1161 MonthPanel::DrawCalendar(void)
1163 MonthCalendarPanel* pCurrent = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT]);
1164 DateTime current = pCurrent->GetDate();
1165 pCurrent->SetDate(__pPm->GetCurrentDate());
1166 pCurrent->SetSize(pCurrent->GetWidth(), pCurrent->GetViewHeight());
1168 int height = GetHeight() - Y_CALENDAR - pCurrent->GetHeight();
1169 if (__pListViewEvent->GetHeight() != height)
1171 __pListViewEvent->SetBounds(0, GetHeight() - height, GetWidth(), height);
1173 if (EventListPresentationModel::IsSameDay(current, __pPm->GetCurrentDate()) == false)
1175 __pListViewEvent->UpdateList();
1178 DateTime maxDateTime = Calendarbook::GetMaxDateTime();
1179 maxDateTime.AddYears(-1);
1180 DateTime minDateTime = Calendarbook::GetMinDateTime();
1181 minDateTime.AddYears(1);
1182 MonthCalendarPanel* pNextPanel = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT]);
1183 if (pNextPanel != null)
1185 DateTime nextDate = __pPm->GetCurrentDate();
1186 nextDate.AddMonths(1);
1187 if (nextDate > maxDateTime)
1189 DateTime minDate = minDateTime;
1190 nextDate.SetValue(minDate.GetYear(), minDate.GetMonth(), nextDate.GetDay(), nextDate.GetHour(), nextDate.GetMinute());
1192 pNextPanel->SetDate(nextDate);
1193 pNextPanel->SetSize(pNextPanel->GetWidth(), pCurrent->GetHeight());
1196 MonthCalendarPanel* pPrevPanel = static_cast<MonthCalendarPanel*>(__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW]);
1197 if (pPrevPanel != null)
1199 DateTime prevDate = __pPm->GetCurrentDate();
1200 prevDate.AddMonths(-1);
1201 if (prevDate < minDateTime)
1203 DateTime maxDate = maxDateTime;
1204 prevDate.SetValue(maxDate.GetYear(), maxDate.GetMonth(), prevDate.GetDay(), prevDate.GetHour(), prevDate.GetMinute());
1206 pPrevPanel->SetDate(prevDate);
1207 pPrevPanel->SetSize(pPrevPanel->GetWidth(), pCurrent->GetHeight());
1212 MonthPanel::DrawCurrentDate(void)
1214 Form* pForm = dynamic_cast<Form*>(GetParent());
1217 Header* pHeader = pForm->GetHeader();
1218 if (pHeader != null)
1220 pHeader->SetTitleText(__pPm->GetMonthString(__pPm->GetCurrentDate()));
1221 pHeader->Invalidate(false);
1227 MonthPanel::Update(bool draw)
1234 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_CURRENT]->Invalidate(true);
1235 if (__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT] != null)
1237 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_NEXT]->RequestRedraw(false);
1239 if (__pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW] != null)
1241 __pPanelMonthCalendar[VIEW_SCROLL_EFFECT_PREVIEW]->RequestRedraw(false);