/** * @file XTPTrackPaintManager.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 * */ /** @cond */ #if !defined(__XTPTRACKPAINTMANAGER_H__) # define __XTPTRACKPAINTMANAGER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPTrackBlock; /** * @brief * This class represents a track control paint manager. This class does * painting of various elements of the track control. */ class _XTP_EXT_CLASS CXTPTrackPaintManager : public CXTPGridPaintManager { public: /** * @brief * Creates a CXTPTrackPaintManager object. */ CXTPTrackPaintManager(); /** * @brief * CXTPTrackPaintManager destructor, handles cleanup and deallocation. */ ~CXTPTrackPaintManager(); public: /** * @brief * Initializes all drawings defaults (fonts, colors, etc.). Most of * them are system defaults. */ void RefreshMetrics(); public: /** * @brief * Call this function to draw the track header. * @param pDC Pointer to the device context. * @details * This is a virtual function so derived classes can provide their * specific implementations. */ virtual void DrawTrackHeader(CDC* pDC); /** * @brief * Call this function to draw the markers. * @param pDC Pointer to the device context. * @details * This is a virtual function so derived classes can provide their * specific implementations. */ virtual void DrawMarkers(CDC* pDC); /** * @brief * Call this function to draw the time line. * @param pDC Pointer to the device context. * @details * This is a virtual function so derived classes can provide their * specific implementations. */ virtual void DrawTimeLine(CDC* pDC); /** * @brief * Call this function to format the time and tick marker * relative to a time line position. * @param nPosition Point in the time line. * @param clrTick Tick mark color. * @param nTickLength Tick mark length. * @return * A CString containing the formatted time. * @details * This is a virtual function so derived classes can provide their * specific implementations. */ virtual CString FormatTimeLineTick(int nPosition, COLORREF& clrTick, int& nTickLength); /** * @brief * Call this function to format the time and tick marker * relative to a time line position. * @param nPosition Point in the time line. * @return * A CString containing the formatted time. * @details * This is a virtual function so derived classes can provide their * specific implementations. */ virtual CString FormatTime(int nPosition); virtual int DrawTrackBlock(CDC* pDC, CRect rc, BOOL bSelected, CXTPTrackBlock* pTrackBlock); void SetColumnStyle(XTPGridColumnStyle columnStyle); protected: template const T& SelectDpiSpecific(const T& upToDpi120, const T& upToDpi144, const T& upToDpi192, const T& theLargest) const; public: COLORREF m_clrWorkArea; /**< The color of the work area. */ COLORREF m_clrTrackHeader; /**< The track header color. */ COLORREF m_clrTrackTimeArea; /**< The track time area color. */ COLORREF m_clrTimeHeaderDarkDark; /**< The header deep dark color. */ COLORREF m_clrTimeHeaderDark; /**< The header dark color. */ COLORREF m_clrTimeSliderBackground; /**< The slider background color. */ COLORREF m_clrTimeHeaderDivider; /**< The header divider color. */ COLORREF m_clrScrollBarLight; /**< The scrollbar light color. */ COLORREF m_clrScrollBarDark; /**< The scrollbar dark color. */ COLORREF m_clrSelectedArea; /**< The color of the selected area. */ COLORREF m_clrMarker; /**< The color of the marker. */ COLORREF m_clrTimeLineTick; /**< The color of a time line tick. */ COLORREF m_clrMarkerBorder; /**< The color of a time line marker's border. */ COLORREF m_clrMarkerBack; /**< The color of a time line marker's back. */ COLORREF m_clrTrackMarkerBorder; /**< The color of a track marker's border. */ COLORREF m_clrTrackMarkerText; /**< The color of a track marker's text. */ COLORREF m_clrTrackMarkerTextBack; /**< The color of a track marker's text back. */ COLORREF m_clrTrackMarkerTextBorder; /**< The color of a track marker's text border. */ COLORREF m_clrTimeLinePosition; /**< The color of a marked position on a time line. */ COLORREF m_clrTimeHeaderBorder; /**< The color of a time line header's border. */ COLORREF m_clrScrollBarBorderDark; /**< The scrollbar border dark color. */ COLORREF m_clrScrollBarBorderLight; /**< The scrollbar border light color. */ COLORREF m_clrWorkAreaScrollBarLight; /**< The workarea scrollbar light color. */ COLORREF m_clrWorkAreaScrollBarDark; /**< The workarea scrollbar dark color. */ COLORREF m_clrWorkAreaScrollBarBorder; /**< The workarea scrollbar border color. */ int m_nTimeLineStep; BOOL m_bTimeLineStepAuto; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPTrackPaintManager); # define DECLARE_PROPERTY_UN(theProperty, theType) \ afx_msg theType OleGet##theProperty(); \ afx_msg void OleSet##theProperty(theType); DECLARE_PROPERTY_UN(WorkArea, COLORREF); DECLARE_PROPERTY_UN(TrackHeader, COLORREF); DECLARE_PROPERTY_UN(TrackTimeArea, COLORREF); DECLARE_PROPERTY_UN(TimeHeaderDarkDark, COLORREF); DECLARE_PROPERTY_UN(TimeHeaderDark, COLORREF); DECLARE_PROPERTY_UN(TimeSliderBackground, COLORREF); DECLARE_PROPERTY_UN(TimeHeaderDivider, COLORREF); DECLARE_PROPERTY_UN(ScrollBarLight, COLORREF); DECLARE_PROPERTY_UN(ScrollBarDark, COLORREF); DECLARE_PROPERTY_UN(Marker, COLORREF); DECLARE_PROPERTY_UN(SelectedArea, COLORREF); void OleSetTimeLineStep(int nStep); int OleGetTimeLineStep(); BOOL m_bCustomTimeLineLabel; void OleSetColumnStyle(); /** @endcond */ # endif }; template const T& CXTPTrackPaintManager::SelectDpiSpecific(const T& upToDpi120, const T& upToDpi144, const T& upToDpi192, const T& theLargest) const { int dpi = XTPDpiHelper()->GetDPIX(); if (96 <= dpi && dpi < 120) return upToDpi120; else if (120 <= dpi && dpi < 144) return upToDpi144; else if (144 <= dpi && dpi < 192) return upToDpi192; return theLargest; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPTRACKPAINTMANAGER_H__) /** @endcond */