EventColour.red = 40; EventColour.green = 80; EventColour.blue = 80;
EventListFrame->SetSizer(EventListFrameSizer);
- /*CalendarEntry1->SetColour(&EventColour);
- CalendarEntry1->SetDisplayAlarm(false);
- CalendarEntry1->SetDisplayHighPriority(false);
- EventListFrameSizer->Add(CalendarEntry1, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
-
- EventColour.red = 255; EventColour.green = 0; EventColour.blue = 0;
- CalendarEntry2->SetColour(&EventColour);
- CalendarEntry2->SetDisplayAlarm(true);
- CalendarEntry2->SetDisplayHighPriority(false);
- EventListFrameSizer->Add(CalendarEntry2, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
-
- EventColour.red = 0; EventColour.green = 255; EventColour.blue = 0;
- CalendarEntry3->SetColour(&EventColour);
- CalendarEntry3->SetDisplayAlarm(false);
- CalendarEntry3->SetDisplayHighPriority(false);
- EventListFrameSizer->Add(CalendarEntry3, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
-
- EventColour.red = 0; EventColour.green = 0; EventColour.blue = 255;
- CalendarEntry4->SetColour(&EventColour);
- CalendarEntry4->SetDisplayAlarm(false);
- CalendarEntry4->SetDisplayHighPriority(false);
- EventListFrameSizer->Add(CalendarEntry4, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
-
- EventListFrameSizer->Add(CalendarEntry5, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
- EventListFrameSizer->Add(CalendarEntry6, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
- EventListFrameSizer->Add(CalendarEntry7, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
- EventListFrameSizer->Add(CalendarEntry8, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
- EventListFrameSizer->Add(CalendarEntry9, 0, wxEXPAND, 5);
- EventListFrameSizer->Add(0, 5, 0, 0, 5);
- EventListFrameSizer->Add(CalendarEntry10, 0, wxEXPAND, 5);*/
EventListFrame->SetScrollRate(0,1);
//EventListFrameSizer->FitInside(EventListFrame);
// Setup the scroll window.
+ MainSectionSizer->Add(EventListFrame, 1, wxGROW | wxALL, 10);
+
WindowSizer->Add(TopSectionSizer, 1, wxEXPAND, 5);
WindowSizer->Add(MainSectionSizer, 1, wxEXPAND, 5);
- MainSectionSizer->Add(EventListFrame, 1, wxGROW | wxALL, 10);
this->SetSizer(WindowSizer);
this->SetSize(size);
this->SetBackgroundStyle(wxBG_STYLE_PAINT);
this->Centre(wxBOTH);
- /*CalendarEntryList.push_back(CalendarEntry1);
- CalendarEntryList.push_back(CalendarEntry2);
- CalendarEntryList.push_back(CalendarEntry3);
- CalendarEntryList.push_back(CalendarEntry4);
- CalendarEntryList.push_back(CalendarEntry5);
- CalendarEntryList.push_back(CalendarEntry6);
- CalendarEntryList.push_back(CalendarEntry7);
- CalendarEntryList.push_back(CalendarEntry8);
- CalendarEntryList.push_back(CalendarEntry9);
- CalendarEntryList.push_back(CalendarEntry10);*/
-
UpdateTopIcons();
}
}
-void XCCalendarDay::SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer)
+void XCCalendarDay::SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage)
{
// Set the day
NumberText->SetLabel(wxString::Format("%02i", SetupDay));
+ calendarDay = SetupDay;
// Set the month
+
+ calendarMonth = SetupMonth;
// Set the year.
+
+ calendarYear = SetupYear;
// Setup the Is In Month value.
this->MonthViewPointer = MonthViewPointer;
-}
\ No newline at end of file
+ // Setup the calendar items.
+
+ CDSEntryList calendarItems = dataStorage->GetEventListByDate(SetupYear, SetupMonth, SetupDay);
+
+ for (int entrySeek = 0; entrySeek < calendarItems.entryList.size(); entrySeek++){
+
+ // Get the information about the calendar entry.
+
+ CDSGetCalendarEntryInfo newEntryInfo = dataStorage->GetEvent(calendarItems.entryList[entrySeek]);
+ CDSGetCalendarInfo newEntryCalendarInfo = dataStorage->GetCalendar(newEntryInfo.calendarID);
+
+ // Setup the calendar entry.
+
+ XCCalendarDayEntry *newEntry = new XCCalendarDayEntry(EventListFrame, newEntryInfo.entryName, wxDefaultPosition, wxDefaultSize, calendarItems.entryList[entrySeek]);
+
+ newEntry->SetColour(&newEntryCalendarInfo.calendarColour);
+ newEntry->SetTime(newEntryInfo.entryStartHour, newEntryInfo.entryStartMinute, newEntryInfo.entryStartSecond);
+ newEntry->SetEntryIDs(newEntryCalendarInfo.accountID, newEntryInfo.calendarID, newEntryInfo.calendarEntryID);
+
+ EventListFrameSizer->Add(newEntry, 0, wxEXPAND, 5);
+ wxSizerItem *afterSpacer = EventListFrameSizer->Add(0, 5, 0, 0, 5);
+
+ newEntry->SetAfterSpacer(afterSpacer);
+
+ CalendarEntryList.push_back(newEntry);
+ }
+
+}