Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
XCCalendarMonthView: Receive CalendarDataStorage pointer
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 29 Dec 2016 19:53:14 +0000 (19:53 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 29 Dec 2016 19:53:14 +0000 (19:53 +0000)
source/widgets/XCCalendarMonthView.cpp
source/widgets/XCCalendarMonthView.h

index 64452d5..479f59c 100644 (file)
@@ -24,10 +24,12 @@ BEGIN_EVENT_TABLE(XCCalendarMonthView, wxPanel)
 EVT_PAINT(XCCalendarMonthView::PaintFrameEvent)
 END_EVENT_TABLE()
 
-XCCalendarMonthView::XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid)
+XCCalendarMonthView::XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage)
         : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL){
        
        Connect(ID_MONTHVIEWCLEARSELECTION, XCCALENDARMONTH_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarMonthView::DeselectOthersEvent));
+       
+       calendarStorage = dataStorage;
                
        MondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
        TuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
@@ -68,10 +70,12 @@ XCCalendarMonthView::XCCalendarMonthView(wxWindow *parent, const wxString& title
        
 }
 
-XCCalendarMonthView::XCCalendarMonthView(XCCalendarMonthViewGrid *grid)
+XCCalendarMonthView::XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage)
         : wxPanel(NULL, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL){
        
        Connect(ID_MONTHVIEWCLEARSELECTION, XCCALENDARMONTH_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarMonthView::DeselectOthersEvent));
+       
+       calendarStorage = dataStorage;
                
        MondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
        TuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
@@ -140,7 +144,7 @@ void XCCalendarMonthView::ProcessGrid(XCCalendarMonthViewGrid *grid){
                                
                        // Setup the control.
                                
-                       CalendarDayItem->SetupControl((*DayIter).Day, (*DayIter).Month, (*DayIter).Year, (*DayIter).IsInMonth, this);
+                       CalendarDayItem->SetupControl((*DayIter).Day, (*DayIter).Month, (*DayIter).Year, (*DayIter).IsInMonth, this, calendarStorage);
                                
                        CalendarDayList.push_back(CalendarDayItem);
                        WindowSizer->Add(CalendarDayItem, 1, wxEXPAND, 5);
index 62b986b..3a91fd8 100644 (file)
@@ -27,6 +27,8 @@
 #include "../common/events.h"
 #include "../common/monthviewgen.h"
 
+#include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
+
 #include "XCCalendarMonthView.h"
 #include "XCCalendarMonthViewDayTitle.h"
 #include "XCCalendarDay.h"
@@ -47,13 +49,14 @@ class XCCalendarMonthView: public wxPanel
                XCCalendarMonthViewDayTitle *FridayText = nullptr;
                XCCalendarMonthViewDayTitle *SaturdayText = nullptr;
                XCCalendarMonthViewDayTitle *SundayText = nullptr;
+               CalendarDataStorage *calendarStorage = nullptr;
                void ProcessGrid(XCCalendarMonthViewGrid *grid);
        
                void Repaint();
        
        public:
-               XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid);
-               XCCalendarMonthView(XCCalendarMonthViewGrid *grid);
+               XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage);
+               XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage);
                ~XCCalendarMonthView();
        
                void PaintFrameEvent(wxPaintEvent &PaintEvent);
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