// XCCalendarDayEntry.h - Xestia Calendar XCCalendarDayEntry widget class.
//
// (c) 2016-2017 Xestia Software Development.
//
// This file is part of Xestia Calendar.
//
// Xestia Calendar 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 Calendar 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"
#include "structs.h"
enum XCCalendarDayEntryMode {
XCCALENDARDAYENTRY_NORMAL,
XCCALENDARDAYENTRY_SMALL,
};
class XCCalendarDayEntry: public wxPanel
{
private:
wxWindow *dayPanel = nullptr;
wxPanel *mainPanel = nullptr;
wxPanel *borderPanel = nullptr;
wxPanel *calendarColour = 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 );
wxBoxSizer *mainSizer = nullptr;
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 eventID = 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 UpdateInformation();
string BuildEventTime(int timeHour, int timeMinute);
protected:
void LeftClick(wxMouseEvent &MouseEvent);
void RightClick(wxMouseEvent &MouseEvent);
public:
XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id);
~XCCalendarDayEntry();
void ResizeFrameEvent(wxSizeEvent &sizeEvent);
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 eventID);
void SetAfterSpacer(wxSizerItem *afterSpacer);
void SetEventName(std::string eventName);
int GetID();
int GetCalendarID();
int GetEventID();
int GetAccountID();
wxSizerItem* GetAfterSpacer();
bool GetDisplayAlarm();
bool GetDisplayHighPriority();
void SetShowAccountStatus(bool statusInput);
void SetShowCalendarStatus(bool statusInput);
bool GetShowAccountStatus();
bool GetShowCalendarStatus();
DECLARE_EVENT_TABLE()
};
#endif