if (pItemType->Equals(VALUE_CALENDAR_EVENT_TYPE, false) == true)
{
CalEvent* pEvent = __pCalendarbook->GetEventN(pItemId->value);
- if (pEvent != null)
+ if (pEvent != null && ((pEvent->GetStartTime()).CompareTo(Calendarbook::GetMinDateTime()) > 0 &&
+ (pEvent->GetEndTime()).CompareTo(Calendarbook::GetMaxDateTime()) < 0))
{
__pList->SetAt(pEvent, __selectedIndex);
}
else if (pItemType->Equals(VALUE_CALENDAR_TODO_TYPE, false) == true)
{
CalTodo* pTodo = __pCalendarbook->GetTodoN(pItemId->value);
- if (pTodo != null)
+ if (pTodo != null && (pTodo->GetStartDate()).CompareTo(Calendarbook::GetMinDateTime()) > 0)
{
__pList->SetAt(pTodo, __selectedIndex);
}
else if (dynamic_cast<CalEvent*>(pArgs->GetAt(0)) != null || dynamic_cast<CalTodo*>(pArgs->GetAt(0)) != null)
{
delete __pList;
+ IEnumerator* pEnum = pArgs->GetEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ CalEvent *pEvent = dynamic_cast<CalEvent*>(pEnum->GetCurrent());
+ CalTodo *pTodo = dynamic_cast<CalTodo*>(pEnum->GetCurrent());
+ if (pEvent && ((pEvent->GetStartTime()).CompareTo(Calendarbook::GetMinDateTime()) < 0 ||
+ (pEvent->GetEndTime()).CompareTo(Calendarbook::GetMaxDateTime()) > 0))
+ {
+ pArgs->Remove(*pEvent);
+ }
+ else if (pTodo && (pTodo->GetStartDate()).CompareTo(Calendarbook::GetMinDateTime()) < 0)
+ {
+ pArgs->Remove(*pTodo);
+ }
+ }
__pList = pArgs;
pArgs = null;
}
public:
const DateTime& GetDate(void) const;
result Initialize(const Rectangle& bounds, const DateTime& date,
- Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus);
+ Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus, Bitmap* pPress);
void SetDate(const DateTime& date);
void SetDateFocusEventListener(IDateFocusEventListener& listener);
Bitmap** __pBitmapHolidayText;
Bitmap** __pBitmapTodayText;
Bitmap* __pBitmapFocus;
+ Bitmap* __pBitmapPress;
};
CalendarPanel::CalendarPanel(void)
, __pBitmapHolidayText(null)
, __pBitmapTodayText(null)
, __pBitmapFocus(null)
+ , __pBitmapPress(null)
{
}
result
CalendarPanel::Initialize(const Rectangle& bounds, const DateTime& date,
- Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus)
+ Bitmap** pWeekText, Bitmap** pWeekdayText, Bitmap** pHolidayText, Bitmap** pTodayText, Bitmap* pFocus, Bitmap* pPress)
{
__date = date;
__pBitmapWeekText = pWeekText;
__pBitmapHolidayText = pHolidayText;
__pBitmapTodayText = pTodayText;
__pBitmapFocus = pFocus;
+ __pBitmapPress = pPress;
return Construct(bounds);
}
W_MONTH_CALENDAR, H_MONTH_CALENDAR), L"");
__pMonthCalendars[month]->SetNormalBackgroundBitmap(*ResourceManager::GetBlankBitmap());
- __pMonthCalendars[month]->SetPressedBackgroundBitmap(*ResourceManager::GetBlankBitmap());
+ __pMonthCalendars[month]->SetPressedBackgroundBitmap(*__pBitmapPress);
__pMonthCalendars[month]->SetActionId(month + 1);
__pMonthCalendars[month]->AddActionEventListener(*this);
AddControl(__pMonthCalendars[month]);
: __pPm(null)
, __pPanningAnimationManager(null)
, __pBitmapFocus(null)
+ , __pBitmapPress(null)
, __pGoToDatePopup(null)
{
memset((void *)__pPanelYearCalendar, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
// Create month calendars.
CalendarPanel* pCalendarPanel = new (std::nothrow) CalendarPanel();
pCalendarPanel->Initialize(bounds, __pPm->GetCurrentDate(),
- __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus);
+ __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus, __pBitmapPress);
__pPanningAnimationManager->AddView(*pCalendarPanel, VIEW_SCROLL_EFFECT_CURRENT);
pCalendarPanel->SetDateFocusEventListener(*this);
__pPanelYearCalendar[VIEW_SCROLL_EFFECT_CURRENT] = pCalendarPanel;
delete __pBitmapTodayText[i];
}
delete __pBitmapFocus;
+ delete __pBitmapPress;
if (__pGoToDatePopup)
{
date.SetValue(minDate.GetYear(), date.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
}
pCalendarPanel->Initialize(Rectangle(0, 0, GetWidth(), GetHeight()), date,
- __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus);
+ __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus, __pBitmapPress);
break;
case VIEW_SCROLL_EFFECT_PREVIEW:
date.AddYears(-1);
date.SetValue(maxDate.GetYear(), date.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute());
}
pCalendarPanel->Initialize(Rectangle(0, 0, GetWidth(), GetHeight()), date,
- __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus);
+ __pBitmapWeekText, __pBitmapWeekdayText, __pBitmapHolidayText, __pBitmapTodayText, __pBitmapFocus, __pBitmapPress);
break;
}
__pPanningAnimationManager->AddView(*pCalendarPanel, (ViewScrollEffect)i);
}
__pBitmapFocus = ResourceManager::GetBitmapN(IDB_YEAR_MONTH_FOCUS);
+ __pBitmapPress = ResourceManager::GetBitmapN(IDB_YEAR_MONTH_PRESS);
return E_SUCCESS;
}