From: Steve Brokenshire Date: Wed, 16 Nov 2016 22:24:43 +0000 (+0000) Subject: Added code to XCCalendarDay X-Git-Tag: release-0.02~88 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=0eaba7c07f611e7cc94172f43e15a6be5a5e839a;p=xestiacalendar%2F.git Added code to XCCalendarDay --- 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