1 // XCCalendarDay.h - Xestia Calendar XCCalendarDay widget class header file.
3 // (c) 2016 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #ifndef __WIDGETS_XCCALENDARDAY_H__
20 #define __WIDGETS_XCCALENDARDAY_H__
23 #include <wx/dcbuffer.h>
24 #include <wx/mstream.h>
27 #include "XCCalendarDayEntry.h"
28 #include "XCCalendarMonthView.h"
29 #include "../common/events.h"
30 #include "../bitmaps.h"
32 #include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
34 class XCCalendarMonthView;
36 class XCCalendarDay: public wxPanel
39 XCCalendarMonthView *MonthViewPointer = nullptr;
40 wxFlexGridSizer *WindowSizer = new wxFlexGridSizer(2, 1, 0, 0);
41 wxBoxSizer *TopSectionSizer = new wxBoxSizer(wxHORIZONTAL);
42 wxBoxSizer *MainSectionSizer = new wxBoxSizer(wxVERTICAL);
43 wxBoxSizer *EventListFrameSizer = new wxBoxSizer(wxVERTICAL);
44 wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
45 wxStaticBitmap *AlertIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
46 wxBitmap AlertIconBitmap;
47 wxBitmap PriorityIconBitmap;
48 wxStaticText *NumberText = nullptr;
49 wxScrolledWindow *EventListFrame = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
50 int CalendarEntrySeekNumber = 0;
52 int calendarMonth = 0;
54 bool IsInMonth = false;
56 vector<XCCalendarDayEntry*> CalendarEntryList;
57 vector<size_t> CalendarEntryListIndex;
62 void HideAccountEntries(wxCommandEvent &accountData);
63 void ShowAccountEntries(wxCommandEvent &accountData);
64 void HideCalendarEntries(wxCommandEvent &calendarData);
65 void ShowCalendarEntries(wxCommandEvent &calendarData);
68 XCCalendarDay(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size);
70 void PaintFrameEvent(wxPaintEvent &PaintEvent);
71 void ResizeFrameEvent(wxSizeEvent &SizeEvent);
72 void DeselectOthersEvent(wxCommandEvent &DeselectEvent);
73 void DeselectAllEvent(wxCommandEvent &DeselectEvent);
74 void UpdateTopIcons();
75 void SetupControl(int SetupDay, int SetupMonth, int SetupYear, bool SetupIsInMonth, XCCalendarMonthView *MonthViewPointer, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);