/** * @file XTPChartAxisLabel.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(__XTPCHARTAXISLABEL_H__) # define __XTPCHARTAXISLABEL_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartAxis; class CXTPChartNumberFormat; /** * @brief * CXTPChartAxisLabel is a kind of CXTPChartTextElement. * This class represents the text label on an axis. * * @details * This class is associated with a chart axis class. */ class _XTP_EXT_CLASS CXTPChartAxisLabel : public CXTPChartTextElement { /** @cond */ DECLARE_DYNAMIC(CXTPChartAxisLabel) /** @endcond */ public: /** * @brief * Constructs a CXTPChartAxisLabel object. * * @param pAxis Pointer to the associated chart axis object. */ CXTPChartAxisLabel(CXTPChartAxis* pAxis); /** * @brief * Destroys a CXTPChartAxisLabel object, handles cleanup. */ virtual ~CXTPChartAxisLabel(); public: /** * @brief * Call this function to set the text color of the axis label. * * @param clrTextColor A reference to a chart color object representing an ARGB value. */ void SetTextColor(const CXTPChartColor& clrTextColor); /** * @brief * Call this function to get the apparent text color of the axis label. * * @return A chart color object representing an ARGB value. */ CXTPChartColor GetTextColor() const; /** * @brief * Call this function to get the real text color of the axis label. * * @return A chart color object representing an ARGB value. */ CXTPChartColor GetActualTextColor() const; /** * @brief * Call this function to set the font of the axis label text. * * @param pFont The pointer to a chart font object. */ void SetFont(CXTPChartFont* pFont); /** * @brief * Call this function to get the font of the axis label. * * @return A pointer to the chart font object. */ CXTPChartFont* GetFont() const; /** * @brief * Call this function to get the angle of the text label. * * @return An integer value representing the angle. */ int GetAngle() const; /** * @brief * Call this function to set the angle of the text label. * * @param nAgle An integer value representing the angle. */ void SetAngle(int nAgle); /** * @brief * Call this function to set anti-aliasing ON or OFF. Anti-aliasing is * the smoothing of sharp edges of text and drawing. * * @param bAntialiasing A BOOL value. TRUE to set anti-aliasing to ON, * FALSE to set anti-aliasing to OFF. */ void SetAntialiasing(BOOL bAntialiasing); /** * @brief * Call this function to check if anti-aliasing is ON or OFF. Anti-aliasing is * the smoothing of sharp edges of text and drawing. * * @return A BOOL value. TRUE if anti-aliasing is ON, FALSE if anti-aliasing is OFF. */ BOOL GetAntialiasing() const; /** * @brief * Call this function to set the visibility of the text label. * * @param bVisible A BOOL value. TRUE to set the text label to visible, * FALSE to hide the text label. */ void SetVisible(BOOL bVisible); /** * @brief * Call this function to check the visibility of the text label. * * @return A BOOL value. TRUE if the text label is visible, FALSE otherwise. */ BOOL IsVisible() const; /** * @brief * Call this function to get a pointer to CXTPChartNumberFormat which * specifies how to convert a number to a string. * * @return Pointer to a CXTPChartNumberFormat class. * * @see CXTPChartNumberFormat */ CXTPChartNumberFormat* GetFormat() const; /** * @brief * Obsolete method. Use GetFormat()->SetPattern(lpszFormat) instead. * * @param lpszFormat New pattern to be set. * * @see CXTPChartNumberFormat */ void SetFormat(LPCTSTR lpszFormat); public: /** * @brief * Use this function to get the pointer to the axis object to which the * label is associated. * * @return A pointer to the axis object. */ CXTPChartAxis* GetAxis() const; public: void DoPropExchange(CXTPPropExchange* pPX); # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartAxisLabel); afx_msg LPDISPATCH OleGetFont(); afx_msg OLE_COLOR OleGetTextColor(); afx_msg void OleSetTextColor(OLE_COLOR clr); afx_msg LPDISPATCH OleGetFormat(); /** @endcond */ # endif protected: CXTPChartColor m_clrTextColor; /**< The text color.*/ CXTPChartFont* m_pFont; /**< The font used to render the text.*/ BOOL m_bVisible; /**< TRUE if the label is visible, FALSE if not.*/ BOOL m_bAntialiasing; /**< TRUE if antialiasing enabled, FALSE if not.*/ int m_nAngle; /**< The angle of the label.*/ CXTPChartNumberFormat* m_pFormat; }; AFX_INLINE CXTPChartAxis* CXTPChartAxisLabel::GetAxis() const { return (CXTPChartAxis*)m_pOwner; } AFX_INLINE CXTPChartFont* CXTPChartAxisLabel::GetFont() const { return m_pFont; } AFX_INLINE int CXTPChartAxisLabel::GetAngle() const { return m_nAngle; } AFX_INLINE void CXTPChartAxisLabel::SetAngle(int nAgle) { m_nAngle = nAgle; OnChartChanged(); } AFX_INLINE void CXTPChartAxisLabel::SetAntialiasing(BOOL bAntialiasing) { m_bAntialiasing = bAntialiasing; OnChartChanged(); } AFX_INLINE BOOL CXTPChartAxisLabel::GetAntialiasing() const { return m_bAntialiasing; } AFX_INLINE BOOL CXTPChartAxisLabel::IsVisible() const { return m_bVisible; } AFX_INLINE void CXTPChartAxisLabel::SetVisible(BOOL bVisible) { m_bVisible = bVisible; OnChartChanged(); } AFX_INLINE CXTPChartNumberFormat* CXTPChartAxisLabel::GetFormat() const { return m_pFormat; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTAXISLABEL_H__) /** @endcond */