Tizen::Ui::Controls::ListItemBase*
SelectCalendarPopup::CreateItem(int index, int itemWidth)
{
	CustomItem* pItem = new (std::nothrow) CustomItem();
	Calendar* pCalendar = null;
	String calendarName;

	pCalendar = static_cast< Calendar* >(__pCalendarList->GetAt(index));
	TryReturn(pCalendar != null, null, "Failed to get a calendar");

	calendarName = pCalendar->GetName();
	if (calendarName.IsEmpty() == true)
	{
		calendarName = L"(Calendar ID: ";
		calendarName.Append(pCalendar->GetRecordId());
		calendarName.Append(L")");
	}
	pItem->Construct(Dimension(itemWidth, 100), LIST_ANNEX_STYLE_NORMAL);
	pItem->AddElement(Rectangle(32, 0, GetClientAreaBounds().width - 64, 112), 1, calendarName, true);
	if (__selectedCalendarId == pCalendar->GetRecordId())
	{
		__pListView->SetItemChecked(index, true);
	}
	return pItem;
}
void
SelectCalendarPopup::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
{
	if (status == LIST_ITEM_STATUS_SELECTED)
	{
		ArrayList* pList = new (std::nothrow) ArrayList();
		pList->Construct();

		Calendar* pCalendar = static_cast< Calendar* >(__pCalendarList->GetAt(index));
		pList->Add(*new (std::nothrow) Integer(pCalendar->GetRecordId()));

		__pParentForm->SendUserEvent(0, pList);
	}

}