/** * @file XTPDatePickerItemDay.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ #if !defined(_XTPDATEPICKERITEMDAY_H__) # define _XTPDATEPICKERITEMDAY_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPDatePickerControl; class CXTPDatePickerItemMonth; /** * @brief * Class CXTPDatePickerItemDay represents one displayed day item in * the calendar. * * @details To create the object, call the constructor and provide pointers * to the parent CXTPDatePickerControl and CXTPDatePickerItemMonth * objects and a date value corresponding to its displayed day. * * @see CXTPDatePickerControl * @see CXTPDatePickerItemMonth */ class _XTP_EXT_CLASS CXTPDatePickerItemDay : public CXTPCmdTarget { public: /** * @brief * Default collection constructor. * * @param pControl Pointer to the DatePicker control. * @param pMonth Pointer to the corresponding Month item. * @param dtDay Date value. * * @details Handles initial initialization. */ CXTPDatePickerItemDay(CXTPDatePickerControl* pControl, CXTPDatePickerItemMonth* pMonth, COleDateTime dtDay); /** * @brief * Default collection destructor. * * @details Handles member item deallocation. */ virtual ~CXTPDatePickerItemDay(); /** * @brief * Call this member function to draw a day item. * * @param pDC Pointer to a valid device context. */ virtual void Draw(CDC* pDC); /** * @brief * Call this member function to set the day's rectangle area. * * @param rcDay Day rectangle in client CXTPDatePickerControl coordinates. * * @see GetRect() */ void SetRect(const CRect& rcDay); /** * @brief * Call this member function to obtain the day's rectangle area. * * @return A CRect that contains the rectangle coordinates of the day item in * client coordinates of the parent's CXTPDatePickerControl object. * * @see SetRect(const CRect& rcDay) */ CRect GetRect() const; /** * @brief * Call this member function to get the date of the day. * * @return The date of the day shown. * * @see CXTPDatePickerItemDay::CXTPDatePickerItemDay */ COleDateTime GetDate() const; /** * @brief * Call this member function to determine if the day is visible. * * @return Boolean value that determines if the day item is visible. TRUE if * the day is visible. FALSE otherwise. */ BOOL IsVisible() const; /** * @brief * This member function is used to determine if the day is the * "Today" date. * * @param dt Reference to the COleDateTime object representing the date to * check. * * @return A BOOL that indicates if the day is the "Today" date. TRUE if the * day is the "Today" date. Otherwise FALSE. */ BOOL IsToday(COleDateTime& dt) const; /** * @brief * This member function is used to get a parent month object. * * @return A pointer to a CXTPDatePickerItemMonth object which is an owner of this * day object. */ CXTPDatePickerItemMonth* GetMonth() const; /** * @brief * This member function is used to get a parent date picker object. * * @return A pointer to a CXTPDatePickerControl parent object. */ CXTPDatePickerControl* GetDatePickerControl() const; // Attributes protected: CXTPDatePickerControl* m_pControl; /**< This member variable is a pointer to the parent date picker control.*/ CXTPDatePickerItemMonth* m_pMonth; /**< This member variable is a pointer to the parent month item.*/ COleDateTime m_dtDay; /**< This member variable is used to specify the visible day date, represented by this Day item. */ CRect m_rcDay; /**< This member variable is used to specify the coordinates of the day spot.*/ BOOL m_bVisible; /**< This member variable is used as a flag to specify if the day item is visible.The flag values are TRUE if the day item is drawn, otherwise FALSE.*/ protected: friend class CXTPDatePickerControl; }; AFX_INLINE void CXTPDatePickerItemDay::SetRect(const CRect& rcDay) { m_rcDay = rcDay; } AFX_INLINE CRect CXTPDatePickerItemDay::GetRect() const { return m_rcDay; } AFX_INLINE COleDateTime CXTPDatePickerItemDay::GetDate() const { return m_dtDay; } AFX_INLINE BOOL CXTPDatePickerItemDay::IsVisible() const { return m_bVisible; } AFX_INLINE CXTPDatePickerItemMonth* CXTPDatePickerItemDay::GetMonth() const { return m_pMonth; } AFX_INLINE CXTPDatePickerControl* CXTPDatePickerItemDay::GetDatePickerControl() const { return m_pControl; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(_XTPDATEPICKERITEMDAY_H__)