Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
bd51a62677e09964f2663d46577db208d29d2819
[xestiacalendar/.git] / source / widgets / XCCalendarDay.h
1 // XCCalendarDay.h - Xestia Calendar XCCalendarDay widget class header file.
2 //
3 // (c) 2016-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
7 // Xestia Calendar 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.
10 //
11 // Xestia Calendar 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.
15 //
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__
22 #include <wx/wx.h>
23 #include <wx/dcbuffer.h>
24 #include <wx/mstream.h>
25 #include <vector>
26 #include <memory>
28 #include "XCCalendarDayEntry.h"
29 #include "XCCalendarMonthView.h"
30 #include "../common/events.h"
31 #include "../bitmaps.h"
33 #include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
35 class XCCalendarMonthView;
37 class XCCalendarDay: public wxPanel
38 {
39         private:
40                 XCCalendarMonthView *monthViewPointer = nullptr;
41                 wxFlexGridSizer *windowSizer = new wxFlexGridSizer(2, 1, 0, 0);
42                 wxBoxSizer *topSectionSizer = new wxBoxSizer(wxHORIZONTAL);
43                 wxBoxSizer *mainSectionSizer = new wxBoxSizer(wxVERTICAL);
44                 wxBoxSizer *eventListFrameSizer = new wxBoxSizer(wxVERTICAL);
45                 wxStaticBitmap *highPriorityIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
46                 wxStaticBitmap *alertIcon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(32,32), 0);
47                 CalendarDataStorage *dataStorage = nullptr;
48                 wxBitmap alertIconBitmap;
49                 wxBitmap priorityIconBitmap;
50                 wxStaticText *numberText = nullptr;
51                 wxScrolledWindow *eventListFrame = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
52                 int calendarEntrySeekNumber = 0;
53                 int calendarDay = 0;
54                 int calendarMonth = 0;
55                 int calendarYear = 0;
56                 bool isInMonth = false;
57         
58                 vector<XCCalendarDayEntry*> calendarEntryList;
59         
60                 void Repaint();
61         
62         protected:
63                 void HideAccountEntries(wxCommandEvent &accountData);
64                 void ShowAccountEntries(wxCommandEvent &accountData);
65                 void HideCalendarEntries(wxCommandEvent &calendarData);
66                 void ShowCalendarEntries(wxCommandEvent &calendarData);
67                 void DeleteCalendarEntries(wxCommandEvent &calendarData);
68                 void DeleteCalendarEntry(wxCommandEvent &eventData);
69                 void AddCalendarEntry(wxCommandEvent &eventData);
70                 void UpdateCalendarEntry(wxCommandEvent &eventData);
71                 void UpdateCalendarColour(wxCommandEvent &colourData);
72         
73         public:
74                 XCCalendarDay(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size);
75                 ~XCCalendarDay();
76                 void PaintFrameEvent(wxPaintEvent &paintEvent);
77                 void ResizeFrameEvent(wxSizeEvent &sizeEvent);
78                 void DeselectOthersEvent(wxCommandEvent &deselectEvent);
79                 void DeselectAllEvent(wxCommandEvent &deselectEvent);
80                 void UpdateTopIcons();
81                 void SetupControl(int setupDay, int setupMonth, int setupYear, bool setupIsInMonth, XCCalendarMonthView *monthViewPointer, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
82                 int GetCalendarDay();
83                 int GetCalendarMonth();
84                 int GetCalendarYear();
85         
86         DECLARE_EVENT_TABLE()
88 };
90 #endif
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