/** * @file XTPChartHighLowSeriesStyle.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(__XTPCHARTHIGHLOWSERIESSTYLE_H__) # define __XTPCHARTHIGHLOWSERIESSTYLE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; /** * @brief * This class represents the stock series style in the chart. Objects * of this class are a kind of series style of a chart. * * @details * Stock charts are used primarily to describe price movements of a security * (finance), derivative, or currency over time. */ class _XTP_EXT_CLASS CXTPChartHighLowSeriesStyle : public CXTPChartDiagram2DSeriesStyle { /** @cond */ DECLARE_SERIAL(CXTPChartHighLowSeriesStyle); /** @endcond */ public: /** * @brief * Constructs a CXTPChartHighLowSeriesStyle object. */ CXTPChartHighLowSeriesStyle(); /** * @brief * Destroys a CXTPChartHighLowSeriesStyle object, handles cleanup. */ virtual ~CXTPChartHighLowSeriesStyle(); public: /** * @brief * Call this function to set the line thickness of stock ticks. * * @param nLineThickness The thickness of the tick lines. */ void SetLineThickness(int nLineThickness); /** * @brief * Call this function to get the line thickness of stock ticks. * * @return * An integer value for the thickness of the tick lines currently used. */ int GetLineThickness() const; public: /** * @brief * Call this function to get the user-defined up day color of stock ticks. * * @return * An CXTPChartColor object representing a 32 bit ARGB value. */ CXTPChartColor GetCustomUpColor() const; /** * @brief * Call this function to get the user-defined down day color of stock ticks. * * @return * An CXTPChartColor object representing a 32 bit ARGB value. */ CXTPChartColor GetCustomDownColor() const; /** * @brief * Call this function to get the up day color of stock ticks. * * @return * An CXTPChartColor object representing a 32 bit ARGB value. */ CXTPChartColor GetUpColor() const; /** * @brief * Call this function to get the down day color of stock ticks. * * @return * An CXTPChartColor object representing a 32 bit ARGB value. */ CXTPChartColor GetDownColor() const; protected: /** * @brief * Call this function to create the view of the stock series. * @param pSeries A pointer to the chart series object. * @param pDiagramView Pointer to a chart diagram view object. * @return * A pointer to a CXTPChartHighLowSeriesView object, which is a kind of * CXTPChartSeriesView. */ virtual CXTPChartSeriesView* CreateView(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView); protected: # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartHighLowSeriesStyle); DECLARE_OLECREATE_EX(CXTPChartHighLowSeriesStyle) /** @endcond */ # endif protected: int m_nLineThickness; /**< The stock tick line thickness.*/ CXTPChartColor m_clrDownColor; /**< User-defined down day color.*/ CXTPChartColor m_clrUpColor; /**< User-defined up day color.*/ }; /** * @brief * This class abstracts the view of the stock series of the chart. Objects * of this class are a kind of series view object of a chart. * * @details * Stock charts are used primarily to describe price movements of a security * (finance), derivative, or currency over time. */ class _XTP_EXT_CLASS CXTPChartHighLowSeriesView : public CXTPChartDiagram2DSeriesView { public: /** * @brief * Constructs a CXTPChartHighLowSeriesView object. * * @param pSeries A pointer to a chart series object. * @param pDiagramView A pointer to a chart diagram view object. */ CXTPChartHighLowSeriesView(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView); protected: /** * @brief * Call this function to create a stock series point view object. * * @param pDC A pointer to a chart device context. * @param pPoint A pointer to a chart series point object. * @param pParentView Parent view pointer. * * @return * A pointer to a stock chart series point view object. */ CXTPChartSeriesPointView* CreateSeriesPointView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPoint* pPoint, CXTPChartElementView* pParentView); /** * @brief * This function creates a label view drawing command object. * * @param pDC Pointer to a CXTPChartDeviceContext object. * @param rcBounds The rectangular boundary of the legend. * * @return * Returns a new label view drawing command object. */ virtual CXTPChartDeviceCommand* CreateLegendDeviceCommand(CXTPChartDeviceContext* pDC, CRect rcBounds); }; /** * @brief * This class abstracts the view of the stock series point of the chart. Objects * of this class are a kind of series point view object of a chart. * * @details * Stock charts are used primarily to describe price movements of a security * (finance), derivative, or currency over time. */ class _XTP_EXT_CLASS CXTPChartHighLowSeriesPointView : public CXTPChartSeriesPointView { public: /** * @brief * Constructs a CXTPChartHighLowSeriesPointView object. * * @param pPoint A pointer to chart series point object. * @param pParentView Parent view pointer. */ CXTPChartHighLowSeriesPointView(CXTPChartSeriesPoint* pPoint, CXTPChartElementView* pParentView); public: /** * @brief * This function creates a CXTPChartDeviceCommand object. This object * represents the rendering of a stock chart series point. * * @param pDC Pointer to a CXTPChartDeviceContext object. * * @return * Returns a CXTPChartDeviceCommand object. This object handles * the rendering of an element in the chart. Here it handles * the drawing of the stock chart series point. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); public: /** * @brief * Call this function to get the screen point from a point index. * * @param nIndex A zero-based index of the point in the series. * * @return * A CXTPChartPointF object specifying the coordinates of the point * in the chosen index of the series. */ CXTPChartPointF GetScreenPoint(int nIndex); }; AFX_INLINE int CXTPChartHighLowSeriesStyle::GetLineThickness() const { return m_nLineThickness; } AFX_INLINE void CXTPChartHighLowSeriesStyle::SetLineThickness(int nLineThickness) { m_nLineThickness = nLineThickness; OnChartChanged(); } AFX_INLINE CXTPChartColor CXTPChartHighLowSeriesStyle::GetCustomUpColor() const { return m_clrUpColor; } AFX_INLINE CXTPChartColor CXTPChartHighLowSeriesStyle::GetCustomDownColor() const { return m_clrDownColor; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTHIGHLOWSERIESSTYLE_H__) /** @endcond */