7#ifndef XFA_FWL_CFWL_MONTHCALENDAR_H_
8#define XFA_FWL_CFWL_MONTHCALENDAR_H_
13#include "core/fxcrt/widestring.h"
14#include "xfa/fwl/cfwl_event.h"
15#include "xfa/fwl/cfwl_widget.h"
17class CFWL_MessageMouse;
34 void SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);
38 DATE() : iYear(0), iMonth(0), iDay(0) {}
40 DATE(int32_t year, int32_t month, int32_t day)
41 : iYear(year), iMonth(month), iDay(day) {}
43 bool operator<(
const DATE& right) {
44 if (iYear < right.iYear)
46 if (iYear == right.iYear) {
47 if (iMonth < right.iMonth)
49 if (iMonth == right.iMonth)
50 return iDay < right.iDay;
55 bool operator>(
const DATE& right) {
56 if (iYear > right.iYear)
58 if (iYear == right.iYear) {
59 if (iMonth > right.iMonth)
61 if (iMonth == right.iMonth)
62 return iDay > right.iDay;
77 const WideString& wsday);
83 const int32_t iDayOfWeek;
87 const WideString wsDay;
90 CFWL_MonthCalendar(CFWL_App* app,
107 CFX_SizeF CalcSize();
110 void CalcTodaySize();
113 void ClearDateItem();
114 void ResetDateItem();
117 void ChangeToMonth(int32_t iYear, int32_t iMonth);
119 void AddSelDay(int32_t iDay);
121 WideString GetHeadText(int32_t iYear, int32_t iMonth);
122 WideString GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay);
123 int32_t GetDayAtPoint(
const CFX_PointF& point)
const;
125 void OnLButtonDown(CFWL_MessageMouse* pMsg);
126 void OnLButtonUp(CFWL_MessageMouse* pMsg);
127 void OnMouseMove(CFWL_MessageMouse* pMsg);
128 void OnMouseLeave(CFWL_MessageMouse* pMsg);
130 bool m_bInitialized =
false;
141 WideString m_wsToday;
142 std::vector<std::unique_ptr<DATEINFO>> m_DateArray;
143 int32_t m_iCurYear = 2011;
144 int32_t m_iCurMonth = 1;
145 int32_t m_iYear = 2011;
146 int32_t m_iMonth = 1;
148 int32_t m_iHovered = -1;
153 CFX_SizeF m_HeadSize;
154 CFX_SizeF m_CellSize;
155 CFX_SizeF m_TodaySize;
156 std::vector<int32_t> m_SelDayArray;
void OnProcessMessage(CFWL_Message *pMessage) override
~CFWL_DateTimeEdit() override
void OnProcessMessage(CFWL_Message *pMessage) override
bool IsMonthCalendarVisible() const
CFX_RectF GetBBox() const
bool Paste(const WideString &wsPaste)
void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay)
~CFWL_DateTimePicker() override
absl::optional< WideString > Copy()
void SetEditLimit(int32_t nLimit)
void Trace(cppgc::Visitor *visitor) const override
std::pair< size_t, size_t > GetSelection() const
FWL_Type GetClassID() const override
bool HasSelection() const
absl::optional< WideString > Cut()
void GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay)
WideString GetEditText() const
void PreFinalize() override
void SetEditText(const WideString &wsText)
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay)
FWL_WidgetHit HitTest(const CFX_PointF &point) override
size_t GetEditTextLength() const
void ModifyEditStyleExts(uint32_t dwStyleExtsAdded, uint32_t dwStyleExtsRemoved)
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void OnProcessMessage(CFWL_Message *pMessage) override
CFWL_Edit(CFWL_App *app, const Properties &properties, CFWL_Widget *pOuter)
const MouseCommand m_dwCmd
void DrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
~CFWL_MonthCalendar() override
void SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay)
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
CFX_RectF GetAutosizedWidgetRect() override
void OnProcessMessage(CFWL_Message *pMessage) override
FWL_Type GetClassID() const override
void Offset(float dx, float dy)
#define CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED