}
__pPm->RemoveCalendarEventChangedEventListener(*this);
- if(__pSelectedEvent)
+ if (__pSelectedEvent)
{
__pSelectedEvent->RemoveAll(true);
delete __pSelectedEvent;
{
groupCount += TOP_BOTTOM_GROUP_ITEM_COUNT;
}
- if(groupCount == 0 && __pTwoButtonPopup != NULL)
+ if (groupCount == 0 && __pTwoButtonPopup != NULL)
{
__pTwoButtonPopup->SetShowState(false);
}
EventDeleterForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex,
int elementId, ListItemStatus status)
{
+ int actualGroupIndex = groupIndex;
if (__topBottomItemEnabled == true)
{
DateTime today = EventListPresentationModel::GetToday();
today.SetValue(today.GetYear(), today.GetMonth(), today.GetDay(), 0, 0, 0);
+ actualGroupIndex -= TOP_BOTTOM_ITEM_COUNT;
if (groupIndex == 0)
{
Invalidate(true);
}
+ const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(actualGroupIndex, itemIndex);
+ RecordId id;
+ if (pEventInst != null)
+ {
+ id = pEventInst->GetOriginalEventId();
+ }
+ AutoCheckSameEvents(id,status);
SetAllSelectedEvents(listView, groupIndex, itemIndex, status);
UpdateSelectedLabel();
}
__pPm->AddCalendarEventChangedEventListener(*this);
UpdateSelectedLabel();
- if(__pSelectedEvent != null)
+ if (__pSelectedEvent != null)
{
__pSelectedEvent->RemoveAll(true);
}
for (int j = 0; j < itemCount; j++)
{
const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(i - startGroupIndex, j);
- if(pEventInst != null)
+ if (pEventInst != null)
{
RecordId id = pEventInst->GetOriginalEventId();
- __pSelectedEvent->Add(new (std::nothrow) Integer(id));
+ __pSelectedEvent->Add(new (std::nothrow) Integer(id));
__pGroupedListViewDeleteList->SetItemChecked(i, j, true);
}
}
for (int j = 0; j < itemCount; j++)
{
const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(i - startGroupIndex, j);
- if(pEventInst != null)
+ if (pEventInst != null)
{
RecordId id = pEventInst->GetOriginalEventId();
__pSelectedEvent->Remove(Integer(id));
actualGroupIndex -= TOP_BOTTOM_ITEM_COUNT;
}
const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(actualGroupIndex, itemIndex);
- if(pEventInst != null)
+ if (pEventInst != null)
{
RecordId id = pEventInst->GetOriginalEventId();
if (status == LIST_ITEM_STATUS_CHECKED)
}
void
+EventDeleterForm::AutoCheckSameEvents(RecordId id_original, ListItemStatus status)
+{
+ int startGroupIndex = 0;
+ int endGroupIndex = __pGroupedListViewDeleteList->GetGroupCount() - 1;
+
+ if (__topBottomItemEnabled == true)
+ {
+ startGroupIndex = TOP_BOTTOM_ITEM_COUNT;
+ endGroupIndex -= TOP_BOTTOM_ITEM_COUNT;
+ }
+
+
+ for (int i = startGroupIndex; i <= endGroupIndex; i++)
+ {
+ int itemCount = __pGroupedListViewDeleteList->GetItemCountAt(i);
+ for (int j = 0; j < itemCount; j++)
+ {
+ const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(i - startGroupIndex, j);
+ if (pEventInst != null)
+ {
+ RecordId id = pEventInst->GetOriginalEventId();
+ if (id == id_original)
+ {
+ __pGroupedListViewDeleteList->SetItemChecked(i, j, (status == LIST_ITEM_STATUS_CHECKED)?true:false);
+ }
+ }
+ }
+ }
+
+
+}
+void
EventDeleterForm::OnCalendarEventChanged(void)
{
__pGroupedListViewDeleteList->UpdateList();
int itemCount = __pGroupedListViewDeleteList->GetItemCountAt(i);
for (int j = 0; j < itemCount; j++)
{
- if (__pGroupedListViewDeleteList->IsItemChecked(i, j) == true)
+ const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(i - startGroupIndex, j);
+ if (pEventInst != null)
{
- const CalEventInstance* pEventInst = __pPm->GetEventWithWholeIndex(i - startGroupIndex, j);
- if(pEventInst != null)
+ RecordId id = pEventInst->GetOriginalEventId();
+ if (__pSelectedEvent->Contains(Integer(id)))
{
- RecordId id = pEventInst->GetOriginalEventId();
- if (__pSelectedEvent->Contains(Integer(id)))
- {
- __pGroupedListViewDeleteList->SetItemChecked(i, j, true);
- }
+ __pGroupedListViewDeleteList->SetItemChecked(i, j, true);
}
}
}
}
- if(IsSelectedAllEvent())
+ if (IsSelectedAllEvent())
{
- __pSelectAll->SetSelected(true);
+ __pSelectAll->SetSelected(true);
}
else
{
- __pSelectAll->SetSelected(false);
+ __pSelectAll->SetSelected(false);
}
__pSelectBeforeToday->SetSelected(false);
UpdateSelectedLabel();
- if(!IsSelectedAnyEvent() && __pTwoButtonPopup != null && __pTwoButtonPopup->GetShowState() == true)
+ if (!IsSelectedAnyEvent() && __pTwoButtonPopup != null && __pTwoButtonPopup->GetShowState() == true)
{
__pTwoButtonPopup->SetShowState(false);
}