/** * @file XTPChartTextDeviceCommand.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(__XTPCHARTTEXTDEVICECOMMAND_H__) # define __XTPCHARTTEXTDEVICECOMMAND_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupUIElement; /** * @brief * This class represents a text device command, which is a kind of CXTPChartDeviceCommand. * It specifically handles the rendering of texts in a chart. */ class _XTP_EXT_CLASS CXTPChartTextDeviceCommand : public CXTPChartDeviceCommand { protected: /** * @brief * Constructs a CXTPChartTextDeviceCommand object. * * @param strText The text to be rendered. * @param pFont The font used to render. * @param color The color of the text. */ CXTPChartTextDeviceCommand(const CXTPChartString& strText, CXTPChartFont* pFont, const CXTPChartColor& color); /** * @brief * This is a virtual function override of base class CXTPChartDeviceContext. This * function acts polymorphically to do the actual drawing of the chart element * to which this device command is associated with. * * @param pDC The device context of the chart. */ virtual void ExecuteOverride(CXTPChartDeviceContext* pDC); /** * @brief * This function does the actual drawing of the chart element to which * this device command is associated with. Here it renders the text. * * @param pDC The device context of the chart. */ virtual void ExecuteInternal(CXTPChartDeviceContext* pDC); protected: CXTPChartString m_strText; /**< The string to be rendered.*/ CXTPChartFont* m_pFont; /**< The font used to render the text.*/ CXTPChartColor m_color; /**< The color of the text.*/ }; /** * @brief * This class represents a text device command, which is a kind of CXTPChartDeviceCommand. * This class handles the smoothing of texts in chart by using antialising. */ class _XTP_EXT_CLASS CXTPChartTextAntialiasingDeviceCommand : public CXTPChartDeviceCommand { public: /** * @brief * Constructs a CXTPChartTextAntialiasingDeviceCommand object. * * @param bAntialias A BOOL value. TRUE to enable antialiasing, FALSE to disable antialiasing. * The default value is TRUE. */ CXTPChartTextAntialiasingDeviceCommand(BOOL bAntialias = TRUE); protected: BOOL m_bAntiAlias; /**< TRUE if antialiasing is enabled, FALSE if antialiasing is not used.*/ int m_nOldTextRenderingHint; }; /** * @brief * This class represents a bounded text device command, which is a kind of * CXTPChartDeviceCommand. It handles the rendering of bounded texts in a chart. */ class _XTP_EXT_CLASS CXTPChartBoundedTextDeviceCommand : public CXTPChartTextDeviceCommand { public: /** * @brief * Constructs a CXTPChartBoundedTextDeviceCommand object. * * @param strText The text to be rendered. * @param pFont The font used to render. * @param color The color of the text. * @param rectangle The text bounds. */ CXTPChartBoundedTextDeviceCommand(const CXTPChartString& strText, CXTPChartFont* pFont, const CXTPChartColor& color, const CXTPChartRectF& rectangle); /** * @brief * Performs recursive hit testing of the element at the specified point. * * @param point Point in which an element is to be found. * @param pParent Parent element pointer. * * @return A pointer to the element found at the specified point or NULL * if no element is found. */ virtual CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; protected: CXTPChartRectF m_rect; /**< The bounding rectangle of the text.*/ }; /** * @brief * Implements 2D markup element drawing device command. */ class _XTP_EXT_CLASS CXTPChartMarkupElementDeviceCommand : public CXTPChartDeviceCommand { public: /** * @brief * Constructs a CXTPChartMarkupElementDeviceCommand object. * * @param pMarkupUIElement Markup element pointer to draw. * @param pFont The default font used to render. * @param color The default color of the text. * @param rectangle The text bounds. */ CXTPChartMarkupElementDeviceCommand(CXTPMarkupUIElement* pMarkupUIElement, CXTPChartFont* pFont, const CXTPChartColor& color, const CXTPChartRectF& rectangle); /** * @brief * HAndles object deallocation. */ ~CXTPChartMarkupElementDeviceCommand(); /** * @brief * Performs recursive hit testing of the element at the specified point. * * @param point Point in which an element is to be found. * @param pParent Parent element pointer. * * @return A pointer to the element found at the specified point or NULL * if no element is found. */ CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; protected: CXTPChartRectF m_rect; /**< The bounding rectangle of the text.*/ CXTPMarkupUIElement* m_pMarkupUIElement; /**< Markup element to draw.*/ CXTPChartColor m_color; /**< The default color of the text.*/ CXTPChartFont* m_pFont; /**< The default font of the text.*/ }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTTEXTDEVICECOMMAND_H__) /** @endcond */