/** * @file XTPChartFillStyle.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(__XTPCHARTFILLSTYLE_H__) # define __XTPCHARTFILLSTYLE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartElement; class CXTPChartDeviceCommand; class CXTPPropExchange; /** * @brief * This class abstracts a fill style used to fill the background of various * chart elements. */ class _XTP_EXT_CLASS CXTPChartFillStyle : public CXTPCmdTarget { public: /** * @brief * Constructs a CXTPChartFillStyle object. * * @param pOwner The pointer to a chart element which owns this fill style * object. */ CXTPChartFillStyle(CXTPChartElement* pOwner); public: /** * @brief * Call this function to delete the object. */ void Release(); public: /** * @brief * Call this function to set a filling mode. * * @param nFillMode The enumerated value specifying the fill mode of choice. * * @details * The fill modes used in XTP chart are Empty,Solid,Gradient and Hatch. */ void SetFillMode(XTPChartFillMode nFillMode); /** * @brief * Call this function to get a filling mode. * * @return The enumerated value specifying the current fill mode. * * @details * The fill modes used in XTP chart are Empty,Solid,Gradient and Hatch. */ XTPChartFillMode GetFillMode() const; /** * @brief * Call this function to set the angle for gradient filling. * * @param nAngle The angle of the label stem. * * @details * The common gradient angle are 0, 45, 90, 135, 180, 225, 270, 315. */ void SetGradientAngle(XTPChartGradientAngle nAngle); /** * @brief * Call this function to get the angle for gradient filling. * * @return An enumerated value specifying the current angle of gradient. * * @details * The common gradient angle are 0, 45, 90, 135, 180, 225, 270, 315. */ XTPChartGradientAngle GetGradientAngle() const; /** * @brief * Call this function to set the hatch style used for filling the background * of a particular chart entity. * * @param nStyle The enumerated value specifying the hatch style of choice. */ void SetHatchStyle(XTPChartHatchStyle nStyle); /** * @brief * Call this function to get the hatch style used for filling the background * of a particular chart entity. * * @return An enumerated value specifying the hatch style currently using. */ XTPChartHatchStyle GetHatchStyle() const; public: /** * @brief * This function creates a CXTPChartDeviceCommand object, this object * represents the rendering of an element in the chart. * * @param bounds The rectangular boundary, within the limit the drawing has * to be done. * @param color The first color used in drawing. * @param color2 The second color used in drawing. * * @return Returns CXTPChartDeviceCommand object, this object handles * the rendering of an element in the chart. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(const CXTPChartRectF& bounds, const CXTPChartColor& color, const CXTPChartColor& color2); /** * @brief * This function creates a CXTPChartDeviceCommand object, this object * represents the rendering of an element in the chart. * * @param arrPoints The array of points which form a polygonal element. * @param color The first color used in drawing. * @param color2 The second color used in drawing. * * @return Returns CXTPChartDeviceCommand object, this object handles * the rendering of an element in the chart. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(const CXTPChartPoints& arrPoints, const CXTPChartColor& color, const CXTPChartColor& color2); /** * @brief * This function creates a CXTPChartDeviceCommand object, this object * represents the rendering of an element in the chart. * * @param radius The radius of the circle. * @param center The center point of the circle. * @param color The first color used in drawing. * @param color2 The second color used in drawing. * * @return Returns CXTPChartDeviceCommand object, this object handles * the rendering of an element in the chart. */ virtual CXTPChartDeviceCommand* CreateCircleDeviceCommand(const CXTPChartPointF& center, double radius, const CXTPChartColor& color, const CXTPChartColor& color2); /** * @brief * This function creates a CXTPChartDeviceCommand object for rendering, * of a spline. * * @param arrPoints The array of points which form a spline element. * @param color The first color used in drawing. * @param color2 The second color used in drawing. * @param bTwoSides TRUE for two sides. * * @return * Returns CXTPChartDeviceCommand object, this object handles * the rendering of an element in the chart. */ virtual CXTPChartDeviceCommand* CreateSplineDeviceCommand(const CXTPChartPoints& arrPoints, const CXTPChartColor& color, const CXTPChartColor& color2, BOOL bTwoSides = FALSE); /** * @brief * Call this member function to Store/Load the properties of fill style * object using the specified data object. * * @param pPX Source or destination CXTPPropExchange data object reference. * * @details * This member function is used to store or load property data to or * from a storage. */ void DoPropExchange(CXTPPropExchange* pPX); public: CXTPChartFillStyle* CreateRotatedStyle(); protected: # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartFillStyle); int OleGetFillMode(); int OleGetHatchStyle(); int OleGetGradientAngle(); /** @endcond */ # endif protected: CXTPChartElement* m_pOwner; /**< The owner element.*/ XTPChartFillMode m_nFillMode; /**< The background fill mode.*/ XTPChartGradientAngle m_nGradientAngle; /**< The gradient angle.*/ XTPChartHatchStyle m_nHatchStyle; /**< The hatch style used.*/ }; AFX_INLINE void CXTPChartFillStyle::Release() { InternalRelease(); } AFX_INLINE XTPChartFillMode CXTPChartFillStyle::GetFillMode() const { return m_nFillMode; } AFX_INLINE XTPChartGradientAngle CXTPChartFillStyle::GetGradientAngle() const { return m_nGradientAngle; } AFX_INLINE XTPChartHatchStyle CXTPChartFillStyle::GetHatchStyle() const { return m_nHatchStyle; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTFILLSTYLE_H__) /** @endcond */