From 0eaba7c07f611e7cc94172f43e15a6be5a5e839a Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 16 Nov 2016 22:24:43 +0000 Subject: [PATCH] Added code to XCCalendarDay --- source/widgets/XCCalendarDay.cpp | 27 +++++++++++++++++++++++++++ source/widgets/XCCalendarDay.h | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/source/widgets/XCCalendarDay.cpp b/source/widgets/XCCalendarDay.cpp index 6a6d442..15c8c65 100644 --- a/source/widgets/XCCalendarDay.cpp +++ b/source/widgets/XCCalendarDay.cpp @@ -249,6 +249,33 @@ void XCCalendarDay::DeselectOthersEvent(wxCommandEvent &DeselectEvent) } + // Send event notification to deselect the other calendar entries. + + if (this->MonthViewPointer != nullptr){ + + wxCommandEvent DeselectEvent(XCCALENDARMONTH_DESELECTOTHERENTRIES); + DeselectEvent.SetClientData(this); + DeselectEvent.SetId(ID_MONTHVIEWCLEARSELECTION); + wxPostEvent(this->MonthViewPointer, DeselectEvent); + + } + +} + +void XCCalendarDay::DeselectAllEvent(wxCommandEvent &DeselectEvent) +{ + + int SelectedEntryID = DeselectEvent.GetInt(); + + wxCommandEvent DeselectEntryEvent(XCCALENDARDAYENTRY_DESELECT); + + for (vector::iterator EntryIter = CalendarEntryList.begin(); + EntryIter != CalendarEntryList.end(); EntryIter++){ + + wxPostEvent((*EntryIter), DeselectEntryEvent); + + } + } void XCCalendarDay::SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer) diff --git a/source/widgets/XCCalendarDay.h b/source/widgets/XCCalendarDay.h index e1a884b..aed2bca 100644 --- a/source/widgets/XCCalendarDay.h +++ b/source/widgets/XCCalendarDay.h @@ -28,9 +28,11 @@ #include "../common/events.h" class XCCalendarMonthView; + class XCCalendarDay: public wxPanel { private: + XCCalendarMonthView *MonthViewPointer = nullptr; wxFlexGridSizer *WindowSizer = new wxFlexGridSizer(2, 1, 0, 0); wxBoxSizer *TopSectionSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *MainSectionSizer = new wxBoxSizer(wxVERTICAL); @@ -64,10 +66,12 @@ class XCCalendarDay: public wxPanel void PaintFrameEvent(wxPaintEvent &PaintEvent); void ResizeFrameEvent(wxSizeEvent &SizeEvent); void DeselectOthersEvent(wxCommandEvent &DeselectEvent); + void DeselectAllEvent(wxCommandEvent &DeselectEvent); void UpdateTopIcons(); void SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer); DECLARE_EVENT_TABLE() + }; #endif \ No newline at end of file -- 2.39.5