/** * @file XTPChartGdiTextDeviceCommand.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(__XTPCHARTGDITEXTDEVICECOMMAND_H__) # define __XTPCHARTGDITEXTDEVICECOMMAND_H__ # 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. * This class handles the smoothing of text in a chart and does so by using antialising. */ class _XTP_EXT_CLASS CXTPChartGdiTextAntialiasingDeviceCommand : public CXTPChartTextAntialiasingDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiTextAntialiasingDeviceCommand object. * * @param bAntialias TRUE to enable antialiasing, FALSE to disable antialiasing. * The default value for bAntialias is TRUE. */ CXTPChartGdiTextAntialiasingDeviceCommand(BOOL bAntialias = TRUE); protected: /** * @brief * This method gets called before a command is executed which allows for * the customization of command behavior. * * @param pDC The chart device context. */ void BeforeExecute(CXTPChartDeviceContext* pDC); /** * @brief * This method gets called after a command is executed which allows for * the customization of command behavior. * * @param pDC The chart device context. */ void AfterExecute(CXTPChartDeviceContext* pDC); }; /** * @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 CXTPChartGdiBoundedTextDeviceCommand : public CXTPChartBoundedTextDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiBoundedTextDeviceCommand 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. */ CXTPChartGdiBoundedTextDeviceCommand(const CXTPChartString& strText, CXTPChartFont* pFont, const CXTPChartColor& color, const CXTPChartRectF& rectangle); protected: /** * @brief * This function does the actual drawing of the chart element to which * this device command is associated with. Here it renders the text inside * a rectangle. * * @param pDC The device context of the chart. */ virtual void ExecuteInternal(CXTPChartDeviceContext* pDC); }; class _XTP_EXT_CLASS CXTPChartGdiMarkupElementDeviceCommand : public CXTPChartMarkupElementDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiMarkupElementDeviceCommand 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. */ CXTPChartGdiMarkupElementDeviceCommand(CXTPMarkupUIElement* pMarkupUIElement, CXTPChartFont* pFont, const CXTPChartColor& color, const CXTPChartRectF& rectangle); public: virtual void ExecuteOverride(CXTPChartDeviceContext* pDC); CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTGDITEXTDEVICECOMMAND_H__) /** @endcond */