X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fwidgets%2FXCCalendarDay.cpp;h=656ad75518da4a6304c269c9333f99bbde76ee62;hp=78c16874420ee3ef7a8edc8a860f2065fdf13e71;hb=902d948e5e45ad483c8e235690dda8f2bf596ad5;hpb=49cd1caba10366538e7f87181d2ff90b5c715693 diff --git a/source/widgets/XCCalendarDay.cpp b/source/widgets/XCCalendarDay.cpp index 78c1687..656ad75 100644 --- a/source/widgets/XCCalendarDay.cpp +++ b/source/widgets/XCCalendarDay.cpp @@ -118,6 +118,18 @@ XCCalendarDay::~XCCalendarDay(){ // Destory the controls from the widget. + Unbind(XCCALENDARDAY_DESELECTOTHERENTRIES, &XCCalendarDay::DeselectOthersEvent, this, ID_DESELECTOTHERENTRIES); + Unbind(XCCALENDARDAY_DESELECTALLENTRIES, &XCCalendarDay::DeselectAllEvent, this, ID_DESELECTALLITEMS); + Unbind(XCCALENDARDAY_HIDEACCOUNTENTRIES, &XCCalendarDay::HideAccountEntries, this, ID_HIDEENTRIES); + Unbind(XCCALENDARDAY_SHOWACCOUNTENTRIES, &XCCalendarDay::ShowAccountEntries, this, ID_SHOWENTRIES); + Unbind(XCCALENDARDAY_HIDECALENDARENTRIES, &XCCalendarDay::HideCalendarEntries, this, ID_HIDECALENDARENTRIES); + Unbind(XCCALENDARDAY_SHOWCALENDARENTRIES, &XCCalendarDay::ShowCalendarEntries, this, ID_SHOWCALENDARENTRIES); + Unbind(XCCALENDARDAY_DELETECALENDARENTRIES, &XCCalendarDay::DeleteCalendarEntries, this, ID_DELETECALENDARENTRIES); + Unbind(XCCALENDARDAY_DELETEENTRY, &XCCalendarDay::DeleteCalendarEntry, this, ID_DELETEENTRY); + Unbind(XCCALENDARDAY_ADDENTRY, &XCCalendarDay::AddCalendarEntry, this, ID_ADDENTRY); + Unbind(XCCALENDARDAY_UPDATEENTRY, &XCCalendarDay::UpdateCalendarEntry, this, ID_UPDATEENTRY); + Unbind(XCCALENDARDAY_UPDATECALENDARCOLOUR, &XCCalendarDay::UpdateCalendarColour, this, ID_UPDATECOLOUR); + for (vector::iterator calendarEntryIter = calendarEntryList.begin(); calendarEntryIter != calendarEntryList.end(); calendarEntryIter++){ @@ -125,6 +137,14 @@ XCCalendarDay::~XCCalendarDay(){ } + eventListFrameSizer->Clear(); + + eventListFrame->SetSizer(nullptr, true); + + mainSectionSizer->Clear(); + topSectionSizer->Clear(); + windowSizer->Clear(); + delete alertIcon; alertIcon = nullptr; @@ -134,8 +154,22 @@ XCCalendarDay::~XCCalendarDay(){ delete eventListFrame; eventListFrame = nullptr; + delete numberText; + numberText = nullptr; + + delete topPanel; + topPanel = nullptr; + + delete mainPanel; + mainPanel = nullptr; + calendarEntryList.clear(); + this->SetSizer(nullptr, true); + + monthViewPointer = nullptr; + dataStorage = nullptr; + } void XCCalendarDay::UpdateTopIcons(){ @@ -538,7 +572,8 @@ void XCCalendarDay::AddCalendarEntry(wxCommandEvent &eventData){ EventProperties *eventInfo = (EventProperties*)eventData.GetClientData(); - XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(eventListFrame, eventInfo->eventName, wxDefaultPosition, wxDefaultSize, eventInfo->eventID); + // TODO: Fix conversion from string to wxString + XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(eventListFrame, wxString(eventInfo->eventName.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, eventInfo->eventID); CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar(eventInfo->calendarID); @@ -599,7 +634,6 @@ void XCCalendarDay::UpdateCalendarEntry(wxCommandEvent &eventData){ (*calendarEntryIter)->SetEventName(eventInfo->eventName); (*calendarEntryIter)->SetTime(eventInfo->eventHour, eventInfo->eventMinute, eventInfo->eventSecond); - } }