Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
svrblist: Implemented server blacklist code for Xestia Address Book
[xestiacalendar/.git] / source / widgets / XCCalendarDayEntry.h
1 // XCCalendarDayEntry.h - Xestia Calendar XCCalendarDayEntry widget class.
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
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.
10 //
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.
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_XCCALENDARDAYENTRY_H__
20 #define __WIDGETS_XCCALENDARDAYENTRY_H__
22 #include <wx/wx.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"
30 enum XCCalendarDayEntryMode {
31         XCCALENDARDAYENTRY_NORMAL,
32         XCCALENDARDAYENTRY_SMALL,
33 };
35 class XCCalendarDayEntry: public wxPanel
36 {
37         
38         private:
39                 wxWindow *DayPanel = nullptr;
40                 string EventTextData = "";
41                 wxStaticText *EventTime = nullptr;
42                 wxStaticText *EventText = nullptr;
43                 wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
44                 wxStaticBitmap *AlarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
45                 wxSizerItem *afterSpacer = nullptr;
46                 wxBitmap AlarmIconBitmap;
47                 wxBitmap PriorityIconBitmap;
48         
49                 Colour EntryColour;
50         
51                 int timeHour = 0;
52                 int timeMinute = 0;
53                 int timeSecond = 0;
54         
55                 bool HasAlarm = false;
56                 bool HasHighPriority = false;
57                 int PositionMode = 0;
58         
59                 int entryID = 0;
60                 int accountID = 0;
61                 int calendarID =0;
62                 bool showAccount = true;
63                 bool showCalendar = true;
64         
65                 const int FirstPosition = 14;
66                 const int SecondPosition = 30;
67                 const int ThirdPosition = 49;
68         
69                 void Repaint();
70                 void RepaintSelected();
71         
72                 void UpdateInformation();
73                 
74                 string BuildEventTime(int timeHour, int timeMinute);
75         
76         protected:
77         
78         public:
79                 XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
80                 ~XCCalendarDayEntry();
81         
82                 void PaintFrameEvent(wxPaintEvent &PaintEvent);
83                 void ResizeFrameEvent(wxSizeEvent &SizeEvent);
84                 void LeftClick(wxMouseEvent &MouseEvent);
85                 void Deselect(wxCommandEvent &DeselectEvent);
86         
87                 void SetTime(int timeHour, int timeMinute, int timeSecond);
88                 void SetColour(Colour *ColourIn);
89                 void SetDisplayAlarm(bool DisplayValue);
90                 void SetDisplayHighPriority(bool DisplayValue);
91                 void SetEntryIDs(int accountID, int calendarID, int entryID);
92                 void SetAfterSpacer(wxSizerItem *afterSpacer);
93                 int GetID();
94                 int GetCalendarID();
95                 int GetAccountID();
96                 wxSizerItem* GetAfterSpacer();
97                 bool GetDisplayAlarm();
98                 bool GetDisplayHighPriority();
99                 bool SetShowAccountStatus(bool statusInput);
100                 bool SetShowCalendarStatus(bool statusInput);
101                 bool GetShowAccountStatus();
102                 bool GetShowCalendarStatus();
103         
104         DECLARE_EVENT_TABLE()
105 };
107 #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