Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
widgets: Widget controls updated
[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 #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                 string EventTextData = "";
43                 wxStaticText *EventTime = nullptr;
44                 wxStaticText *EventText = nullptr;
45                 wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
46                 wxStaticBitmap *AlarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
47                 wxSizerItem *afterSpacer = nullptr;
48                 wxBitmap AlarmIconBitmap;
49                 wxBitmap PriorityIconBitmap;
50         
51                 Colour EntryColour;
52         
53                 int timeHour = 0;
54                 int timeMinute = 0;
55                 int timeSecond = 0;
56         
57                 bool HasAlarm = false;
58                 bool HasHighPriority = false;
59                 int PositionMode = 0;
60         
61                 int eventID = 0;
62                 int accountID = 0;
63                 int calendarID =0;
64                 bool showAccount = true;
65                 bool showCalendar = true;
66         
67                 const int FirstPosition = 14;
68                 const int SecondPosition = 30;
69                 const int ThirdPosition = 49;
70         
71                 void Repaint();
72                 void RepaintSelected();
73         
74                 void UpdateInformation();
75                 
76                 string BuildEventTime(int timeHour, int timeMinute);
77         
78         protected:
79                 void LeftClick(wxMouseEvent &MouseEvent);
80                 void RightClick(wxMouseEvent &MouseEvent);
81         
82         public:
83                 XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
84                 ~XCCalendarDayEntry();
85         
86                 void PaintFrameEvent(wxPaintEvent &PaintEvent);
87                 void ResizeFrameEvent(wxSizeEvent &SizeEvent);
88                 void Deselect(wxCommandEvent &DeselectEvent);
89         
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);
97                 int GetID();
98                 int GetCalendarID();
99                 int GetEventID();
100                 int GetAccountID();
101                 wxSizerItem* GetAfterSpacer();
102                 bool GetDisplayAlarm();
103                 bool GetDisplayHighPriority();
104                 bool SetShowAccountStatus(bool statusInput);
105                 bool SetShowCalendarStatus(bool statusInput);
106                 bool GetShowAccountStatus();
107                 bool GetShowCalendarStatus();
108         
109         DECLARE_EVENT_TABLE()
110 };
112 #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