/** * @file XTPChartDiagramView.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(__XTPCHARTDIAGRAMVIEW_H__) # define __XTPCHARTDIAGRAMVIEW_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; class CXTPChartElementView; class CXTPChartDiagramView; class CXTPChartSeries; class CXTPChartPanel; class CXTPChartDiagram; class CXTPChartDeviceContext; class CXTPChartDeviceCommand; class CXTPChart3dDiagram; /** * @brief * This class represents the view of a chart diagram, which is a kind of * CXTPChartElementView. */ class _XTP_EXT_CLASS CXTPChartDiagramView : public CXTPChartElementView { DECLARE_DYNAMIC(CXTPChartDiagramView); public: /** * @brief * Constructs a CXTPChartDiagram object. * * @param pDiagram A pointer to the chart diagram object. * @param pParentView A pointer to the parent view. */ CXTPChartDiagramView(CXTPChartDiagram* pDiagram, CXTPChartElementView* pParentView); public: /** * @brief * Call this function to get the bounds of the diagram. * * @return * A CRect object containing the bounds of the diagram. */ CRect GetBounds() const; /** * @brief * Call this function to get the diagram object associated with the * view. * * @return * A CXTPChartDiagram pointer. The actual type could be * CXTPChartDiagram2D or CXTPChartDiagram3D. */ CXTPChartDiagram* GetDiagram() const; /** * @brief * Call this function to get the label view object associated with * this diagram view. * * @return * A CXTPChartElementView pointer representing the label view. */ CXTPChartElementView* GetLabelsView() const; /** * @brief * Call this function to get the series view object associated with * this diagram view. * * @return * A CXTPChartElementView pointer representing the series view. */ CXTPChartElementView* GetSeriesView() const; /** * @brief * Call this function to calculate the view of the diagram. * * @param pDC Pointer to the chart device context object. * @param rcBounds The bounding rectangle. * * @details * This is a virtual function, so sub classes can give their type * specific implementation for this function. */ virtual void CalculateView(CXTPChartDeviceContext* pDC, CRect rcBounds); /** * @brief * Updates chart range. * * @param pDC Target device context. */ virtual void UpdateRange(CXTPChartDeviceContext* pDC); /** * @brief * Handles mouse wheel event. * * @param nFlags Indicates whether various virtual keys are down. * @param zDelta Indicates distance rotated. * @param pt Specifies the x- and y-coordinate of the cursor. */ virtual void OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); /** * @brief * Performs view initialization. * * @param pDC Target device context. */ virtual void CreateView(CXTPChartDeviceContext* pDC); protected: virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); protected: CXTPChartDiagram* m_pDiagram; /**< Pointer to the associated diagram object.*/ CRect m_rcBounds; /**< The diagram bounds.*/ CXTPChartElementView* m_pLabelsView; /**< The label view.*/ CXTPChartElementView* m_pSeriesView; /**< The series view.*/ CXTPChartElementView* m_pTitlesView; /**< Titles View.*/ public: HCURSOR m_hcurNormalHand; HCURSOR m_hcurDragHand; }; AFX_INLINE CRect CXTPChartDiagramView::GetBounds() const { return m_rcBounds; } AFX_INLINE CXTPChartDiagram* CXTPChartDiagramView::GetDiagram() const { return m_pDiagram; } AFX_INLINE CXTPChartElementView* CXTPChartDiagramView::GetLabelsView() const { return m_pLabelsView; } AFX_INLINE CXTPChartElementView* CXTPChartDiagramView::GetSeriesView() const { return m_pSeriesView; } /** * @brief * This class represents the view of a chart diagram, which is a kind of * CXTPChartElementView. */ class _XTP_EXT_CLASS CXTPChart3dDiagramView : public CXTPChartDiagramView { DECLARE_DYNAMIC(CXTPChart3dDiagramView); public: /** * @brief * Constructs a CXTPChart3dDiagramView object. * * @param pDiagram A pointer to the chart diagram object. * @param pParentView A pointer to the parent view. */ CXTPChart3dDiagramView(CXTPChartDiagram* pDiagram, CXTPChartElementView* pParentView); public: /** * @brief * Creates a view device command. * * @param pDC Device context pointer for which a command is to be created. * * @return * A new view device command. A caller is responsible for deleting * the command object. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); /** @cond */ public: virtual void OnMouseMove(UINT nFlags, CPoint point); virtual void OnLButtonDown(UINT nFlags, CPoint point); virtual void OnLButtonUp(UINT nFlags, CPoint point); virtual void OnMouseWheel(UINT nFlags, short zDelta, CPoint point); virtual BOOL OnSetCursor(CPoint point); /** @endcond */ private: CXTPChart3dDiagram* m_p3dDiagram; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTDIAGRAMVIEW_H__) /** @endcond */