DEFINE_EVENT_TYPE(XCCALENDARCTRL_CHANGEGRID);
DECLARE_EVENT_TYPE(XCCALENDARCTRL_CHANGEGRID, wxID_ANY)
+DEFINE_EVENT_TYPE(XCCALENDARCTRL_HIDEACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARCTRL_HIDEACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARCTRL_SHOWACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARCTRL_SHOWACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARMONTH_HIDEACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARMONTH_HIDEACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARMONTH_SHOWACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARMONTH_SHOWACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARDAY_HIDEACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARDAY_HIDEACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARDAY_SHOWACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARDAY_SHOWACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARDAYENTRY_HIDEACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARDAYENTRY_HIDEACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARDAYENTRY_SHOWACCOUNTENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARDAYENTRY_SHOWACCOUNTENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARCTRL_HIDECALENDARENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARCTRL_HIDECALENDARENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARCTRL_SHOWCALENDARENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARCTRL_SHOWCALENDARENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARDAY_HIDECALENDARENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARDAY_HIDECALENDARENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARDAY_SHOWCALENDARENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARDAY_SHOWCALENDARENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARMONTH_SHOWCALENDARENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARMONTH_SHOWCALENDARENTRIES, wxID_ANY)
+
+DEFINE_EVENT_TYPE(XCCALENDARMONTH_HIDECALENDARENTRIES);
+DECLARE_EVENT_TYPE(XCCALENDARMONTH_HIDECALENDARENTRIES, wxID_ANY)
+
+
+
#define ID_MONTHVIEWCLEARSELECTION 7000
#define ID_DESELECTALLITEMS 7001
+#define ID_HIDEENTRIES 7002
+#define ID_SHOWENTRIES 7003
+#define ID_HIDECALENDARENTRIES 7004
+#define ID_SHOWCALENDARENTRIES 7005
+#define ID_CHANGEGRID 7006
+#define ID_ENTRYDESELECT 7007
+#define ID_DESELECTOTHERENTRIES 7008
#endif
\ No newline at end of file
" entrystartyear, entrystartmonth, entrystartday, entrystarthour, entrystartminute, entrystartsecond,"
" entryendyear, entryendmonth, entryendday, entryendhour, entryendminute, entryendsecond, "
" entrydurationweek, entrydurationday, entrydurationhour, entrydurationminute, entrydurationsecond, "
- " calendarid"
+ " calendarid, id"
" FROM calendarentries WHERE id=(?1)";
resultCode = sqlite3_prepare_v2(db, sqlParameter.c_str(), -1, &statementHandle, nullptr);
entryResult.entryDurationMinutes = sqlite3_column_int(statementHandle, 17);
entryResult.entryDurationSeconds = sqlite3_column_int(statementHandle, 18);
entryResult.calendarID = sqlite3_column_int(statementHandle, 19);
+ entryResult.calendarEntryID = sqlite3_column_int(statementHandle, 20);
} else if (resultCode == SQLITE_DONE) {
entryResult.getEventResult = CDSENTRY_NOCALENDAR;
XCCalendarMonthViewGrid CurrentMonthGrid = GenerateMonthGrid(currentMonth, currentYear);
szrMain->Add(ManipulatorCtrl, 1, wxEXPAND, 5);
- MonthViewCtrl = new XCCalendarMonthView(this, "XCCalendarMonthView Test", wxDefaultPosition, wxDefaultSize, &CurrentMonthGrid, calendarStorage);
+ // TODO: Get the list of hidden accounts and calendars.
+
+ vector<int> hideAccountsList = ManipulatorCtrl->GetHiddenAccountsList();
+ vector<int> hideCalendarsList = ManipulatorCtrl->GetHiddenCalendarsList();
+
+ MonthViewCtrl = new XCCalendarMonthView(this, "XCCalendarMonthView Test", wxDefaultPosition, wxDefaultSize, &CurrentMonthGrid, calendarStorage, &hideAccountsList, &hideCalendarsList);
szrMain->Add(MonthViewCtrl, 1, wxEXPAND, 5);
- Connect(wxID_ANY, XCCALENDARCTRL_CHANGEGRID, wxCommandEventHandler(XCCalendarCtrl::UpdateGrid));
+ // Connect events to the control.
+
+ Connect(ID_CHANGEGRID, XCCALENDARCTRL_CHANGEGRID, wxCommandEventHandler(XCCalendarCtrl::UpdateGrid));
+ Connect(ID_HIDEENTRIES, XCCALENDARCTRL_HIDEACCOUNTENTRIES, wxCommandEventHandler(XCCalendarCtrl::HideAccountEntries));
+ Connect(ID_SHOWENTRIES, XCCALENDARCTRL_SHOWACCOUNTENTRIES, wxCommandEventHandler(XCCalendarCtrl::ShowAccountEntries));
+ Connect(ID_HIDECALENDARENTRIES, XCCALENDARCTRL_HIDECALENDARENTRIES, wxCommandEventHandler(XCCalendarCtrl::HideCalendarEntries));
+ Connect(ID_SHOWCALENDARENTRIES, XCCALENDARCTRL_SHOWCALENDARENTRIES, wxCommandEventHandler(XCCalendarCtrl::ShowCalendarEntries));
}
OldGrid = MonthViewCtrl;
+ // Get the list of hidden accounts and calendars.
+
+ vector<int> hideAccountsList = ManipulatorCtrl->GetHiddenAccountsList();
+ vector<int> hideCalendarsList = ManipulatorCtrl->GetHiddenCalendarsList();
+
// Create a new grid.
XCCalendarMonthViewGrid NewGrid = GenerateMonthGrid(ManipulatorCtrl->GetMonth(), ManipulatorCtrl->GetYear());
- MonthViewCtrl = new XCCalendarMonthView(this, _(""), wxDefaultPosition, wxDefaultSize, &NewGrid, calendarStorage);
+ MonthViewCtrl = new XCCalendarMonthView(this, _(""), wxDefaultPosition, wxDefaultSize, &NewGrid, calendarStorage, &hideAccountsList, &hideCalendarsList);
// Detach the old grid and attach the new one.
delete OldGrid;
OldGrid = nullptr;
+}
+
+void XCCalendarCtrl::HideAccountEntries(wxCommandEvent &accountData){
+
+ // Get the list of calendar IDs for the account and go through
+ // the list of entries in each day control.
+
+ wxCommandEvent event(XCCALENDARMONTH_HIDEACCOUNTENTRIES);
+ event.SetInt(accountData.GetInt());
+ event.SetId(ID_HIDEENTRIES);
+ wxPostEvent(MonthViewCtrl, event);
+
+}
+
+void XCCalendarCtrl::ShowAccountEntries(wxCommandEvent &accountData){
+
+ // Get the list of calendar IDs for the account and go through
+ // the list of entries in each day control.
+
+ wxCommandEvent event(XCCALENDARMONTH_SHOWACCOUNTENTRIES);
+ event.SetInt(accountData.GetInt());
+ event.SetId(ID_SHOWENTRIES);
+ wxPostEvent(MonthViewCtrl, event);
+
+}
+
+void XCCalendarCtrl::HideCalendarEntries(wxCommandEvent &calendarData){
+
+ // Get the list of calendar IDs for the account and go through
+ // the list of entries in each day control.
+
+ wxCommandEvent event(XCCALENDARMONTH_HIDECALENDARENTRIES);
+ event.SetInt(calendarData.GetInt());
+ event.SetId(ID_HIDECALENDARENTRIES);
+ wxPostEvent(MonthViewCtrl, event);
+
+}
+
+void XCCalendarCtrl::ShowCalendarEntries(wxCommandEvent &calendarData){
+
+ // Get the list of calendar IDs for the account and go through
+ // the list of entries in each day control.
+
+ wxCommandEvent event(XCCALENDARMONTH_SHOWCALENDARENTRIES);
+ event.SetInt(calendarData.GetInt());
+ event.SetId(ID_SHOWCALENDARENTRIES);
+ wxPostEvent(MonthViewCtrl, event);
+
}
\ No newline at end of file
protected:
void UpdateGrid(wxCommandEvent &event);
+ void HideAccountEntries(wxCommandEvent &accountData);
+ void ShowAccountEntries(wxCommandEvent &accountData);
+ void HideCalendarEntries(wxCommandEvent &calendarData);
+ void ShowCalendarEntries(wxCommandEvent &calendarData);
public:
XCCalendarCtrl(wxWindow *parent, CalendarDataStorage *storage);
XCCalendarDay::XCCalendarDay(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size)
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){
-
- Connect(wxID_ANY, XCCALENDARDAY_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarDay::DeselectOthersEvent));
- Connect(ID_DESELECTALLITEMS, XCCALENDARDAY_DESELECTALLENTRIES, wxCommandEventHandler(XCCalendarDay::DeselectAllEvent));
this->SetMinSize( wxSize( 100,100 ) );
UpdateTopIcons();
+ Connect(ID_DESELECTOTHERENTRIES, XCCALENDARDAY_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarDay::DeselectOthersEvent));
+ Connect(ID_DESELECTALLITEMS, XCCALENDARDAY_DESELECTALLENTRIES, wxCommandEventHandler(XCCalendarDay::DeselectAllEvent));
+ Connect(ID_HIDEENTRIES, XCCALENDARDAY_HIDEACCOUNTENTRIES, wxCommandEventHandler(XCCalendarDay::HideAccountEntries));
+ Connect(ID_SHOWENTRIES, XCCALENDARDAY_SHOWACCOUNTENTRIES, wxCommandEventHandler(XCCalendarDay::ShowAccountEntries));
+ Connect(ID_HIDECALENDARENTRIES, XCCALENDARDAY_HIDECALENDARENTRIES, wxCommandEventHandler(XCCalendarDay::HideCalendarEntries));
+ Connect(ID_SHOWCALENDARENTRIES, XCCALENDARDAY_SHOWCALENDARENTRIES, wxCommandEventHandler(XCCalendarDay::ShowCalendarEntries));
+
}
XCCalendarDay::~XCCalendarDay(){
// Destory the controls from the widget.
+ for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
+ CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+
+ delete((*CalendarEntryIter));
+
+ }
+
+ CalendarEntryList.clear();
+
+ this->Refresh();
+
}
void XCCalendarDay::Repaint(){
void XCCalendarDay::DeselectOthersEvent(wxCommandEvent &DeselectEvent)
{
-
+
int SelectedEntryID = DeselectEvent.GetInt();
wxCommandEvent DeselectEntryEvent(XCCALENDARDAYENTRY_DESELECT);
+ DeselectEntryEvent.SetId(ID_ENTRYDESELECT);
for (vector<XCCalendarDayEntry*>::iterator EntryIter = CalendarEntryList.begin();
EntryIter != CalendarEntryList.end(); EntryIter++){
{
int SelectedEntryID = DeselectEvent.GetInt();
-
+
wxCommandEvent DeselectEntryEvent(XCCALENDARDAYENTRY_DESELECT);
+ DeselectEntryEvent.SetId(ID_ENTRYDESELECT);
for (vector<XCCalendarDayEntry*>::iterator EntryIter = CalendarEntryList.begin();
EntryIter != CalendarEntryList.end(); EntryIter++){
}
-void XCCalendarDay::SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage)
+void XCCalendarDay::SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage, vector<int> *hideAccounts, vector<int> *hideCalendars)
{
// Set the day
newEntry->SetColour(&newEntryCalendarInfo.calendarColour);
newEntry->SetTime(newEntryInfo.entryStartHour, newEntryInfo.entryStartMinute, newEntryInfo.entryStartSecond);
- newEntry->SetEntryIDs(newEntryCalendarInfo.accountID, newEntryInfo.calendarID, newEntryInfo.calendarEntryID);
+ 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);
+ // Go through the list of calendar entries to hide by account.
+
+ for (vector<int>::iterator hideAccountsItem = hideAccounts->begin();
+ hideAccountsItem != hideAccounts->end(); hideAccountsItem++){
+
+ if (*hideAccountsItem = newEntryCalendarInfo.accountID){
+ newEntry->Show(false);
+ newEntry->GetAfterSpacer()->Show(false);
+ }
+
+ }
+
+ // Go through the list of calendar entries to hide by calendar.
+
+ for (vector<int>::iterator hideCalendarsItem = hideCalendars->begin();
+ hideCalendarsItem != hideCalendars->end(); hideCalendarsItem++){
+
+ if (*hideCalendarsItem == newEntryInfo.calendarID){
+ newEntry->Show(false);
+ newEntry->GetAfterSpacer()->Show(false);
+ }
+
+ }
+
CalendarEntryList.push_back(newEntry);
}
}
+
+void XCCalendarDay::HideAccountEntries(wxCommandEvent &accountData){
+
+ // Go through each of the controls and hide the controls (and spacing) that
+ // have the matched account IDs.
+
+ int sizerPosition = 0;
+
+ for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
+ CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+
+ (*CalendarEntryIter)->SetShowAccountStatus(false);
+
+ if ((*CalendarEntryIter)->GetAccountID() == accountData.GetInt()){
+
+ wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
+ (*CalendarEntryIter)->Show(false);
+
+ // Get the spacing and hide it as well.
+
+ wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ afterSpacer->Show(false);
+
+ }
+
+ }
+
+ this->Refresh();
+ Repaint();
+
+}
+
+void XCCalendarDay::ShowAccountEntries(wxCommandEvent &accountData){
+
+ // Go through each of the controls and hide the controls (and spacing) that
+ // have the matched account IDs.
+
+ int sizerPosition = 0;
+
+ for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
+ CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+
+ (*CalendarEntryIter)->SetShowAccountStatus(true);
+
+ if ((*CalendarEntryIter)->GetShowCalendarStatus() == false){
+ continue;
+ }
+
+ if ((*CalendarEntryIter)->GetAccountID() == accountData.GetInt()){
+
+ wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
+ (*CalendarEntryIter)->Show(true);
+
+ // Get the spacing and hide it as well.
+
+ wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ afterSpacer->Show(true);
+
+ }
+
+ }
+
+ this->Refresh();
+ Repaint();
+
+}
+
+void XCCalendarDay::HideCalendarEntries(wxCommandEvent &calendarData){
+
+ // Go through each of the controls and hide the controls (and spacing) that
+ // have the matched account IDs.
+
+ int sizerPosition = 0;
+
+ for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
+ CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+
+ if ((*CalendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
+
+ (*CalendarEntryIter)->SetShowCalendarStatus(false);
+
+ wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
+ (*CalendarEntryIter)->Show(false);
+
+ // Get the spacing and hide it as well.
+
+ wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ afterSpacer->Show(false);
+
+ }
+
+ }
+
+ this->Refresh();
+ Repaint();
+
+}
+
+void XCCalendarDay::ShowCalendarEntries(wxCommandEvent &calendarData){
+
+ // Go through each of the controls and hide the controls (and spacing) that
+ // have the matched account IDs.
+
+ int sizerPosition = 0;
+
+ for (vector<XCCalendarDayEntry*>::iterator CalendarEntryIter = CalendarEntryList.begin();
+ CalendarEntryIter != CalendarEntryList.end(); CalendarEntryIter++){
+
+ if ((*CalendarEntryIter)->GetCalendarID() == calendarData.GetInt()){
+
+ (*CalendarEntryIter)->SetShowCalendarStatus(true);
+
+ if ((*CalendarEntryIter)->GetShowAccountStatus() == false){
+
+ // Don't show the calendar entry because the account status
+ // is set to hidden. Continue to the next one.
+
+ continue;
+
+ }
+
+ wxSizerItem *calendarItem = EventListFrameSizer->GetItem((*CalendarEntryIter));
+ (*CalendarEntryIter)->Show(true);
+
+ // Get the spacing and hide it as well.
+
+ wxSizerItem *afterSpacer = (*CalendarEntryIter)->GetAfterSpacer();
+ afterSpacer->Show(true);
+
+ }
+
+ }
+
+ this->Refresh();
+ Repaint();
+
+}
\ No newline at end of file
#include "../bitmaps.h"
#include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
+
class XCCalendarMonthView;
class XCCalendarDay: public wxPanel
bool IsInMonth = false;
vector<XCCalendarDayEntry*> CalendarEntryList;
+ vector<size_t> CalendarEntryListIndex;
void Repaint();
+ protected:
+ void HideAccountEntries(wxCommandEvent &accountData);
+ void ShowAccountEntries(wxCommandEvent &accountData);
+ void HideCalendarEntries(wxCommandEvent &calendarData);
+ void ShowCalendarEntries(wxCommandEvent &calendarData);
+
public:
XCCalendarDay(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size);
~XCCalendarDay();
void DeselectOthersEvent(wxCommandEvent &DeselectEvent);
void DeselectAllEvent(wxCommandEvent &DeselectEvent);
void UpdateTopIcons();
- void SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage);
+ void SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
DECLARE_EVENT_TABLE()
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){
DayPanel = parent->GetParent();
- EntryID = id;
+ entryID = id;
this->SetMinSize(wxSize(65, 30));
EventTextData = title.mb_str();
- EventText = new wxStaticText(this, wxID_ANY, title, wxPoint(49, 8), wxDefaultSize, wxST_ELLIPSIZE_END);
+ EventText = new wxStaticText(this, wxID_ANY, title, wxPoint(49, 14), wxDefaultSize, wxST_ELLIPSIZE_END);
+ EventTime = new wxStaticText(this, wxID_ANY, wxT("Time"), wxPoint(49,3), wxDefaultSize, 0);
+
+ wxFont eventTimeFont = EventTime->GetFont();
+ eventTimeFont.MakeBold();
+ EventTime->SetFont(eventTimeFont);
wxMemoryInputStream alerticon(icons_alert_png, sizeof(icons_alert_png));
wxMemoryInputStream priorityicon(icons_priority_png, sizeof(icons_priority_png));
AlarmIcon->SetBitmap(AlarmIconBitmap);
HighPriorityIcon->SetBitmap(PriorityIconBitmap);
- Connect(wxID_ANY, XCCALENDARDAYENTRY_DESELECT, wxCommandEventHandler(XCCalendarDayEntry::Deselect));
- AlarmIcon->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- HighPriorityIcon->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
- EventText->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ Connect(ID_ENTRYDESELECT, XCCALENDARDAYENTRY_DESELECT, wxCommandEventHandler(XCCalendarDayEntry::Deselect));
+ AlarmIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ HighPriorityIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ EventText->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ EventTime->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ DayPanel->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
UpdateInformation();
switch(PositionMode){
case 0:
- EventText->SetPosition(wxPoint(FirstPosition,8));
+ EventText->SetPosition(wxPoint(FirstPosition,14));
+ EventTime->SetPosition(wxPoint(FirstPosition,3));
break;
case 1:
- EventText->SetPosition(wxPoint(SecondPosition,8));
+ EventText->SetPosition(wxPoint(SecondPosition,14));
+ EventTime->SetPosition(wxPoint(FirstPosition,3));
break;
case 2:
- EventText->SetPosition(wxPoint(ThirdPosition,8));
+ EventText->SetPosition(wxPoint(ThirdPosition,14));
+ EventTime->SetPosition(wxPoint(FirstPosition,3));
break;
}
switch(PositionMode){
case 0:
EventText->SetSize(wxSize((this->GetClientRect().width - FirstPosition - 5),15));
+ EventTime->SetSize(wxSize((this->GetClientRect().width - FirstPosition - 5),15));
break;
case 1:
EventText->SetSize(wxSize((this->GetClientRect().width - SecondPosition - 5),15));
+ EventTime->SetSize(wxSize((this->GetClientRect().width - SecondPosition - 5),15));
break;
case 2:
- EventText->SetSize(wxSize((this->GetClientRect().width - ThirdPosition - 5),15));
+ EventText->SetSize(wxSize((this->GetClientRect().width - ThirdPosition - 5),14));
+ EventTime->SetSize(wxSize((this->GetClientRect().width - ThirdPosition - 5),15));
break;
}
this->SetBackgroundColour(wxColor(255,215,0));
wxCommandEvent DeselectOthersEvent(XCCALENDARDAY_DESELECTOTHERENTRIES);
- DeselectOthersEvent.SetInt(EntryID);
+ DeselectOthersEvent.SetInt(entryID);
+ DeselectOthersEvent.SetId(ID_DESELECTOTHERENTRIES);
wxPostEvent(DayPanel, DeselectOthersEvent);
}
}
+void XCCalendarDayEntry::SetTime(int timeHour, int timeMinute, int timeSecond){
+
+ this->timeHour = timeHour;
+ this->timeMinute = timeMinute;
+ this->timeSecond = timeSecond;
+
+ string timeOutput = BuildEventTime(timeHour, timeMinute);
+ EventTime->SetLabel(timeOutput);
+
+}
+
void XCCalendarDayEntry::SetColour(Colour *ColourIn){
EntryColour = *ColourIn;
+ Repaint();
}
int XCCalendarDayEntry::GetID(){
- return EntryID;
+ return entryID;
+
+}
+
+int XCCalendarDayEntry::GetCalendarID(){
+
+ return calendarID;
+
+}
+
+int XCCalendarDayEntry::GetAccountID(){
+
+ return accountID;
+
+}
+
+string XCCalendarDayEntry::BuildEventTime(int timeHour, int timeMinute){
+
+ string timeOutput;
+
+ if (timeHour > 12){
+
+ timeOutput += to_string(timeHour - 12);
+
+ } else if (timeHour > 0){
+
+ timeOutput += to_string(timeHour);
+
+ } else if (timeHour == 0){
+
+ timeOutput += to_string(12);
+
+ }
+
+ timeOutput += ":";
+
+ if (timeMinute < 10){
+ timeOutput += "0";
+ }
+
+ timeOutput += to_string(timeMinute);
+
+ if (timeHour < 12){
+ timeOutput += "am";
+ } else {
+ timeOutput += "pm";
+ }
+
+ return timeOutput;
+
+}
+
+void XCCalendarDayEntry::SetEntryIDs(int accountID, int calendarID, int entryID){
+
+ this->accountID = accountID;
+ this->calendarID = calendarID;
+ this->entryID = entryID;
+
+}
+
+void XCCalendarDayEntry::SetAfterSpacer(wxSizerItem *afterSpacer){
+
+ this->afterSpacer = afterSpacer;
+
+}
+
+wxSizerItem* XCCalendarDayEntry::GetAfterSpacer(){
+
+ return afterSpacer;
+
+}
+
+bool XCCalendarDayEntry::SetShowAccountStatus(bool statusInput){
+
+ showAccount = statusInput;
+
+}
+
+bool XCCalendarDayEntry::SetShowCalendarStatus(bool statusInput){
+
+ showCalendar = statusInput;
+
+}
+
+bool XCCalendarDayEntry::GetShowAccountStatus(){
+
+ return showAccount;
+
+}
+
+bool XCCalendarDayEntry::GetShowCalendarStatus(){
+
+ return showCalendar;
}
\ No newline at end of file
private:
wxWindow *DayPanel = nullptr;
string EventTextData = "";
+ wxStaticText *EventTime = nullptr;
wxStaticText *EventText = nullptr;
wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
wxStaticBitmap *AlarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
+ wxSizerItem *afterSpacer = nullptr;
wxBitmap AlarmIconBitmap;
wxBitmap PriorityIconBitmap;
Colour EntryColour;
+ int timeHour = 0;
+ int timeMinute = 0;
+ int timeSecond = 0;
+
bool HasAlarm = false;
bool HasHighPriority = false;
int PositionMode = 0;
- int EntryID = 0;
+
+ int entryID = 0;
+ int accountID = 0;
+ int calendarID =0;
+ bool showAccount = true;
+ bool showCalendar = true;
+
const int FirstPosition = 14;
const int SecondPosition = 30;
const int ThirdPosition = 49;
void RepaintSelected();
void UpdateInformation();
+
+ string BuildEventTime(int timeHour, int timeMinute);
+
+ protected:
public:
XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
void LeftClick(wxMouseEvent &MouseEvent);
void Deselect(wxCommandEvent &DeselectEvent);
+ void SetTime(int timeHour, int timeMinute, int timeSecond);
void SetColour(Colour *ColourIn);
void SetDisplayAlarm(bool DisplayValue);
void SetDisplayHighPriority(bool DisplayValue);
+ void SetEntryIDs(int accountID, int calendarID, int entryID);
+ void SetAfterSpacer(wxSizerItem *afterSpacer);
int GetID();
+ int GetCalendarID();
+ int GetAccountID();
+ wxSizerItem* GetAfterSpacer();
bool GetDisplayAlarm();
bool GetDisplayHighPriority();
+ bool SetShowAccountStatus(bool statusInput);
+ bool SetShowCalendarStatus(bool statusInput);
+ bool GetShowAccountStatus();
+ bool GetShowCalendarStatus();
DECLARE_EVENT_TABLE()
};
// Create the control and add it to the list.
XCCalendarListAccountCtrl *newAccountCtrl = new XCCalendarListAccountCtrl(this, accountListData.accountList[AccountSeek].accountName);
+ newAccountCtrl->SetAccountID(accountListData.accountList[AccountSeek].accountID);
szrMain->Add(newAccountCtrl, 0, wxEXPAND, 5);
CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar(accountListData.accountList[AccountSeek].accountName, accountCalendarList.calendarListTextID[calendarSeek]);
XCCalendarListCalendarCtrl *newCalendarCtrl = new XCCalendarListCalendarCtrl(this, calendarInfo.calendarName, calendarInfo.calendarColour);
+ newCalendarCtrl->SetCalendarID(accountCalendarList.calendarList[calendarSeek]);
newAccountCtrl->AddCalendar(newCalendarCtrl);
checksumUpdate = currentChecksum.checksumValue;
+}
+
+std::vector<int> XCCalendarList::GetHiddenAccountsList(){
+
+ std::vector<int> accountList;
+
+ // Go through each of the account controls and work
+ // out which entries should be hidden based on account.
+
+ for (std::vector<XCCalendarListAccountCtrl*>::iterator accountListIter = accountControlList.begin();
+ accountListIter != accountControlList.end(); accountListIter++){
+
+ if ((*accountListIter)->GetShowCheckboxState() == wxCHK_UNCHECKED){
+
+ accountList.push_back((*accountListIter)->GetAccountID());
+
+ }
+
+ }
+
+ return accountList;
+
+}
+
+std::vector<int> XCCalendarList::GetHiddenCalendarsList(){
+
+ std::vector<int> calendarList;
+
+ // Go through each of the calendar controls and
+ // work out which entries should be hidden based on
+ // calendar.
+
+ for (std::vector<XCCalendarListAccountCtrl*>::iterator accountListIter = accountControlList.begin();
+ accountListIter != accountControlList.end(); accountListIter++){
+
+ // Get the list of hidden calendars.
+
+ vector<int> calendarHiddenList = (*accountListIter)->GetHiddenCalendarList();
+
+ for (vector<int>::iterator calendarHiddenIter = calendarHiddenList.begin();
+ calendarHiddenIter != calendarHiddenList.end(); calendarHiddenIter++){
+
+ vector<int>::iterator calendarHiddenFind = find(calendarList.begin(), calendarList.end(), *calendarHiddenIter);
+
+ if (calendarHiddenFind == calendarList.end()){
+
+ calendarList.push_back(*calendarHiddenIter);
+
+ }
+
+ }
+
+ }
+
+ return calendarList;
+
}
\ No newline at end of file
protected:
public:
XCCalendarList(wxWindow *parent);
- void UpdateCalendarList(CalendarDataStorage *dataStorage);
~XCCalendarList();
+ void UpdateCalendarList(CalendarDataStorage *dataStorage);
+ std::vector<int> GetHiddenAccountsList();
+ std::vector<int> GetHiddenCalendarsList();
+
};
#endif
#include "XCCalendarListAccountCtrl.h"
+BEGIN_EVENT_TABLE(XCCalendarListAccountCtrl, wxPanel)
+END_EVENT_TABLE()
+
using namespace std;
XCCalendarListAccountCtrl::XCCalendarListAccountCtrl(wxWindow* parent, string accountName) :
accountFont.MakeBold();
lblAccountName->SetFont(accountFont);
+ // Connect events to the controls.
+
+ chkShowAll->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxMouseEventHandler(XCCalendarListAccountCtrl::ShowAllCheckboxClick), NULL, this);
+ chkShowAll->SetValue(wxCHK_CHECKED);
+
// Connect them to the sizer.
szrMain->Add(chkShowAll, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
// Delete the calendar controls.
+ for (std::vector<XCCalendarListCalendarCtrl*>::iterator calendarIter = calendarControlList.begin();
+ calendarIter != calendarControlList.end(); calendarIter++){
+
+ delete *calendarIter;
+
+ }
+
+ // Clear the list of deleted controls.
+
+ calendarControlList.clear();
+
+ // Clear the widget controls.
+
}
void XCCalendarListAccountCtrl::AddCalendar(XCCalendarListCalendarCtrl *calendarControl){
calendarControlList.push_back(calendarControl);
+}
+
+void XCCalendarListAccountCtrl::ShowAllCheckboxClick( wxMouseEvent &mouseEvent ){
+
+ if (chkShowAll->Get3StateValue() == wxCHK_CHECKED){
+
+ wxCommandEvent event(XCCALENDARCTRL_SHOWACCOUNTENTRIES);
+ event.SetInt(accountID);
+ event.SetId(ID_SHOWENTRIES);
+ wxPostEvent(this->GetParent()->GetParent()->GetParent(), event);
+
+ } else {
+
+ wxCommandEvent event(XCCALENDARCTRL_HIDEACCOUNTENTRIES);
+ event.SetInt(accountID);
+ event.SetId(ID_HIDEENTRIES);
+ wxPostEvent(this->GetParent()->GetParent()->GetParent(), event);
+
+ }
+
+}
+
+wxCheckBoxState XCCalendarListAccountCtrl::GetShowCheckboxState(){
+
+ return chkShowAll->Get3StateValue();
+
+}
+
+int XCCalendarListAccountCtrl::GetAccountID(){
+
+ return accountID;
+
+}
+
+void XCCalendarListAccountCtrl::SetAccountID(int accountID){
+
+ this->accountID = accountID;
+
+}
+
+vector<int> XCCalendarListAccountCtrl::GetHiddenCalendarList(){
+
+ vector<int> calendarList;
+
+ for (vector<XCCalendarListCalendarCtrl*>::iterator calendarControlListIter = calendarControlList.begin();
+ calendarControlListIter != calendarControlList.end(); calendarControlListIter++){
+
+ if ((*calendarControlListIter)->GetShowCheckboxState() == wxCHK_UNCHECKED){
+
+ calendarList.push_back((*calendarControlListIter)->GetCalendarID());
+
+ }
+
+ }
+
+ return calendarList;
+
}
\ No newline at end of file
#include "types.h"
#include "colour.h"
+#include "events.h"
#include "XCCalendarListCalendarCtrl.h"
class XCCalendarListAccountCtrl: public wxPanel{
AccountType accountType = ACCOUNTTYPE_UNKNOWN;
std::string accountName = "";
bool showAccounts = true;
+
+ void ShowAllCheckboxClick( wxMouseEvent &mouseEvent );
public:
XCCalendarListAccountCtrl(wxWindow* parent, string accountName);
~XCCalendarListAccountCtrl();
void AddCalendar(XCCalendarListCalendarCtrl *calendarControl);
+ wxCheckBoxState GetShowCheckboxState();
+ int GetAccountID();
+ void SetAccountID(int accountID);
+ std::vector<int> GetHiddenCalendarList();
+
+ DECLARE_EVENT_TABLE();
};
szrMain->Add(lblCalendarName, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5);
szrMain->Add(pnlColour, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ // Connect the events to the controls.
+
+ chkShowCalendar->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxMouseEventHandler(XCCalendarListCalendarCtrl::ShowAllCheckboxClick), NULL, this);
+ chkShowCalendar->SetValue(wxCHK_CHECKED);
+
}
XCCalendarListCalendarCtrl::~XCCalendarListCalendarCtrl(){
// Delete the controls.
}
+
+wxCheckBoxState XCCalendarListCalendarCtrl::GetShowCheckboxState(){
+
+ return chkShowCalendar->Get3StateValue();
+
+}
+
+int XCCalendarListCalendarCtrl::GetCalendarID(){
+
+ return calendarID;
+
+}
+
+void XCCalendarListCalendarCtrl::SetCalendarID(int calendarID){
+
+ this->calendarID = calendarID;
+
+}
+
+void XCCalendarListCalendarCtrl::ShowAllCheckboxClick( wxMouseEvent &mouseEvent ){
+
+ if (chkShowCalendar->Get3StateValue() == wxCHK_CHECKED){
+
+ wxCommandEvent event(XCCALENDARCTRL_SHOWCALENDARENTRIES);
+ event.SetInt(calendarID);
+ event.SetId(ID_SHOWCALENDARENTRIES);
+ wxPostEvent(this->GetParent()->GetParent()->GetParent(), event);
+
+ } else {
+
+ wxCommandEvent event(XCCALENDARCTRL_HIDECALENDARENTRIES);
+ event.SetInt(calendarID);
+ event.SetId(ID_HIDECALENDARENTRIES);
+ wxPostEvent(this->GetParent()->GetParent()->GetParent(), event);
+
+ }
+
+}
\ No newline at end of file
#include "types.h"
#include "colour.h"
+#include "events.h"
class XCCalendarListCalendarCtrl: public wxPanel{
int calendarID = 0;
std::string calendarName = "";
bool showCalendar = true;
+ void ShowAllCheckboxClick( wxMouseEvent &mouseEvent );
public:
XCCalendarListCalendarCtrl(wxWindow* parent, string calendarName, Colour calendarColour);
~XCCalendarListCalendarCtrl();
+ wxCheckBoxState GetShowCheckboxState();
+ int GetCalendarID();
+ void SetCalendarID(int calendarID);
};
CalendarsButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::ShowCalendarsList), NULL, this);
PreviousButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarManipulator::PreviousMonth), NULL, this);
- Connect(wxID_ANY, XCCALENDARMANIPULATOR_CHANGEGRID, wxCommandEventHandler(XCCalendarManipulator::ChangeGrid));
+ Connect(ID_CHANGEGRID, XCCALENDARMANIPULATOR_CHANGEGRID, wxCommandEventHandler(XCCalendarManipulator::ChangeGrid));
// Setup the manipulator control.
// Post an event to the parent control to update the grid.
wxCommandEvent ChangeGrid(XCCALENDARCTRL_CHANGEGRID);
+ ChangeGrid.SetId(ID_CHANGEGRID);
wxPostEvent(this->GetParent(), ChangeGrid);
UpdateDateButtonText();
// Post an event to the parent control to update the grid.
wxCommandEvent ChangeGrid(XCCALENDARCTRL_CHANGEGRID);
+ ChangeGrid.SetId(ID_CHANGEGRID);
wxPostEvent(this->GetParent(), ChangeGrid);
UpdateDateButtonText();
// Post an event to the parent control to update the grid.
wxCommandEvent ChangeGrid(XCCALENDARCTRL_CHANGEGRID);
+ ChangeGrid.SetId(ID_CHANGEGRID);
wxPostEvent(this->GetParent(), ChangeGrid);
UpdateDateButtonText();
return Year;
+}
+
+vector<int> XCCalendarManipulator::GetHiddenAccountsList(){
+
+ return calendarList->GetHiddenAccountsList();
+
+}
+
+vector<int> XCCalendarManipulator::GetHiddenCalendarsList(){
+
+ return calendarList->GetHiddenCalendarsList();
+
}
\ No newline at end of file
#define __WIDGETS_XCCALENDARMANIPULATOR_H__
#include <string>
+#include <vector>
#include <wx/wx.h>
#include <wx/dcbuffer.h>
~XCCalendarManipulator();
int GetMonth();
int GetYear();
+ std::vector<int> GetHiddenAccountsList();
+ std::vector<int> GetHiddenCalendarsList();
DECLARE_EVENT_TABLE()
this->Dismiss();
wxCommandEvent UpdateGrid(XCCALENDARMANIPULATOR_CHANGEGRID);
+ UpdateGrid.SetId(ID_CHANGEGRID);
wxPostEvent(this->GetParent(), UpdateGrid);
}
EVT_PAINT(XCCalendarMonthView::PaintFrameEvent)
END_EVENT_TABLE()
-XCCalendarMonthView::XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage)
+XCCalendarMonthView::XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars)
: 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);
WindowSizer->Add(SaturdayText, 1, wxEXPAND|wxALL, 0);
WindowSizer->Add(SundayText, 1, wxEXPAND|wxALL, 0);
- ProcessGrid(grid);
+ ProcessGrid(grid, hideAccounts, hideCalendars);
// Setup the days.
this->Layout();
this->SetBackgroundColour(wxColour(0,0,0));
+ Connect(ID_MONTHVIEWCLEARSELECTION, XCCALENDARMONTH_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarMonthView::DeselectOthersEvent));
+ Connect(ID_HIDEENTRIES, XCCALENDARMONTH_HIDEACCOUNTENTRIES, wxCommandEventHandler(XCCalendarMonthView::HideAccountEntries));
+ Connect(ID_SHOWENTRIES, XCCALENDARMONTH_SHOWACCOUNTENTRIES, wxCommandEventHandler(XCCalendarMonthView::ShowAccountEntries));
+ Connect(ID_HIDECALENDARENTRIES, XCCALENDARMONTH_HIDECALENDARENTRIES, wxCommandEventHandler(XCCalendarMonthView::HideCalendarEntries));
+ Connect(ID_SHOWCALENDARENTRIES, XCCALENDARMONTH_SHOWCALENDARENTRIES, wxCommandEventHandler(XCCalendarMonthView::ShowCalendarEntries));
+
}
-XCCalendarMonthView::XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage)
+XCCalendarMonthView::XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars)
: wxPanel(NULL, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL){
Connect(ID_MONTHVIEWCLEARSELECTION, XCCALENDARMONTH_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarMonthView::DeselectOthersEvent));
WindowSizer->Add(SaturdayText, 1, wxEXPAND|wxALL, 0);
WindowSizer->Add(SundayText, 1, wxEXPAND|wxALL, 0);
- ProcessGrid(grid);
+ ProcessGrid(grid, hideAccounts, hideCalendars);
// Setup the days.
}
-void XCCalendarMonthView::ProcessGrid(XCCalendarMonthViewGrid *grid){
+void XCCalendarMonthView::ProcessGrid(XCCalendarMonthViewGrid *grid, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars){
// TODO: Delete the old calendar entries.
// Setup the control.
- CalendarDayItem->SetupControl((*DayIter).Day, (*DayIter).Month, (*DayIter).Year, (*DayIter).IsInMonth, this, calendarStorage);
+ CalendarDayItem->SetupControl((*DayIter).Day, (*DayIter).Month, (*DayIter).Year, (*DayIter).IsInMonth, this, calendarStorage, hideAccounts, hideCalendars);
CalendarDayList.push_back(CalendarDayItem);
WindowSizer->Add(CalendarDayItem, 1, wxEXPAND, 5);
}
+}
+
+void XCCalendarMonthView::HideAccountEntries(wxCommandEvent &accountData){
+
+ for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
+ DayIter != CalendarDayList.end(); DayIter++){
+
+ wxCommandEvent HideEvent(XCCALENDARDAY_HIDEACCOUNTENTRIES);
+ HideEvent.SetInt(accountData.GetInt());
+ HideEvent.SetId(ID_HIDEENTRIES);
+ wxPostEvent((*DayIter), HideEvent);
+
+ }
+
+}
+
+void XCCalendarMonthView::ShowAccountEntries(wxCommandEvent &accountData){
+
+ for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
+ DayIter != CalendarDayList.end(); DayIter++){
+
+ wxCommandEvent ShowEvent(XCCALENDARDAY_SHOWACCOUNTENTRIES);
+ ShowEvent.SetInt(accountData.GetInt());
+ ShowEvent.SetId(ID_SHOWENTRIES);
+ wxPostEvent((*DayIter), ShowEvent);
+
+ }
+
+}
+
+void XCCalendarMonthView::HideCalendarEntries(wxCommandEvent &accountData){
+
+ for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
+ DayIter != CalendarDayList.end(); DayIter++){
+
+ wxCommandEvent HideEvent(XCCALENDARDAY_HIDECALENDARENTRIES);
+ HideEvent.SetInt(accountData.GetInt());
+ HideEvent.SetId(ID_HIDECALENDARENTRIES);
+ wxPostEvent((*DayIter), HideEvent);
+
+ }
+
+}
+
+void XCCalendarMonthView::ShowCalendarEntries(wxCommandEvent &accountData){
+
+ for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
+ DayIter != CalendarDayList.end(); DayIter++){
+
+ wxCommandEvent HideEvent(XCCALENDARDAY_SHOWCALENDARENTRIES);
+ HideEvent.SetInt(accountData.GetInt());
+ HideEvent.SetId(ID_SHOWCALENDARENTRIES);
+ wxPostEvent((*DayIter), HideEvent);
+
+ }
+
}
\ No newline at end of file
XCCalendarMonthViewDayTitle *SaturdayText = nullptr;
XCCalendarMonthViewDayTitle *SundayText = nullptr;
CalendarDataStorage *calendarStorage = nullptr;
- void ProcessGrid(XCCalendarMonthViewGrid *grid);
+ void ProcessGrid(XCCalendarMonthViewGrid *grid, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
void Repaint();
+ protected:
+ void HideAccountEntries(wxCommandEvent &accountData);
+ void ShowAccountEntries(wxCommandEvent &accountData);
+ void HideCalendarEntries(wxCommandEvent &calendarData);
+ void ShowCalendarEntries(wxCommandEvent &calendarData);
+
public:
- XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage);
- XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage);
+ XCCalendarMonthView(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
+ XCCalendarMonthView(XCCalendarMonthViewGrid *grid, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
~XCCalendarMonthView();
void PaintFrameEvent(wxPaintEvent &PaintEvent);