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);
}
-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);
// 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);
#include "../common/events.h"
#include "../common/monthviewgen.h"
+#include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
+
#include "XCCalendarMonthView.h"
#include "XCCalendarMonthViewDayTitle.h"
#include "XCCalendarDay.h"
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);