// XCCalendarDayEntry.h - Xestia Calendar XCCalendarDayEntry widget class.
//
// (c) 2016 Xestia Software Development.
//
// This file is part of Xestia Calendar.
//
// Xestia Address Book is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by the
// Free Software Foundation, version 3 of the license.
//
// Xestia Address Book is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with Xestia Calendar. If not, see
#ifndef __WIDGETS_XCCALENDARDAYENTRY_H__
#define __WIDGETS_XCCALENDARDAYENTRY_H__
#include
#include
#include "../common/colour.h"
#include "../common/text.h"
#include "../common/events.h"
#include "../bitmaps.h"
enum XCCalendarDayEntryMode {
XCCALENDARDAYENTRY_NORMAL,
XCCALENDARDAYENTRY_SMALL,
};
class XCCalendarDayEntry: public wxPanel
{
private:
wxWindow *DayPanel = nullptr;
string EventTextData = "";
wxStaticText *EventTime = nullptr;
wxStaticText *EventText = nullptr;
wxStaticBitmap *HighPriorityIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(14,7), wxDefaultSize, 0 );
wxStaticBitmap *AlarmIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxPoint(30,7), wxDefaultSize, 0 );
wxSizerItem *afterSpacer = nullptr;
wxBitmap AlarmIconBitmap;
wxBitmap PriorityIconBitmap;
Colour EntryColour;
int timeHour = 0;
int timeMinute = 0;
int timeSecond = 0;
bool HasAlarm = false;
bool HasHighPriority = false;
int PositionMode = 0;
int entryID = 0;
int accountID = 0;
int calendarID =0;
bool showAccount = true;
bool showCalendar = true;
const int FirstPosition = 14;
const int SecondPosition = 30;
const int ThirdPosition = 49;
void Repaint();
void RepaintSelected();
void UpdateInformation();
string BuildEventTime(int timeHour, int timeMinute);
protected:
public:
XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
~XCCalendarDayEntry();
void PaintFrameEvent(wxPaintEvent &PaintEvent);
void ResizeFrameEvent(wxSizeEvent &SizeEvent);
void LeftClick(wxMouseEvent &MouseEvent);
void Deselect(wxCommandEvent &DeselectEvent);
void SetTime(int timeHour, int timeMinute, int timeSecond);
void SetColour(Colour *ColourIn);
void SetDisplayAlarm(bool DisplayValue);
void SetDisplayHighPriority(bool DisplayValue);
void SetEntryIDs(int accountID, int calendarID, int entryID);
void SetAfterSpacer(wxSizerItem *afterSpacer);
int GetID();
int GetCalendarID();
int GetAccountID();
wxSizerItem* GetAfterSpacer();
bool GetDisplayAlarm();
bool GetDisplayHighPriority();
bool SetShowAccountStatus(bool statusInput);
bool SetShowCalendarStatus(bool statusInput);
bool GetShowAccountStatus();
bool GetShowCalendarStatus();
DECLARE_EVENT_TABLE()
};
#endif