X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fwidgets%2FXCCalendarDayEntry.cpp;h=034e5e725c09fa50cb8054d44b39f7e27c893c7c;hp=82b8b9c53158bc7f136061e0c6c5af7c70892041;hb=902d948e5e45ad483c8e235690dda8f2bf596ad5;hpb=49cd1caba10366538e7f87181d2ff90b5c715693 diff --git a/source/widgets/XCCalendarDayEntry.cpp b/source/widgets/XCCalendarDayEntry.cpp index 82b8b9c..034e5e7 100644 --- a/source/widgets/XCCalendarDayEntry.cpp +++ b/source/widgets/XCCalendarDayEntry.cpp @@ -101,6 +101,45 @@ XCCalendarDayEntry::~XCCalendarDayEntry(){ // Destory the controls from the widget. + // Disconnect and unbind. + + calendarColour->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + alarmIcon->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + highPriorityIcon->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + eventText->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + eventTime->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + dayPanel->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + + calendarColour->Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this); + alarmIcon->Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this); + highPriorityIcon->Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this); + eventText->Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this); + eventTime->Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this); + dayPanel->Disconnect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this); + + Unbind(XCCALENDARDAYENTRY_DESELECT, &XCCalendarDayEntry::Deselect, this, ID_ENTRYDESELECT); + + // Delete the controls. + + mainSizer->Clear(); + + delete eventText; + eventText = nullptr; + + delete eventTime; + eventTime = nullptr; + + delete calendarColour; + calendarColour = nullptr; + + delete mainPanel; + mainPanel = nullptr; + + delete highPriorityIcon; + delete alarmIcon; + + this->SetSizer(nullptr, true); + } void XCCalendarDayEntry::UpdateInformation(){ @@ -350,7 +389,7 @@ void XCCalendarDayEntry::SetAfterSpacer(wxSizerItem *afterSpacer){ void XCCalendarDayEntry::SetEventName(string eventName){ - eventText->SetLabel((wxString)eventName); + eventText->SetLabel(wxString(eventName)); }