Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmMain: Implemented UTF8 support in DeleteCalendar function
[xestiacalendar/.git] / source / widgets / XCCalendarDayEntry.h
1 // XCCalendarDayEntry.h - Xestia Calendar XCCalendarDayEntry widget class.
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_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 #include "structs.h"
32 enum XCCalendarDayEntryMode {
33         XCCALENDARDAYENTRY_NORMAL,
34         XCCALENDARDAYENTRY_SMALL,
35 };
37 class XCCalendarDayEntry: public wxPanel
38 {
39         
40         private:
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                 wxBoxSizer *borderSizer = nullptr;
52                 wxSizerItem *afterSpacer = nullptr;
53                 wxBitmap alarmIconBitmap;
54                 wxBitmap priorityIconBitmap;
55         
56                 Colour entryColour;
57         
58                 int timeHour = 0;
59                 int timeMinute = 0;
60                 int timeSecond = 0;
61         
62                 bool hasAlarm = false;
63                 bool hasHighPriority = false;
64                 int positionMode = 0;
65         
66                 int eventID = 0;
67                 int accountID = 0;
68                 int calendarID =0;
69                 bool showAccount = true;
70                 bool showCalendar = true;
71         
72                 const int firstPosition = 14;
73                 const int secondPosition = 30;
74                 const int thirdPosition = 49;
75         
76                 void UpdateInformation();
77                 
78                 string BuildEventTime(int timeHour, int timeMinute);
79         
80         protected:
81                 void LeftClick(wxMouseEvent &MouseEvent);
82                 void RightClick(wxMouseEvent &MouseEvent);
83         
84         public:
85                 XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
86                 ~XCCalendarDayEntry();
87         
88                 void ResizeFrameEvent(wxSizeEvent &sizeEvent);
89                 void Deselect(wxCommandEvent &deselectEvent);
90         
91                 void SetTime(int timeHour, int timeMinute, int timeSecond);
92                 void SetColour(Colour *colourIn);
93                 void SetDisplayAlarm(bool displayValue);
94                 void SetDisplayHighPriority(bool displayValue);
95                 void SetEntryIDs(int accountID, int calendarID, int eventID);
96                 void SetAfterSpacer(wxSizerItem *afterSpacer);
97                 void SetEventName(std::string eventName);
98                 int GetID();
99                 int GetCalendarID();
100                 int GetEventID();
101                 int GetAccountID();
102                 wxSizerItem* GetAfterSpacer();
103                 bool GetDisplayAlarm();
104                 bool GetDisplayHighPriority();
105                 void SetShowAccountStatus(bool statusInput);
106                 void SetShowCalendarStatus(bool statusInput);
107                 bool GetShowAccountStatus();
108                 bool GetShowCalendarStatus();
109         
110         DECLARE_EVENT_TABLE()
111 };
113 #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