/** * @file XTPChartRangeBarSeriesLabel.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(__XTPCHARTRANGEBARSERIESLABEL_H__) # define __XTPCHARTRANGEBARSERIESLABEL_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; /** * @brief * Specifies range bar chart label position */ enum XTPChartRangeBarLabelPosition { xtpChartRangeBarLabelOutside, /**< A label is located outside a range bar */ xtpChartRangeBarLabelInside, /**< A label is located inside a range bar */ }; /** * @brief * Specifies range bar chart label type */ enum XTPChartRangeBarLabelType { xtpChartRangeBarOneLabel, /**< Defines a label that contains both range values */ xtpChartRangeBarTwoLabels, /**< Defines a two labels for each range value */ xtpChartRangeBarMinValueLabel, /**< Defines a label with a minimum range value */ xtpChartRangeBarMaxValueLabel /**< Defines a label with a maximum range value */ }; /** * @brief * This class abstracts the label of a bar series. It is a kind of point * series label. */ class _XTP_EXT_CLASS CXTPChartRangeBarSeriesLabel : public CXTPChartDiagram2DSeriesLabel { DECLARE_SERIAL(CXTPChartRangeBarSeriesLabel); public: /** * @brief * Constructs a CXTPChartRangeBarSeriesLabel object. */ CXTPChartRangeBarSeriesLabel(); /** * @brief * Destroys a CXTPChartRangeBarSeriesLabel object, handles cleanup. */ virtual ~CXTPChartRangeBarSeriesLabel(); public: void SetPosition(XTPChartRangeBarLabelPosition nPosition); XTPChartRangeBarLabelPosition GetPosition() const; void SetType(XTPChartRangeBarLabelType nType); XTPChartRangeBarLabelType GetType() const; public: /** * @brief * This function create the view of the bar series label. * * @param pDC The device context. * @param pPointView A pointer to the series point view object. * @param pParentView Parent view pointer. * * @return * Returns a pointer to the associated label view object. */ virtual CXTPChartElementView* CreateView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); void DoPropExchange(CXTPPropExchange* pPX); protected: XTPChartRangeBarLabelPosition m_nPosition; XTPChartRangeBarLabelType m_nType; int m_nIndent; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartRangeBarSeriesLabel); /** @endcond */ # endif }; /** * @brief * This class abstracts the view of the label of a bar series. It is a kind of point * series label view. */ class _XTP_EXT_CLASS CXTPChartRangeBarSeriesLabelView : public CXTPChartDiagram2DSeriesLabelView { public: /** * @brief * Constructs a CXTPChartRangeBarSeriesLabel object. * * @param pLabel Pointer to the chart series label. * @param pPointView Pointer to the chart series point view. * @param pParentView Parent view pointer. */ CXTPChartRangeBarSeriesLabelView(CXTPChartSeriesLabel* pLabel, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); /** * @brief * This function calculates the anchor point of the label stem. * * @return * A CXTPChartPointF object denoting the anchor point. */ using CXTPChartDiagram2DSeriesLabelView::GetAnchorPoint; virtual CXTPChartPointF GetAnchorPoint(BOOL bMinValue) const; using CXTPChartDiagram2DSeriesLabelView::GetAnchorAngle; virtual double GetAnchorAngle(BOOL bMinValue) const; protected: using CXTPChartDiagram2DSeriesLabelView::CreateDeviceCommand; virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); void CalculateLayout(CXTPChartDeviceContext* pDC); }; AFX_INLINE void CXTPChartRangeBarSeriesLabel::SetPosition(XTPChartRangeBarLabelPosition nPosition) { m_nPosition = nPosition; OnChartChanged(); } AFX_INLINE XTPChartRangeBarLabelPosition CXTPChartRangeBarSeriesLabel::GetPosition() const { return m_nPosition; } AFX_INLINE void CXTPChartRangeBarSeriesLabel::SetType(XTPChartRangeBarLabelType nType) { m_nType = nType; OnChartChanged(); } AFX_INLINE XTPChartRangeBarLabelType CXTPChartRangeBarSeriesLabel::GetType() const { return m_nType; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTRANGEBARSERIESLABEL_H__) /** @endcond */