Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
XCCalendarDay/XCCalendarMonthView: Fixed browse after deleting event
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 14 Feb 2017 01:34:45 +0000 (01:34 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 14 Feb 2017 01:34:45 +0000 (01:34 +0000)
source/widgets/XCCalendarDay.cpp
source/widgets/XCCalendarMonthView.cpp

index 5d48472..54e1196 100644 (file)
@@ -105,14 +105,21 @@ XCCalendarDay::~XCCalendarDay(){
        
        for (vector<XCCalendarDayEntry*>::iterator calendarEntryIter = calendarEntryList.begin();
                calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){
-       
+                       
                delete((*calendarEntryIter));
                        
        }
+
+       delete alertIcon;
+       alertIcon = nullptr;
        
-       calendarEntryList.clear();
+       delete highPriorityIcon;
+       highPriorityIcon = nullptr;
        
-       this->Refresh();
+       delete eventListFrame;
+       eventListFrame = nullptr;
+       
+       calendarEntryList.clear();
        
 }
 
@@ -490,12 +497,12 @@ void XCCalendarDay::DeleteCalendarEntries(wxCommandEvent &calendarData){
                        
                        // Get the spacing and hide it as well.
                        
-                       wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
+                       /*wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
                        afterSpacer->Show(false);
                        afterSpacer->DetachSizer();
                        
                        delete afterSpacer;
-                       afterSpacer = nullptr;
+                       afterSpacer = nullptr;*/
        
                        delete (*calendarEntryIter);
                        deleteEntriesList.push_back(calendarEntryIter);
@@ -527,12 +534,12 @@ void XCCalendarDay::DeleteCalendarEntry(wxCommandEvent &eventData){
                        
                        // Get the spacing and hide it as well.
                        
-                       wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
+                       /*wxSizerItem *afterSpacer = (*calendarEntryIter)->GetAfterSpacer();
                        afterSpacer->Show(false);
                        afterSpacer->DetachSizer();
                        
                        delete afterSpacer;
-                       afterSpacer = nullptr;
+                       afterSpacer = nullptr;*/
                        
                        delete (*calendarEntryIter);
                        deleteEntriesList.push_back(calendarEntryIter);                 
index a7443e9..dbe1fdb 100644 (file)
@@ -130,7 +130,20 @@ XCCalendarMonthView::XCCalendarMonthView(XCCalendarMonthViewGrid *grid, Calendar
 
 XCCalendarMonthView::~XCCalendarMonthView(){
        
+       delete mondayText;
+       delete tuesdayText;
+       delete wednesdayText;
+       delete thursdayText;
+       delete fridayText;
+       delete saturdayText;
+       delete sundayText;
        
+       for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+               dayIter != calendarDayList.end(); dayIter++){
+                       
+               delete ((*dayIter));
+                       
+       }
        
 }
 
@@ -341,6 +354,16 @@ void XCCalendarMonthView::UpdateCalendarEntry(wxCommandEvent &eventData){
        EventProperties *eventInfo = (EventProperties*)eventData.GetClientData();
        bool foundDate = false;
        
+       for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
+               dayIter != calendarDayList.end(); dayIter++){
+       
+               wxCommandEvent addEvent(XCCALENDARDAY_DELETEENTRY);
+               addEvent.SetId(ID_DELETEENTRY);
+               addEvent.SetInt(eventInfo->eventID);
+               wxPostEvent((*dayIter), addEvent);
+                       
+       }
+       
        for (vector<XCCalendarDay*>::iterator dayIter = calendarDayList.begin();
                dayIter != calendarDayList.end(); dayIter++){
                        
@@ -351,8 +374,8 @@ void XCCalendarMonthView::UpdateCalendarEntry(wxCommandEvent &eventData){
                        (*dayIter)->GetCalendarMonth() == (eventInfo->eventMonth + 1) &&
                        (*dayIter)->GetCalendarDay() == eventInfo->eventDay){
                        
-                       wxCommandEvent addEvent(XCCALENDARDAY_UPDATEENTRY);
-                       addEvent.SetId(ID_UPDATEENTRY);
+                       wxCommandEvent addEvent(XCCALENDARDAY_ADDENTRY);
+                       addEvent.SetId(ID_ADDENTRY);
                        addEvent.SetClientData(eventInfo);
                        wxPostEvent((*dayIter), addEvent);
                        foundDate = true;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy