/** * @file XTPChartMarker.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(__XTPCHARTMARKER_H__) # define __XTPCHARTMARKER_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesStyle; class CXTPChartDeviceCommand; class CXTPChartDeviceContext; class CXTPChartFillStyle; /** * @brief * This enumeration is used for naming the various styles for the point series * point marking. */ enum XTPChartMarkerType { xtpChartMarkerCircle, /**< The circular style.*/ xtpChartMarkerSquare, /**< Specifies square marker shape */ xtpChartMarkerDiamond, /**< Specifies diamond marker shape */ xtpChartMarkerTriangle, /**< Specifies triangle marker shape */ xtpChartMarkerPentagon, /**< Specifies pentagon marker shape */ xtpChartMarkerHexagon, /**< Specifies hexagon marker shape */ xtpChartMarkerStar /**< Specifies star marker shape */ }; /** * @brief * This class abstracts a marker used in marking the points in a point series * style chart. Objects class is a kind of CXTPChartElement. * * @details * XTPChartMarkerType enumeration defines the various marking styles possible * with this marker object. */ class _XTP_EXT_CLASS CXTPChartMarker : public CXTPChartElement { /** @cond */ DECLARE_DYNAMIC(CXTPChartMarker) /** @endcond */ public: /** * @brief * Constructs a CXTPChartMarker object. * * @param pOwner A pointer to the chart series style object which owns this object. */ CXTPChartMarker(CXTPChartSeriesStyle* pOwner); /** * @brief * Destroys a CXTPChartMarker object, handles cleanup. */ virtual ~CXTPChartMarker(); public: int GetSize() const; void SetSize(int nSize); void SetBorderVisible(BOOL bBorderVisible); BOOL GetBorderVisible() const; XTPChartMarkerType GetType() const; void SetType(XTPChartMarkerType nType); CXTPChartFillStyle* GetFillStyle() const; BOOL GetVisible() const; void SetVisible(BOOL bVisible); public: virtual void DoPropExchange(CXTPPropExchange* pPX); public: /** * @brief * This function creates a CXTPChartDeviceCommand object. This object * represents the rendering of a point marker in the point series chart. * * @param pDC Pointer to a CXTPChartDeviceContext object. * @param point The center point of the marker. * @param color The first color of the gradient. * @param color2 The second color of the gradient. * @param colorBorder The border color of the marker. * * @return * Returns a CXTPChartDeviceCommand object. This object handles * the rendering of an element in the chart. Here it handles * the drawing of the marker point. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC, const CXTPChartPointF& point, CXTPChartColor color, CXTPChartColor color2, CXTPChartColor colorBorder); /** * @brief * This function creates a CXTPChartDeviceCommand object. This object * represents the rendering of a point marker in the point series chart. * * @param pDC Pointer to a CXTPChartDeviceContext object. * @param point The center point of the marker. * @param nWidth The width of the marker. * @param color The first color of the marker gradient. * @param color2 The second color of the marker gradient. * @param colorBorder The border color of the marker. * * @return * Returns a CXTPChartDeviceCommand object. This object handles * the rendering of an element in the chart. Here it handles * the drawing of the marker point. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC, const CXTPChartPointF& point, int nWidth, CXTPChartColor color, CXTPChartColor color2, CXTPChartColor colorBorder); protected: # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartMarker); afx_msg LPDISPATCH OleGetFillStyle(); /** @endcond */ # endif protected: BOOL m_bBorderVisible; /**< TRUE if the border is visible, FALSE if the border is invisible.*/ CXTPChartColor m_clrBorderColor; /**< The color of the marker border.*/ CXTPChartColor m_clrColor; /**< The first color of the marker gradient.*/ XTPChartMarkerType m_nType; /**< The Marker Type*/ int m_nSize; /**< The size of the marker.*/ BOOL m_bVisible; /**< TRUE if the marker is visible and FALSE if the marker is invisible.*/ CXTPChartFillStyle* m_pFillStyle; }; AFX_INLINE int CXTPChartMarker::GetSize() const { return m_nSize; } AFX_INLINE void CXTPChartMarker::SetSize(int nSize) { m_nSize = nSize; OnChartChanged(); } AFX_INLINE void CXTPChartMarker::SetBorderVisible(BOOL bBorderVisible) { m_bBorderVisible = bBorderVisible; OnChartChanged(); } AFX_INLINE BOOL CXTPChartMarker::GetBorderVisible() const { return m_bBorderVisible; } AFX_INLINE XTPChartMarkerType CXTPChartMarker::GetType() const { return m_nType; } AFX_INLINE void CXTPChartMarker::SetType(XTPChartMarkerType nType) { m_nType = nType; OnChartChanged(); } AFX_INLINE CXTPChartFillStyle* CXTPChartMarker::GetFillStyle() const { return m_pFillStyle; } AFX_INLINE BOOL CXTPChartMarker::GetVisible() const { return m_bVisible; } AFX_INLINE void CXTPChartMarker::SetVisible(BOOL bVisible) { m_bVisible = bVisible; OnChartChanged(); } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTMARKER_H__) /** @endcond */