/** * @file XTPCalendarPaintManager.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(_XTPCALENDARPAINTMANAGER_H__) # define _XTPCALENDARPAINTMANAGER_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCalendarTimeLineViewTimeScale; class CXTPCalendarTimeLineViewGroup; class CXTPCalendarTimeLineViewEvent; class CXTPCalendarTimeLineView; class CXTPResourceImage; class CXTPImageManager; class CXTPCalendarControl; class CXTPCalendarDayView; class CXTPCalendarDayViewDay; class CXTPCalendarDayViewGroup; class CXTPCalendarMonthView; class CXTPCalendarWeekView; class CXTPCalendarDayViewEvent; class CXTPCalendarMonthViewEvent; class CXTPCalendarWeekViewEvent; class CXTPCalendarViewEvent; class CXTPCalendarDayViewTimeScale; class CXTPCalendarFlagsSet_imp; class CXTPCalendarViewPartBrushValue; class CXTPCalendarViewEventSubjectEditor; struct XTP_CALENDAR_DAYVIEWCELL_PARAMS; /** * @brief * This helper macro is used to declare paint manager drawing parts. * theClass - Part name. * parentClass - Parent part name. * There are two paint manager methods available to access declared * part object: * CPartName* GetPartName(); * void SetPartName(CPartName* pPart); * Where PartName is the name of the declared part. * * Example: *
 * declaration in the paint manager class
 * BEGIN_VIEW_PART(PartClass1, ParentPartClass1)
 * ...
 * END_VIEW_PART(PartClass1)
 *
 * // in the implementation
 * CPaintManagerClassName::CPartClass1* pPart1 = pPainManObj->GetPartClass1();
 * 
* * @see END_VIEW_PART * @see CXTPCalendarPaintManager */ # define BEGIN_VIEW_PART(theClass, parentClass) # undef BEGIN_VIEW_PART # define BEGIN_VIEW_PART(theClass, parentClass) \ class C##theClass : public C##parentClass \ { \ public: \ typedef C##parentClass TBase; \ C##theClass(CXTPCalendarViewPart* pParentPart = NULL) \ : C##parentClass(pParentPart) \ { \ _Init(); \ } /** * @brief * This helper macro is used to declare paint manager drawing parts. * theClass - Part name. * * @see BEGIN_VIEW_PART * @see CXTPCalendarPaintManager */ # define END_VIEW_PART(theClass) # undef END_VIEW_PART # define END_VIEW_PART(theClass) \ } \ ; \ friend class C##theClass; \ \ protected: \ C##theClass* m_p##theClass; \ \ public: \ C##theClass* Get##theClass() const \ { \ return m_p##theClass; \ } \ void Set##theClass(C##theClass* p##theClass) \ { \ POSITION pos = m_lstViewParts.Find(m_p##theClass); \ _ASSERTE(pos); \ m_lstViewParts.RemoveAt(pos); \ delete m_p##theClass; \ m_p##theClass = p##theClass; \ m_lstViewParts.AddTail(p##theClass); \ p##theClass->m_pPaintManager = this; \ } ///////////////////////////////////////////////////////////////////////////// // CXTPCalendarPaintManager command target /** * @brief * Utility class, handles most of the drawing activities. * * @details * It stores all settings, needed by control to perform drawing operations : * fonts, colors, styles for all others classes of control. It also implements * all functions for drawing typical graphical primitives, functions that * directly work with device context. * Can be overridden to provide another look and feel for the control. * Thus, you have an easy way to change the "skin" of your control. Just provide * your own implementation of CXTPCalendarPaintManager and don't * touch the functionality of any of the other control classes. * * Create a CXTPCalendarPaintManager by calling its constructor. * Furthermore, you can call get and set functions to change * settings as needed. */ class _XTP_EXT_CLASS CXTPCalendarPaintManager : public CXTPCmdTarget { friend class CXTPCalendarViewPart; public: /** * @brief * Paint manager's ControlPart is used as parent for the * other parts of the control. */ BEGIN_VIEW_PART(ControlPart, XTPCalendarViewPart) /** * @brief * Performs refreshing of graphical related parameters from * system settings. */ virtual void RefreshMetrics(); END_VIEW_PART(ControlPart) /** * ## Day View related drawing. */ /** * @brief * This paint manager part is used to draw the time scale header, * 'Now' line, and the expand signs for the Day View. */ BEGIN_VIEW_PART(DayViewTimeScaleHeaderPart, XTPCalendarViewPart) COLORREF m_clrBorder; /** * @brief * Performs refreshing of graphical related parameters from * system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to draw the time scale header. * * @param pDC Pointer to a valid device context. * @param pView A CXTPCalendarDayView pointer that contains the Day * View object. * @param rc The time scale header's bounding rectangle. * @param strText A CString object that contains the header text. */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayView* pView, CRect rc, CString strText); /** * @brief * This member function is used to draw the 'Now' line. * * @param pDC Pointer to a valid device context. * @param pView A CXTPCalendarDayView pointer to the Day View object. * @param rc A CRect that contains the Time scale bounding rectangle. * @param y An int that contains the 'Now' line position. * @param bDrawBk If FALSE, then draw only the line. If TRUE, * then draw the line and the gradient fill. */ virtual void DrawNowLine(CDC* pDC, CXTPCalendarDayView* pView, CRect rc, int y, BOOL bDrawBk = FALSE); /** * @brief * This member function is used to draw the 'Now' line. * * @param pDC Pointer to a valid device context. * @param pView A CXTPCalendarDayView pointer to the Day View object. * @param pScale A CXTPCalendarDayViewTimeScale pointer to the Day View object. * @param rc A CRect that contains the Time scale bounding rectangle. * @param y An int that contains the 'Now' line position. * @param bDrawBk If FALSE, then draw only the line. If TRUE, * then draw the line and the gradient fill. */ virtual void DrawNowLine(CDC* pDC, CXTPCalendarDayView* pView, CXTPCalendarDayViewTimeScale* pScale, CRect rc, int y, BOOL bDrawBk = FALSE); /** * @brief * This member function is used to draw expand signs. * * @param pDC Pointer to a valid device context. * @param pView A CXTPCalendarDayView pointer to the Day View object. * @param rcTSHours A CRect that contains the Time scale hours rectangle. */ virtual void DrawExpandSigns(CDC* pDC, CXTPCalendarDayView* pView, const CRect& rcTSHours); END_VIEW_PART(DayViewTimeScaleHeaderPart) /** * @brief * This paint manager part is used to draw time scale time cells * for the Day View. */ BEGIN_VIEW_PART(DayViewTimeScaleCellPart, DayViewTimeScaleHeaderPart) CXTPCalendarViewPartFontValue m_fntTimeText; /**< Time text font.*/ int m_nHourWidth; /**< Width of hour part of the text in pixels.*/ int m_nMinWidth; /**< Width of minutes (am/pm) part of the text in pixels.*/ BOOL m_bShowMinutes; /**< Show minutes in TS when '60 Minutes' is selected*/ COLORREF m_clrBorder; /** * @brief * This member function is used to refresh the graphical * related parameters using system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to adjust the time text font size. * * @param pDC Pointer to a valid device context. * @param rcCell A CRect object that contains the time scale hour cell * bounding rectangle. */ void AdjustTimeFont(CDC* pDC, CRect rcCell); /** * @brief * This member function is used to adjust the time text font size. * * @param pDC Pointer to a valid device context. * @param strHour A CString object that contains the Hour text. * @param strMin A CString object that contains the Minutes text. * @param nHourHeight A hour big text height. * @param nWidth An int that returns the width of time scale with * provided hour and minutes texts. */ void CalcWidth(CDC* pDC, const CString& strHour, const CString& strMin, int nHourHeight, int& nWidth); /** * @brief * This member function is used to draw background of the time scale header */ // virtual void DrawBackground(CDC* pDC, CRect rc); /** * @brief * This member function is used to draw the hour cell. * * @param pDC Pointer to a valid device context. * @param rc A CRect object that contains the time scale * hour cell bounding rectangle. * @param strText A CString object that contains the time text. * @param bFillBackground A BOOL. If TRUE, then fill the background before drawing. * If FALSE, then do not fill the background before drawing. * @param bCurrentTime TRUE to display current time. */ virtual void DrawHourCell(CDC* pDC, CRect rc, CString strText, BOOL bFillBackground = TRUE, BOOL bCurrentTime = FALSE); /** * @brief * This member function is used to draw the big hour cell. * * @param pDC Pointer to a valid device context. * @param rc A CRect object that contains the time scale * hour cell bounding rectangle. * @param strHour A CString object that contains the Hour text. * @param strMin A CString object that contains the Minutes text. * @param nRowPerHour An int that contains the Rows per hour. * @param bFillBackground A BOOL. If TRUE, then fill the background before drawing. * If FALSE, then do not fill the background before drawing. * @param bCurrentTime TRUE to display current time. */ virtual void DrawBigHourCell(CDC* pDC, CRect rc, CString strHour, CString strMin, int nRowPerHour, BOOL bFillBackground = TRUE, BOOL bCurrentTime = FALSE); END_VIEW_PART(DayViewTimeScaleCellPart) /** * @brief * This paint manager part is used as the base class for the parts * which draw different kinds of no all-day-cells (work/non-work) * for the Day View. */ BEGIN_VIEW_PART(DayViewCellPart, XTPCalendarViewPart) CXTPPaintManagerColor m_clrBackgroundSlave; /**< Background secondary color.*/ CXTPPaintManagerColor m_clrShadow; /**< Cell background color.*/ CXTPPaintManagerColor m_clrHour; /**< Cell border color.*/ /** * @brief * This member function is used to refresh the graphical * related parameters using system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to fill out cell parameters with * default values. * * @param pViewGroup [in] A CXTPCalendarDayViewGroup pointer to the Day View Group object. * @param rCellParams [in, out] A XTP_CALENDAR_DAYVIEWCELL_PARAMS object that contains * the cell's parameters. */ virtual void GetParams(CXTPCalendarDayViewGroup* pViewGroup, XTP_CALENDAR_DAYVIEWCELL_PARAMS* rCellParams); /** * @brief * This member function is used to draw the day view with no * all-day-cells. * * @param pDC Pointer to a valid device context. * @param pViewGroup A CXTPCalendarDayViewGroup pointer to the Day View Group object. * @param rc A CRect object that contains the cell's bounding rectangle. * @param cellParams A XTP_CALENDAR_DAYVIEWCELL_PARAMS object that contains * the cell's parameters. */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, CRect rc, const XTP_CALENDAR_DAYVIEWCELL_PARAMS& cellParams); END_VIEW_PART(DayViewCellPart) /** * @brief * This paint manager part is used to draw a day view that contains * no all day work time cells. */ BEGIN_VIEW_PART(DayViewWorkCellPart, DayViewCellPart) /** * @brief * This member function is used to perform the refreshing of * graphical related parameters from system settings. */ virtual void RefreshMetrics(); END_VIEW_PART(DayViewWorkCellPart) /** * @brief * This paint manager part is used to draw "no all day non-work" * time cells for the Day View. */ BEGIN_VIEW_PART(DayViewNonworkCellPart, DayViewCellPart) /** * @brief * This member function is used to perform refreshing of * graphical related parameters from system settings. */ virtual void RefreshMetrics(); END_VIEW_PART(DayViewNonworkCellPart) /** * @brief * This paint manager part is used to draw days headers for * the Day View. */ BEGIN_VIEW_PART(DayMonthViewHeaderPart, XTPCalendarViewPart) CXTPPaintManagerColor m_clrTopLeftBorder; // Top and Left borders color. /** * @brief * This member function is used to perform refreshing of * graphical related parameters from system settings. */ virtual void RefreshMetrics() { m_clrTopLeftBorder.SetStandardValue(RGB(255, 255, 255)); } END_VIEW_PART(DayMonthViewHeaderPart) /** * @brief * This paint manager part is used to draw days headers for * the Day View. */ BEGIN_VIEW_PART(DayViewHeaderPart, DayMonthViewHeaderPart) /** * @brief * This member function is used to draw the day header. * * @param pDC Pointer to a valid device context. * @param pViewDay A CXTPCalendarDayViewDay pointer to the Day View * object. * @param rc A CRect object that contains the coordinates of * the Header's bounding rectangle. * @param strText A CString object that contains the Header text. */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayViewDay* pViewDay, CRect rc, CString strText); virtual void RefreshMetrics(); END_VIEW_PART(DayViewHeaderPart) /** * @brief * This paint manager part is used to draw Groups headers for * the Day View. */ BEGIN_VIEW_PART(DayViewGroupHeaderPart, DayMonthViewHeaderPart) /** * @brief * This member function is used to draw the day header. * * @param pDC Pointer to a valid device context. * @param pViewGroup A CXTPCalendarDayViewGroup pointer to the Group * object. * @param rc A CRect object that contains the coordinates of * the Header's bounding rectangle. * @param strText A CString object that contains the Header text. */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, CRect rc, CString strText); END_VIEW_PART(DayViewGroupHeaderPart) /** * @brief * This paint manager part is used to draw all day events area for * the Day View. */ BEGIN_VIEW_PART(DayViewAllDayEventsPart, XTPCalendarViewPart) /** * @brief * This member functions is used to perform refreshing of graphical * related parameters from system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to draw the all-day events area. * * @param pDC Pointer to a valid device context. * @param pViewGroup A CXTPCalendarDayViewGroup pointer to the Group object. * @param rc A CRect object that contains the all-day events * area bounding rectangle coordinates. * @param bSelected A BOOL. TRUE if the draw area is selected. FALSE otherwise. */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, CRect rc, BOOL bSelected); END_VIEW_PART(DayViewAllDayEventsPart) /** * @brief * This paint manager part is used to draw all day events scroll buttons if there are too * many all day events. */ BEGIN_VIEW_PART(DayViewAllDayEventScrollIconsPart, XTPCalendarViewPart) /** * @brief * This member function is used to draw scroll icons in all day events area. * * @param pDC Pointer to a valid device context. * @param pViewGroup A CXTPCalendarDayViewGroup pointer to the Group object. * @param bDrawUp selects show-hide up scroll icon * @param bDrawDown selects show-hide down scroll icon * @param rcIconUp scroll up icon area * @param rcIconDown scroll down icon area * @param bHighlightUp selects if draw the icon in highlighted color * @param bHighlightDown selects if draw the icon in highlighted color */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, BOOL bDrawUp, BOOL bDrawDown, const CRect& rcIconUp, const CRect& rcIconDown, BOOL bHighlightUp, BOOL bHighlightDown); END_VIEW_PART(DayViewAllDayEventScrollIconsPart) /** * @brief * This paint manager part is used to draw events for * the Day View. */ BEGIN_VIEW_PART(DayViewEventPart, XTPCalendarViewPart) /** * @brief * Performs refreshing of graphical related parameters from * system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to draw an event. * * @param pDC Pointer to a valid device context. * @param pViewEvent A CXTPCalendarDayViewEvent pointer to the Day * Event View object. */ virtual void OnDraw(CDC* pDC, CXTPCalendarDayViewEvent* pViewEvent); END_VIEW_PART(DayViewEventPart) /** //## Month View related drawing */ /** * @brief * This paint manager part is used to draw days grid and to fill * days cells background for the Month View. */ BEGIN_VIEW_PART(MonthViewGridPart, XTPCalendarViewPart) CXTPPaintManagerColor m_clrBackground2; /**< Second background color which is used to fill days background.*/ /** * @brief * Performs refreshing of graphical related parameters from * system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to draw the days grid and to fill * the days cells background. * * @param pDC Pointer to a valid device context. * @param pMonthView A CXTPCalendarMonthView pointer to the Month View object. */ virtual void OnDrawGrid(CDC* pDC, CXTPCalendarMonthView* pMonthView); END_VIEW_PART(MonthViewGridPart) /** * @brief * This paint manager part is used to draw week days headers for * the Month View. */ BEGIN_VIEW_PART(MonthViewHeaderPart, DayMonthViewHeaderPart) /** * @brief * This member function is used to draw the week day header. * * @param pDC Pointer to a valid device context. * @param pMonthView A CXTPCalendarMonthView pointer to the Month * View object. * @param rc A CRect object that contains the Week Day header's * bounding rectangle coordinates. * @param nCollIndex An int that contains the Week Day column index in the grid. * @param strText A CString object that contains the formatted Week Day name. */ virtual void OnDraw(CDC* pDC, CXTPCalendarMonthView* pMonthView, CRect rc, int nCollIndex, CString strText); virtual void RefreshMetrics(); END_VIEW_PART(MonthViewHeaderPart) /** * @brief * This paint manager part is used to draw events and day dates * for the Month View. */ BEGIN_VIEW_PART(MonthViewEventPart, XTPCalendarViewPart) COLORREF m_clrTextHighLightColor; /**< Text color for the selected event.*/ COLORREF m_clrMultiDayEventFrameColor; /**< Multi-day event frame color. */ COLORREF m_clrClassicUnderline; /**< Underline color for today day. */ CXTPPaintManagerColorGradient m_grclrClassicSelDay; /**< Gradient color for today day.*/ /** * @brief * Performs refreshing of graphical related parameters from * system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to draw an event. * * @param pDC Pointer to a valid device context. * @param pViewEvent A CXTPCalendarMonthViewEvent pointer to the Month Event View object. */ virtual void OnDrawEvent(CDC* pDC, CXTPCalendarMonthViewEvent* pViewEvent); /** * @brief * This member function is used to draw the week day header. * * @param pDC Pointer to a valid device context. * @param rc A CRect object that contains the Day header's bounding * rectangle coordinates. * @param bToday TRUE for today day, otherwise FALSE. * @param bSelected Is day selected. * @param strText Formatted day date string. * @param bFirstMonthDay TRUE to display the first month day. */ virtual void OnDrawDayDate(CDC* pDC, CRect rc, BOOL bToday, BOOL bSelected, BOOL bFirstMonthDay, CString strText); END_VIEW_PART(MonthViewEventPart) /** //## Week view related drawing */ /** * @brief * This paint manager part is used to draw week days grid and * headers for the Week View. */ BEGIN_VIEW_PART(WeekViewPart, XTPCalendarViewPart) COLORREF m_clrTextHighLightColor; /**< Text color for the selected day header. */ COLORREF m_clrTextNormalColor; /**< Text color for the day header and some other elements.*/ COLORREF m_clrHeaderBottomLine; /**< Text color for the day header bottom line. */ /** * @brief * Performs refreshing of graphical related parameters from * system settings. */ virtual void RefreshMetrics(); /** * @brief * This member function is used to draw an event. * * @param pDC Pointer to a valid device context. * @param pWeekView A CXTPCalendarWeekView pointer to the Week Event View object. */ virtual void OnDraw(CDC* pDC, CXTPCalendarWeekView* pWeekView); /** * @brief * This member function is used to draw the day header. * * @param pDC Pointer to a valid device context. * @param rcDay A CRect object that contains the day's bounding * rectangle coordinates. * @param nHeaderHeight An int that contains the header height value. * @param strHeader A CString object that contains the header text. * @param bIsCurrent A BOOL. TRUE if this is the current day for today. FALSE otherwise. * @param bIsSelected A BOOL. TRUE if the day is selected. FALSE otherwise. */ virtual void DrawDayHeader(CDC* pDC, CRect rcDay, int nHeaderHeight, CString strHeader, BOOL bIsCurrent = FALSE, BOOL bIsSelected = FALSE); END_VIEW_PART(WeekViewPart) /** * @brief * This paint manager part is used to draw events for the * Week View. */ BEGIN_VIEW_PART(WeekViewEventPart, XTPCalendarViewPart) COLORREF m_clrTextHighLightColor; /**< Text color for the selected event. */ COLORREF m_clrTextNormalColor; /**< Text color for the event. */ /** * @brief * This member function is used to perform refreshing of * graphical related parameters from system settings. */ virtual void RefreshMetrics() { m_clrBackground.SetStandardValue( m_pPaintManager->GetWeekViewPart()->GetBackgroundColor()); // RGB(255, 255, 213)); m_clrTextColor.SetStandardValue(m_pPaintManager->m_clrButtonFaceText); m_clrTextHighLightColor = RGB(255, 255, 255); m_clrTextNormalColor = m_pPaintManager->m_clrButtonFaceText; LOGFONT lfIcon; VERIFY(m_pPaintManager->GetIconLogFont(&lfIcon)); m_fntText.SetStandardValue(&lfIcon); } /** * @brief * This member function is used to draw the specified event. * * @param pDC Pointer to a valid device context. * @param pWeekViewEvent A CXTPCalendarWeekViewEvent pointer to the Week Event View object. */ virtual void OnDraw(CDC* pDC, CXTPCalendarWeekViewEvent* pWeekViewEvent); /** * @brief * This member functions is used to draw the event border. * * @param pDC Pointer to a valid device context. * @param pWeekViewEvent A CXTPCalendarWeekViewEvent pointer to the Week Event View object. * @param rcView A CRect that contains the day view's bounding rectangle coordinates. */ virtual void DrawBorder(CDC* pDC, CRect rcView, CXTPCalendarWeekViewEvent* pWeekViewEvent); /** * @brief * This member function is used to draw the event's times texts or icons. * * @param pDC Pointer to a valid device context. * @param pWeekViewEvent A CXTPCalendarWeekViewEvent pointer to the Week Event View object. * @return Draws times texts or icons */ virtual int DrawTimes(CDC* pDC, CXTPCalendarWeekViewEvent* pWeekViewEvent); /** * @brief * This member function is used to draw the event subject. * * @param pDC Pointer to a valid device context. * @param pWeekViewEvent A CXTPCalendarWeekViewEvent pointer to the Week Event View object. */ virtual void DrawSubj(CDC* pDC, CXTPCalendarWeekViewEvent* pWeekViewEvent); END_VIEW_PART(WeekViewEventPart) /** * @brief This paint manager part is used to draw time scale for the * Time Line view */ BEGIN_VIEW_PART(TimeLineViewTimeScalePart_Day, XTPCalendarTimeLineViewTimeScalePart) virtual void Draw(CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); END_VIEW_PART(TimeLineViewTimeScalePart_Day) BEGIN_VIEW_PART(TimeLineViewTimeScalePart_Week, XTPCalendarTimeLineViewTimeScalePart) virtual void Draw(CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); END_VIEW_PART(TimeLineViewTimeScalePart_Week) BEGIN_VIEW_PART(TimeLineViewTimeScalePart_Month, XTPCalendarTimeLineViewTimeScalePart) virtual void Draw(CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); END_VIEW_PART(TimeLineViewTimeScalePart_Month) BEGIN_VIEW_PART(TimeLineViewTimeScalePart_WorkWeek, XTPCalendarTimeLineViewTimeScalePart) virtual void Draw(CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); END_VIEW_PART(TimeLineViewTimeScalePart_WorkWeek) BEGIN_VIEW_PART(TimeLineViewPart, XTPCalendarTimeLineViewPart) CXTPPaintManagerColor m_clrEventBar; /**< Event bar color. */ CXTPPaintManagerColor m_clrEventBarLine; /**< Event bar line color. */ CXTPPaintManagerColor m_clrEventBorderLine; /**< Event border line color.*/ CXTPPaintManagerColor m_clrTimeScaleBackground; /**< Time scale background color.*/ CXTPPaintManagerColor m_clrTimeScaleHightlite; /**< Time scale highlight color. */ CXTPPaintManagerColor m_clrTimeScaleText; /**< The time scale text color. */ CXTPPaintManagerColor m_clrSelectedBackground; /**< The selected background color. */ CXTPPaintManagerColor m_clrSelectedText; /**< The selected text color. */ CXTPPaintManagerColor m_clrBackground; /**< The background color.*/ CXTPPaintManagerColor m_clrText; /**< The text color.*/ CXTPPaintManagerColor m_clrWeekendBackground; /**< Time scale weekend background color.*/ /** * @brief * Call this function to draw the time line view group. * * @param pDC The device context. * @param rcRect Rectangular drawing area. * @param pGroup The calendar time line view group. */ virtual void DrawGroup(CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineViewGroup* pGroup); /** * @brief * Call this function to calculate the time line view event size. * * @param pViewEvent The event view. * @param c Points to a valid device context * * @return A CSize object denoting the size of the time line view event. */ virtual CSize CalcEventSize(CDC* c, CXTPCalendarTimeLineViewEvent* pViewEvent); /** * @brief * Call this function to draw the event. * * @param pDC The device context. * @param rcEvents The rectangular bounds. * @param pViewEvent The event view. */ virtual void DrawEvent(CDC* pDC, const CRect& rcEvents, CXTPCalendarTimeLineViewEvent* pViewEvent); /** * @brief * Call this function to refresh the metrics */ virtual void RefreshMetrics(); CXTPImageManager* m_pImgTLVEvent; /** * @brief * Call this function to do the initializations */ virtual void _Init(); /** * @brief * Destroys the CTimeLineViewPart object, does the cleanup. */ virtual ~CTimeLineViewPart(); END_VIEW_PART(TimeLineViewPart) virtual void DrawBorders(CDC* pDC, const CRect& rcRect, const CRect& rcBorders); virtual void DrawExpandSign(CDC* pDC, BOOL bExpandUp, const CRect& rcTSHours); virtual CXTPCalendarViewEventSubjectEditor* StartEditSubject(CXTPCalendarViewEvent* pViewEvent, CRect& rcEditor); virtual void SetEditFont(CXTPCalendarViewEvent* pViewEvent, CXTPCalendarViewEventSubjectEditor* pEditor); virtual void GetDateFormat(CString& strShort, CString& strLong); protected: virtual void CreateGlyphsFont(); virtual void RefreshPartMetrics(); //-- CALENDAR PART REFRESH METHODS virtual void PartRefresh(CControlPart* pViewPart); virtual void PartRefresh(CDayViewEventPart* pViewPart); virtual void PartRefresh(CDayViewTimeScaleCellPart* pViewPart); virtual void PartRefresh(CDayViewTimeScaleHeaderPart* pViewPart); virtual void PartRefresh(CDayViewCellPart* pViewPart); virtual void PartRefresh(CDayViewAllDayEventsPart* pViewPart); virtual void PartRefresh(CDayViewHeaderPart* pViewPart); virtual void PartRefresh(CWeekViewPart* pViewPart); virtual void PartRefresh(CMonthViewHeaderPart* pViewPart); virtual void PartRefresh(CMonthViewEventPart* pViewPart); virtual void PartRefresh(CDayViewWorkCellPart* pViewPart); virtual void PartRefresh(CDayViewNonworkCellPart* pViewPart); virtual void PartRefresh(CMonthViewGridPart* pViewPart); virtual void PartRefresh(CTimeLineViewPart* pViewPart); //-- CALENDAR PART DRAWING METHODS virtual void PartDraw(CDayViewEventPart* pViewPart, CDC* pDC, CXTPCalendarDayViewEvent* pViewEvent); virtual void PartDrawHourCell(CDayViewTimeScaleCellPart* pViewPart, CDC* pDC, CRect rc, CString strText, BOOL bFillBackground, BOOL bCurrentTime); virtual void PartDrawBigHourCell(CDayViewTimeScaleCellPart* pViewPart, CDC* pDC, CRect rc, CString strHour, CString strMin, int nRowPerHour, BOOL bFillBackground, BOOL bCurrentTime); virtual void PartDraw(CDayViewTimeScaleHeaderPart* pViewPart, CDC* pDC, CXTPCalendarDayView* pView, CRect rc, CString strText); virtual void PartDrawNowLine(CDayViewTimeScaleHeaderPart* pViewPart, CDC* pDC, CXTPCalendarDayView* pView, CRect rc, int y, BOOL bDrawBk); virtual void PartDrawNowLine(CDayViewTimeScaleHeaderPart* pViewPart, CDC* pDC, CXTPCalendarDayView* pView, CXTPCalendarDayViewTimeScale* pScale, CRect rc, int y, BOOL bDrawBk); virtual void PartDraw(CDayViewCellPart* pViewPart, CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, CRect rc, const XTP_CALENDAR_DAYVIEWCELL_PARAMS& cellParams); virtual void PartDraw(CDayViewAllDayEventsPart* pViewPart, CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, CRect rc, BOOL bSelected); virtual void PartDraw(CDayViewHeaderPart* pViewPart, CDC* pDC, CXTPCalendarDayViewDay* pViewDay, CRect rc, CString strText); virtual void PartDraw(CDayViewAllDayEventScrollIconsPart* pViewPart, CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, BOOL bDrawUp, BOOL bDrawDown, const CRect& rcIconUp, const CRect& rcIconDown, BOOL bHighlightUp, BOOL bHighlightDown); virtual void PartDraw(CDayViewGroupHeaderPart* pViewPart, CDC* pDC, CXTPCalendarDayViewGroup* pViewGroup, CRect rc, CString strText); virtual void PartDrawDayHeader(CWeekViewPart* pViewPart, CDC* pDC, CRect rcDay, int nHeaderHeight, CString strHeader, BOOL bIsCurrent, BOOL bIsSelected); virtual void PartDraw(CWeekViewPart* pViewPart, CDC* pDC, CXTPCalendarWeekView* pWeekView); virtual void PartDrawBorder(CWeekViewEventPart* pViewPart, CDC* pDC, CRect rcView, CXTPCalendarWeekViewEvent* pWeekViewEvent); virtual int PartDrawTimes(CWeekViewEventPart* pViewPart, CDC* pDC, CXTPCalendarWeekViewEvent* pWeekViewEvent); virtual void PartDrawSubj(CWeekViewEventPart* pViewPart, CDC* pDC, CXTPCalendarWeekViewEvent* pWeekViewEvent); virtual void PartDraw(CWeekViewEventPart* pViewPart, CDC* pDC, CXTPCalendarWeekViewEvent* pWeekViewEvent); virtual void PartDrawGrid(CMonthViewGridPart* pViewPart, CDC* pDC, CXTPCalendarMonthView* pMonthView); virtual void PartDraw(CMonthViewHeaderPart* pViewPart, CDC* pDC, CXTPCalendarMonthView* pMonthView, CRect rc, int nCollIndex, CString strText); virtual void PartDrawDayDate(CMonthViewEventPart* pViewPart, CDC* pDC, CRect rc, BOOL bToday, BOOL bSelected, BOOL bFirstMonthDay, CString strText); virtual void PartDrawEvent(CMonthViewEventPart* pViewPart, CDC* pDC, CXTPCalendarMonthViewEvent* pViewEvent); virtual void PartDraw(CTimeLineViewTimeScalePart_Day* pViewPart, CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); virtual void PartDraw(CTimeLineViewTimeScalePart_Week* pViewPart, CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); virtual void PartDraw(CTimeLineViewTimeScalePart_Month* pViewPart, CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); virtual void PartDraw(CTimeLineViewTimeScalePart_WorkWeek* pViewPart, CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineView* pView); virtual void PartDrawGroup(CTimeLineViewPart* pViewPart, CDC* pDC, const CRect& rcRect, CXTPCalendarTimeLineViewGroup* pGroup); virtual void PartDrawEvent(CTimeLineViewPart* pViewPart, CDC* pDC, const CRect& rcEvents, CXTPCalendarTimeLineViewEvent* pViewEvent); //-- CALENDAR PART GET METHODS virtual COLORREF PartGetBackColor(CXTPCalendarViewPart* pViewPart); virtual COLORREF PartGetTextColor(CXTPCalendarViewPart* pViewPart); virtual CFont& PartGetTextFont(CXTPCalendarViewPart* pViewPart, CXTPCalendarViewPartFontValue& fntText); virtual void PartGetParams(CDayViewCellPart* pViewPart, CXTPCalendarDayViewGroup* pViewGroup, XTP_CALENDAR_DAYVIEWCELL_PARAMS* rCellParams); //-- MISC PART METHODS virtual void PartCalcWidth(CDayViewTimeScaleCellPart* pViewPart, CDC* pDC, const CString& strHour, const CString& strMin, int nHourHeight, int& nWidth); virtual void PartAdjustTimeFont(CDayViewTimeScaleCellPart* pViewPart, CDC* pDC, CRect rcCell); virtual CSize PartCalcEventSize(CTimeLineViewPart* pViewPart, CDC* pDC, CXTPCalendarTimeLineViewEvent* pViewEvent); public: /** * @brief * Default paint manager constructor. * * @details * Handles initial initialization. * * @see RefreshMetrics() */ CXTPCalendarPaintManager(); /** * @brief * Default paint manager destructor. * * @details * Handles member items deallocation. */ virtual ~CXTPCalendarPaintManager(); public: /** * @brief * This member function is called to update event label default colors. */ virtual void UpdateEventLabelsDefaultColors(); /** * @brief * This member function is called to update event category default colors. */ virtual void UpdateEventCategoriesDefaultColors(); /** * @brief * This member function is used to obtain the current paint theme. * * @return A paint theme ID from enum XTPCalendarTheme. */ virtual XTPCalendarTheme GetPaintTheme() const; /** * @brief * This member function is used to set the current paint theme. * * @param ePaintTheme A paint theme ID from enum XTPCalendarTheme. */ virtual void SetPaintTheme(XTPCalendarTheme ePaintTheme); /** * @brief * This member function is used to initialize all drawing defaults. * * @details * Initializes all drawings defaults (fonts, colors, etc.). * most of defaults are system defaults. */ virtual void RefreshMetrics(); /** * @brief * Initializes Calendar images. * * @details * Called by the paint manager to initialize images used by the * Calendar control. */ virtual void UpdateGlyphs(); /** * @brief * Call this member function to get the background color for * the specified event. * * @param pEvent Points to the Calendar event. * @param crDefault RGB value representing the default color to be * returned if one could not be found. * * @return An RGB value representing the event background color if * successful, otherwise returns the value specified by crDefault. */ virtual COLORREF GetEventBackColor(CXTPCalendarEvent* pEvent, COLORREF crDefault); /** * @brief * This member function is used to draw an arbitrary line. * * @param pDC Pointer to a valid device context. * @param xPos An int that contains the Horizontal coordinate of the beginning of line. * @param yPos An int that contains the Vertical coordinate of the beginning of line. * @param cx An int that contains the Horizontal coordinate of the end of line. * @param cy An int that contains the Vertical coordinate of the end of line. * * @details * This member function is used anywhere a simple arbitrary line is needed. */ virtual void DrawLine(CDC* pDC, int xPos, int yPos, int cx, int cy); /** * @brief * This member function is used to draw a Horizontal line. * * @param pDC Pointer to a valid device context. * @param xPos An int that contains the Horizontal coordinate of the beginning of the line. * @param yPos An int that contains the Vertical coordinate of the beginning of the line. * @param cx An int that contains the Length of the line. * * @details * This member function is used anywhere a simple horizontal line is needed. */ virtual void DrawHorizontalLine(CDC* pDC, int xPos, int yPos, int cx); /** * @brief * This member function is used to draw a Vertical line. * * @param pDC Pointer to a valid device context. * @param xPos An int that contains the Horizontal coordinates of the beginning of the line. * @param yPos An int that contains the Vertical coordinates of the beginning of the line. * @param cy An int that contains the Length of the line. * * @details * This member function is used anywhere a simple vertical line is needed. */ virtual void DrawVerticalLine(CDC* pDC, int xPos, int yPos, int cy); /** * @brief * This member function is used to draw the time as a clock. * * @param pDC Pointer to a valid device context. * @param dtClockTime A COleDateTime object that contains the time to draw. * @param rcView A CRect object that contains the bounding rectangle * coordinates of where the clock is drawn. * @param clrBackground A COLORREF object that contains the background color of the clock. * @param cafAlign A XTPCalendarClockAlignFlags alignment flag, appropriate values are * determined by * enum XTPCalendarClockAlignFlags. * * @details * This member function is used anywhere a time clock is needed. * * @return Returns the size (width) of the square where clock icon was drawn inside. * Zero when clock icon wasn't successfully drawn. * * @see XTPCalendarClockAlignFlags */ virtual int DrawClock(CDC* pDC, COleDateTime dtClockTime, CRect rcView, COLORREF clrBackground, XTPCalendarClockAlignFlags cafAlign); /** * @brief * This member function is used to draw a bitmap from the provided ImageList. * * @param pImageList A CImageList pointer to the ImageList. * @param pDC Pointer to a valid device context. * @param rcView A CRect object that contains the bounding rectangle * coordinates to draw the bitmap. * @param iIcon An int that contains the image index. * @param uFlags Additional drawing options. Should be 0 or DT_VCENTER. * * @details * Use this function to draw a bitmap in the view's bounding rectangle. * If the provided bounding rectangle is too small, then the bitmap is not drawn. * * @return * An int that contains the width of the drawn bitmap. */ virtual int DrawBitmap(CImageList* pImageList, CDC* pDC, CRect rcView, int iIcon, UINT uFlags = 0); /** * @brief * This member function is used to draw the bitmap using its resource id. * * @param nIDResource A UINT that contains the integer resource id of the bitmap. * @param pDC Pointer to a valid device context. * @param rcBitmap A CRect that contains the bounding rectangle coordinates * used to draw the bitmap. * * @details * Use this function to draw a bitmap in the view's bounding rectangle. * If the provided bounding rectangle is too small, then the bitmap is not drawn. * * @return An int that contains the width of the drawn bitmap. */ virtual int DrawBitmap(UINT nIDResource, CDC* pDC, CRect rcBitmap); /** * @brief * This member function is used to draw the Glyph symbol using special * font. * * @param pDC Pointer to a valid device context. * @param rc A CRect that contains the bounding rectangle coordinates * used to draw the symbol. * @param ch A char symbol (from the font) to draw. * * @details * Use this function to draw the Glyph symbol in the center * of the provided bounding rectangle. * * @return An int that contains the width of the drawn symbol. */ virtual int DrawIconChar(CDC* pDC, CRect rc, TCHAR ch); /** * @brief * This member function is used to obtain the horizontal and vertical * size of the Expand Sign bitmap. * * @return A CSize object that contains the bitmap size. */ virtual const CSize GetExpandSignSize(); /** * @brief * This member function is used to obtain the horizontal and vertical * size of the Clock. * * @return A CSize object that contains the bitmap size. */ virtual CSize GetClockSize(); /** * @brief * This member function is used to set the CXTPCalendarControl object * for the CXTPCalendarPaintManager. * * @param pControl A CXTPCalendarControl pointer to the CXTPCalendarControl object. */ virtual void SetControl(CXTPCalendarControl* pControl); /** * @brief * Call this member function to draw the shadow regions around the * rectangle. * * @param pDC Pointer to a valid device context. * @param rcRect A CRect that contains the rectangle coordinates of where * to draw the shadow regions. */ virtual void DrawShadow(CDC* pDC, const CRect& rcRect); /** * @brief * Call this member function to draw icons corresponding to the event * state. * * @param pDC Pointer to a valid device context. * @param pViewEvent A CXTPCalendarViewEvent pointer to the event view object. * @return Draws icons */ virtual int DrawIcons(CDC* pDC, CXTPCalendarViewEvent* pViewEvent); /** * @brief * This member function is used to draw the Header. * * @param pDC Pointer to a valid device context. * @param rcHeader A CRect that contains the bounding rectangle coordinates * used to draw the header. * @param bIsSelected A BOOL. TRUE if the header is selected. FALSE otherwise. * @param bIsCurrent A BOOL. TRUE if the header represents the current time. * FALSE otherwise. */ virtual void DrawHeader(CDC* pDC, CRect& rcHeader, BOOL bIsSelected, BOOL bIsCurrent); /** * @brief * This member function is used to draw the Header. * * @param pDC Pointer to a valid device context. * @param rcHeader A CRect that contains the bounding rectangle coordinates * used to draw the header. * @param bIsSelected A BOOL. TRUE if the header is selected. FALSE otherwise. * @param bIsCurrent A BOOL. TRUE if the header represents the current time. * FALSE otherwise. * @param grclr A CXTPPaintManagerColorGradient object that specifies the Gradient * color. * @param clrUnderLineHdr A COLORREF object that specifies the color of header's * underline. */ virtual void DrawHeader(CDC* pDC, CRect& rcHeader, BOOL bIsSelected, BOOL bIsCurrent, const CXTPPaintManagerColorGradient& grclr, COLORREF clrUnderLineHdr); /** * @brief * This member function is used to fill the area using the corresponding * busy color or pattern. * * @param pDC Pointer to a valid device context. * @param rcRect A CRect object that contains the rectangle coordinates * used to fill the corresponding busy color or pattern. * @param eBusyStatus An int that contains the Event Busy Status value from * enum XTPCalendarEventBusyStatus. * * @see XTPCalendarEventBusyStatus * @see CRgn */ virtual void DrawBusyStatus(CDC* pDC, CRect& rcRect, int eBusyStatus); /** * @brief * This member function is used to fill the area using the corresponding * busy color or pattern. * * @param pDC Pointer to a valid device context. * @param eBusyStatus An int that contains the Event Busy Status value from * enum XTPCalendarEventBusyStatus. * @param rgnBusy A CRgn that contains the region area used to fill with the * corresponding busy color or pattern and draw the region * border using m_clrWindowText color. * * @see XTPCalendarEventBusyStatus * @see CRgn */ virtual void DrawBusyStatus(CDC* pDC, CRgn& rgnBusy, int eBusyStatus); /** * @brief * This member function is used to enable a new theme. * * @param bEnableTheme A BOOL. TRUE if the theme enabled. FALSE otherwise. */ void EnableTheme(BOOL bEnableTheme); /** * @brief * This member function is used to obtain the status of the theme. * * @return A BOOL. TRUE if theme is enabled. FALSE otherwise. */ BOOL IsThemeEnabled(); /** * @brief * Call this member function to determine the current Windows XP * theme that is in use. * * @return A XTPCurrentSystemTheme enumeration that represents the * current Windows theme in use, can be one of the following * values: * xtpSystemThemeUnknown - No known theme in use, or Windows Classic theme. * xtpSystemThemeBlue - Blue theme in use. * xtpSystemThemeOlive - Olive theme in use. * xtpSystemThemeSilver - Silver theme in use. */ XTPCurrentSystemTheme GetCurrentSystemTheme(); public: private: CSize m_szExpandSign; // Cached size of the expand sign protected: /** * @brief * Call this member function to add the specified ViewPart object * to the parts list. * * @param pPart Pointer to a 'View Part' object. * * @return Pointer to a 'View Part' object. */ CXTPCalendarViewPart* AddViewPart(CXTPCalendarViewPart* pPart); public: CFont* m_pSelFont; CXTPPaintManagerColor m_clrButtonFace; /**< Stores standard Button Face color. */ CXTPPaintManagerColor m_clrButtonFaceText; /**< Stores standard color to display text. */ CXTPPaintManagerColor m_clrWindow; /**< Stores standard windows color. */ CXTPPaintManagerColor m_clrWindowText; /**< Stores standard color to display window text. */ CXTPPaintManagerColor m_clr3DShadow; /**< Stores standard color to display shadow items. */ CXTPPaintManagerColor m_clrHighlight; /**< Stores standard color to display highlighted items.*/ CXTPPaintManagerColor m_clrBorders[4]; /**< Stores border line color, left = 0, top = 1, right = 2, bottom = 3.*/ CXTPPaintManagerColor m_clrTLVEventBar; CXTPPaintManagerColor m_clrTLVEventBarLine; CXTPPaintManagerColor m_clrTLVEventBorderLine; CXTPPaintManagerColor m_clrTLVTimeScaleBackground; CXTPPaintManagerColor m_clrTLVTimeScaleBorder; CXTPPaintManagerColor m_clrTLVTimeScaleHighlight; CXTPPaintManagerColor m_clrTLVTimeScaleText; CXTPPaintManagerColor m_clrTLVText; CXTPPaintManagerColor m_clrTLVBack; CXTPPaintManagerColor m_clrTLVSelectedText; CXTPPaintManagerColor m_clrTLVSelectedBack; CXTPPaintManagerColor m_clrTLVWeekendBack; CXTPPaintManagerColorGradient m_grclrToday; /**< Gradient color of today's header.*/ /** * @brief * Call this member function to set custom brush to draw event busy status. * * @param nBusyStatus Busy status value. * @param pBrush Pointer to a brush object. * @param bAutodeleteBrush This parameter indicates should be a brush object * deleted when destroy or other brush is set. * If TRUE - brush object will be deleted automatically. * * Example: *
	 *
	 *  m_wndCalendar.GetPaintManager()->SetBusyStatusBrush(
	 *  xtpCalendarBusyStatusFree, new CBrush(RGB(240, 255, 250)), TRUE);
	 *
	 *  m_wndCalendar.GetPaintManager()->SetBusyStatusBrush(
	 *  xtpCalendarBusyStatusTentative, new CBrush(RGB(240, 120, 250)), TRUE);
	 *
	 *  m_wndCalendar.GetPaintManager()->SetBusyStatusBrush(
	 *  100, new CBrush(RGB(240, 120, 250)), TRUE);
	 *
	 * 
