/** * @file XTPDatePickerOffice2013Theme.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(_XTPDATEPICKEROFFICE2013THEME_H__) # define _XTPDATEPICKEROFFICE2013THEME_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * Class CXTPDatePickerThemeOffice2013 is derived from CXTPDatePickerPaintManager * for rendering an Office 2013 style for DatePicker control. * * Example: *
* if (m_bThemeOffice2013)
* {
* CXTPDatePickerThemeOffice2013* pTheme2013 = new CXTPDatePickerThemeOffice2013;
* m_wndDatePicker.SetTheme(pTheme2013);
* }
* else
* {
* m_wndDatePicker.SetTheme(NULL);
* }
*
*
* @see CXTPDatePickerThemeOffice2013
*/
class _XTP_EXT_CLASS CXTPDatePickerThemeOffice2013 : public CXTPDatePickerPaintManager
{
public:
/**
* @brief
* Default paint manager constructor.
*
* @details Handles initial initialization.
*
* @see RefreshMetrics()
*/
CXTPDatePickerThemeOffice2013();
/**
* @brief
* Default paint manager destructor.
*
* @details Handles member item deallocation.
*/
virtual ~CXTPDatePickerThemeOffice2013();
/**
* @brief
* This member function performs initialization for the Paint
* Manager.
*
* @details Initializes all drawing defaults (fonts, colors, etc.). Most of
* defaults are system defaults.
*/
virtual void RefreshMetrics();
/**
* @brief
* This member function is called to fill the control's background.
*
* @param pDC Pointer to a valid device context.
* @param rcClient A CRect that contains the control's client area rectangle
* coordinates.
*/
virtual void DrawBackground(CDC* pDC, CRect rcClient);
/**
* @brief
* Call this member function to draw the week numbers in the month
* area.
*
* @param pDC Pointer to a valid device context.
* @param pMonth Pointer to month object.
*
* @details It is called from CXTPDatePickerItemMonth implementation.
* You can override it to customize drawing.
*/
virtual void DrawWeekNumbers(CDC* pDC, CXTPDatePickerItemMonth* pMonth);
/**
* @brief
* Call this member function to draw the days of the week in the
* month header.
*
* @param pDC Pointer to a valid device context.
* @param pMonth Pointer to month object.
*
* @details It is called from CXTPDatePickerItemMonth implementation.
* You can override it to customize drawing.
*/
virtual void DrawDaysOfWeek(CDC* pDC, CXTPDatePickerItemMonth* pMonth);
/**
* @brief
* This member function draws a border around the control.
*
* @param pDC Pointer to a valid device context.
* @param pControl Pointer to a CXTPDatePickerControl object.
* @param rcClient A CRect that contains the control's client area rectangle
* coordinates.
* @param bDraw TRUE to draw else Adjust client rectangle.
*/
virtual void DrawBorder(CDC* pDC, const CXTPDatePickerControl* pControl, CRect& rcClient,
BOOL bDraw);
/**
* @brief
* Call this member function to draw a single month day in the month
* area.
*
* @param pDC Pointer to a valid device context.
* @param pDay Pointer to day object.
*
* @return TRUE if the drawing is successful, FALSE else.
*
* @details It is called from CXTPDatePickerItemDay implementation.
* You can override it to customize drawing.
*/
virtual BOOL DrawDay(CDC* pDC, CXTPDatePickerItemDay* pDay);
/**
* @brief
* This member function is used to draw the control's buttons.
*
* @param pDC Pointer to a valid device context.
* @param rcButton A CRect that contains the button area bounding
* rectangle coordinates.
* @param strButton A CString that contains the string of the button's
* text.
* @param bIsDown A BOOL that determines if the button is down or up.
* @param bIsHighLight A BOOL that determines if the button is highlighted.
*
* @details Use this member function to draw buttons in the appropriate state.
* The state depends on the bIsDown parameter, the button may be
* drawn pressed or released. Furthermore, depending on the
* bIsHighLight, the button may be drawn with highlighted borders.
*
* Example:
*
*
* for (int i = 0; i \< GetButtonCount(); i++)
* {
* CXTPDatePickerButton* pButton = GetButton(i);
* if (pButton-\>m_bVisible)
* DrawButton(pDC, pButton-\>m_rcButton, pButton-\>m_strCaption,
* pButton-\>m_bPressed, pButton-\>m_bHighlight);
* }
*
*/
virtual void DrawButton(CDC* pDC, const CRect& rcButton, const CString& strButton, BOOL bIsDown,
BOOL bIsHighLight);
/**
* @brief
* Call this member function to retrieve the background color for the
* highlight today item.
*
* @return A COLORREF object that contains the background color of the
* "Today" item.
*/
virtual COLORREF GetHighlightTodayBackColor();
/**
* @brief
* Call this member function to retrieve the foreground (text) color for the
* highlight today item.
*
* @return A COLORREF object that contains the foreground (text) color of the
* "Today" item.
*/
virtual COLORREF GetHighlightTodayTextColor();
/**
* @brief
* Call this member function to retrieve the Border color for the
* highlight today item.
*
* @return A COLORREF object that contains the Border color of the
* "Today" item.
*/
virtual COLORREF GetHighlightTodayBorderColor();
protected:
COLORREF m_clrButtonBorder;
COLORREF m_clrButtonPressed;
COLORREF m_clrButtonPressedText;
COLORREF m_clrButtonPressedBorder;
COLORREF m_clrButtonHighlight;
COLORREF m_clrButtonHighlightText;
COLORREF m_clrButtonHighlightBorder;
COLORREF m_clrHighlightTodayText;
COLORREF m_clrHighlightTodayBorder;
CXTPPaintManagerColorGradient m_clrBackground; /**< This member variable represents two COLORREF
objects that is used as the dark and light
background gradient color of the control.*/
};
AFX_INLINE COLORREF CXTPDatePickerThemeOffice2013::GetHighlightTodayBackColor()
{
return m_clrHighlightToday;
}
AFX_INLINE COLORREF CXTPDatePickerThemeOffice2013::GetHighlightTodayTextColor()
{
return m_clrHighlightTodayText;
}
AFX_INLINE COLORREF CXTPDatePickerThemeOffice2013::GetHighlightTodayBorderColor()
{
return m_clrHighlightTodayBorder;
}
# include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h"
#endif // !defined(_XTPDATEPICKEROFFICE2013THEME_H__)