1 // XCCalendarDayEntry.h - Xestia Calendar XCCalendarDayEntry widget class.
3 // (c) 2016-2017 Xestia Software Development.
5 // This file is part of Xestia Calendar.
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.
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.
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_XCCALENDARDAYENTRY_H__
20 #define __WIDGETS_XCCALENDARDAYENTRY_H__
23 #include <wx/mstream.h>
25 #include "../common/colour.h"
26 #include "../common/text.h"
27 #include "../common/events.h"
28 #include "../bitmaps.h"
32 enum XCCalendarDayEntryMode {
33 XCCALENDARDAYENTRY_NORMAL,
34 XCCALENDARDAYENTRY_SMALL,
37 class XCCalendarDayEntry: public wxPanel
41 wxWindow *dayPanel = nullptr;
42 wxPanel *mainPanel = nullptr;
43 wxPanel *borderPanel = nullptr;
44 wxPanel *calendarColour = nullptr;
45 string eventTextData = "";
46 wxStaticText *eventTime = nullptr;
47 wxStaticText *eventText = nullptr;
48 wxStaticBitmap *highPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
49 wxStaticBitmap *alarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
50 wxBoxSizer *mainSizer = nullptr;
51 wxSizerItem *afterSpacer = nullptr;
52 wxBitmap alarmIconBitmap;
53 wxBitmap priorityIconBitmap;
61 bool hasAlarm = false;
62 bool hasHighPriority = false;
68 bool showAccount = true;
69 bool showCalendar = true;
71 const int firstPosition = 14;
72 const int secondPosition = 30;
73 const int thirdPosition = 49;
75 void UpdateInformation();
77 string BuildEventTime(int timeHour, int timeMinute);
80 void LeftClick(wxMouseEvent &MouseEvent);
81 void RightClick(wxMouseEvent &MouseEvent);
84 XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
85 ~XCCalendarDayEntry();
87 void ResizeFrameEvent(wxSizeEvent &sizeEvent);
88 void Deselect(wxCommandEvent &deselectEvent);
90 void SetTime(int timeHour, int timeMinute, int timeSecond);
91 void SetColour(Colour *colourIn);
92 void SetDisplayAlarm(bool displayValue);
93 void SetDisplayHighPriority(bool displayValue);
94 void SetEntryIDs(int accountID, int calendarID, int eventID);
95 void SetAfterSpacer(wxSizerItem *afterSpacer);
96 void SetEventName(std::string eventName);
101 wxSizerItem* GetAfterSpacer();
102 bool GetDisplayAlarm();
103 bool GetDisplayHighPriority();
104 void SetShowAccountStatus(bool statusInput);
105 void SetShowCalendarStatus(bool statusInput);
106 bool GetShowAccountStatus();
107 bool GetShowCalendarStatus();
109 DECLARE_EVENT_TABLE()