*/ void SetBusyStatusBrush(int nBusyStatus, CBrush* pBrush, BOOL bAutodeleteBrush); /** * @brief * Call this member function to get a brush to draw event busy status. * * @param nBusyStatus Busy status value. * * @return Pointer to a brush object. */ CBrush* GetBusyStatusBrush(int nBusyStatus); /** * @brief * This member function returns a set of flags which define calendar items * to send an XTP_NC_CALENDAR_GETITEMTEXT notification. * * @return Set of flags from enums XTPCalendarGetItemText, XTPCalendarGetItemTextEx. * * @see XTPCalendarGetItemText * @see XTPCalendarGetItemTextEx * @see SetAskItemTextFlags * @see CXTPCalendarControl::GetAskItemTextFlags * @see CXTPCalendarTheme::GetAskItemTextFlags * @see CXTPCalendarTheme::SetAskItemTextFlags * @see XTP_NC_CALENDAR_GETITEMTEXT */ DWORD GetAskItemTextFlags() const; /** * @brief * This member function is used to set flags which define calendar items * to send an XTP_NC_CALENDAR_GETITEMTEXT notification. * * @param dwFlags Set of flags from enums XTPCalendarGetItemText, * XTPCalendarGetItemTextEx. * * @see XTPCalendarGetItemText * @see XTPCalendarGetItemTextEx * @see GetAskItemTextFlags * @see CXTPCalendarControl::GetAskItemTextFlags * @see CXTPCalendarTheme::GetAskItemTextFlags * @see CXTPCalendarTheme::SetAskItemTextFlags * @see XTP_NC_CALENDAR_GETITEMTEXT */ void SetAskItemTextFlags(DWORD dwFlags); BOOL GetIconLogFont(LOGFONT* plf); CUIntArray m_arStartCol; /**< hold start column in each virtual page */ CUIntArray m_arStartRow; /**< hold start row in each virtual page */ int m_PrintPageWidth; /**< Print page width. */ protected: CList m_lstViewParts; /**< Collection to store ViewParts objects.*/ /** * @brief * Enumerates types of expand signs drawn on a day view. */ enum XTPEnumExpandSigns { idxExpandSignUp = 0, /**< Expand sign: arrow up */ idxExpandSignDown = 1 /**< Expand sign: arrow down */ }; CXTPImageManager* m_pExpandSigns; /**< Stores standard Expand Signs icons.*/ /** * @brief * Enumerates types of event glyphs */ enum XTPEnumEventGlyphs { idxMeeting = 0, /**< Meeting glyph */ idxPrivate = 1, /**< Private glyph */ idxRecurrenceException = 2, /**< Recurrence exception glyph */ idxRecurrenceOccurrence = 3, /**< Recurrence occurrence glyph */ idxReminder = 4 /**< Reminder glyph */ }; CXTPImageManager* m_pGlyphs; /**< Stores standard glyphs for displaying events. Used when glyphs font is not installed.*/ CFont* m_pGlyphsFont; /**< Stores standard glyphs font for displaying events.*/ CBitmap m_bmpElsewherePattern; /**< Stores standard bitmap pattern to draw Elsewhere event busy status.*/ CXTPBrush m_xtpBrushElsewhere; /**< Stores standard brush to draw Elsewhere event busy status.*/ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CBrush, m_brushElsewhere, m_xtpBrushElsewhere, GetBrushElsewhereHandle); CBitmap m_bmpTentativePattern; /**< Stores standard bitmap pattern to draw Tentative event busy status.*/ CXTPBrush m_xtpBrushTentative; /**< Stores standard brush to draw Tentative event busy status.*/ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CBrush, m_brushTentative, m_xtpBrushTentative, GetBrushTentativeHandle); CXTPCalendarTypedPtrAutoDeleteArray m_arBusyStatusBrushes; /**< Stores customizable brush values to draw Event Busy Status in the Day View.*/ /** * @brief * Returns drawing brush value for a specific busy status. * * @param eBusyStatus Busy status enumeration. * @param bGrow Append a new brush value if needed or not. * * @return Pointer to CXTPCalendarViewPartBrushValue array member. * * @see XTPCalendarEventBusyStatus */ CXTPCalendarViewPartBrushValue* _GetAtGrow_BusyStatusBrushValue(int eBusyStatus, BOOL bGrow); /** * @brief * Set default colors/patterns to fill Busy Status area. */ virtual void InitBusyStatusDefaultColors(); virtual void FormatLabel(CString& strLabel); CSize m_szClockRect; /**< Stores dimensions for a rectangle used to display the time as a clock glyph.*/ CXTPCalendarControl* m_pControl; /**< Stores a pointer to a CXTPCalendarControl object.*/ BOOL m_bEnableTheme; /**< True to enable Luna theme.*/ COLORREF m_clrUnderLineHdr; /**< Color of header's underline.*/ XTPCurrentSystemTheme m_CurrSystemTheme; /**< Current theme flag.*/ XTPCalendarTheme m_nPaintTheme; /**< Store the Paint Theme;*/ DWORD m_dwAskItemTextFlags; /**< Store flag set to send XTP_NC_CALENDAR_GETITEMTEXT notification.*/ protected: # ifdef _XTP_ACTIVEX friend class CCalendarControlCtrl; CXTPCalendarFlagsSet_imp* AxGetAskItemTextFlags(); friend class CXTPCalendarMonthViewDay; # endif }; ///////////////////////////////////////////////////////////////////////////// AFX_INLINE XTPCalendarTheme CXTPCalendarPaintManager::GetPaintTheme() const { return m_nPaintTheme; } AFX_INLINE void CXTPCalendarPaintManager::SetPaintTheme(XTPCalendarTheme ePaintTheme) { m_nPaintTheme = min(xtpCalendarThemeOffice2013, ePaintTheme); RefreshMetrics(); } AFX_INLINE XTPCurrentSystemTheme CXTPCalendarPaintManager::GetCurrentSystemTheme() { return m_CurrSystemTheme; } AFX_INLINE CSize CXTPCalendarPaintManager::GetClockSize() { return m_szClockRect; } AFX_INLINE BOOL CXTPCalendarPaintManager::IsThemeEnabled() { return m_bEnableTheme; } AFX_INLINE void CXTPCalendarPaintManager::EnableTheme(BOOL bEnableTheme) { m_bEnableTheme = bEnableTheme; RefreshMetrics(); } AFX_INLINE DWORD CXTPCalendarPaintManager::GetAskItemTextFlags() const { return m_dwAskItemTextFlags; } AFX_INLINE void CXTPCalendarPaintManager::SetAskItemTextFlags(DWORD dwFlags) { m_dwAskItemTextFlags = dwFlags; } ///////////////////////////////////////////////////////////////////////////// # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(_XTPCALENDARPAINTMANAGER_H__)