/** * @file XTPChartAxisTitle.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(__XTPCHARTAXISTITLE_H__) # define __XTPCHARTAXISTITLE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartAxis; /** * @brief * This class represents the axis title. This object is a kind of chart element. */ class _XTP_EXT_CLASS CXTPChartAxisTitle : public CXTPChartTextElement { /** @cond */ DECLARE_DYNAMIC(CXTPChartAxisTitle) /** @endcond */ public: /** * @brief * Constructs a CXTPChartAxisTitle object. * * @param pAxis A pointer to the chart axis object to which the title is * associated with. */ CXTPChartAxisTitle(CXTPChartAxis* pAxis); /** * @brief * Destroys a CXTPChartAxisTitle object, handles cleanup. */ virtual ~CXTPChartAxisTitle(); public: /** * @brief * This function returns a pointer to the CXTPChartAxis object associated with * the axis title object. * * @return Returns a pointer to the associated chart axis object. */ CXTPChartAxis* GetAxis() const; /** * @brief * Call this function to set the axis title text. * * @param lpszTitle A string representing the axis title text. */ void SetText(LPCTSTR lpszTitle); /** * @brief * Call this function to get the axis title text. * * @return Returns a string representing the axis title text. Its type is CXTPChartString. */ CXTPChartString GetText() const; /** * @brief * Call this function to set the axis title text color. * * @param clrTextColor Text color value. */ void SetTextColor(const CXTPChartColor& clrTextColor); /** * @brief * Call this function to get the apparent axis title text color. * * @return Returns a CXTPChartColor object denoting the apparent text color in ARGB. */ CXTPChartColor GetTextColor() const; /** * @brief * Call this function to get the actual text color of the axis title. * * @return Returns a CXTPChartColor object denoting the actual text color in ARGB. */ CXTPChartColor GetActualTextColor() const; /** * @brief * Call this function to get the font of the axis title. * * @return A pointer to a CXTPChartFont object denoting the font used. */ CXTPChartFont* GetFont() const; /** * @brief * Call this function to set the font of the title. * * @param pFont A pointer to a chart font object. */ void SetFont(CXTPChartFont* pFont); /** * @brief * Call this function to set the alignment of the title. * * @param nAlignment An enumerated value representing the title alignment. * * @details * The normal alignments are near, far and center. */ void SetAlignment(XTPChartStringAlignment nAlignment); /** * @brief * Call this function to get the alignment of the axis title. * * @return An enumerated value representing the title alignment. * * @details * The normal alignments are near, far and center. */ XTPChartStringAlignment GetAlignment() const; /** * @brief * Call this function to check the visibility of the axis title. * * @return A BOOL value. TRUE if the axis title is visible, FALSE otherwise. */ BOOL IsVisible() const; /** * @brief * Call this function to set the visibility of the axis title. * * @param bVisible A BOOL value. TRUE to set the axis title to visible, * FALSE to hide the axis title. */ void SetVisible(BOOL bVisible); /** * @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; public: void DoPropExchange(CXTPPropExchange* pPX); # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartAxisTitle); BSTR OleGetText(); void OleSetText(LPCTSTR lpszText); LPDISPATCH OleGetFont(); /** @endcond */ # endif protected: CXTPChartString m_strText; /**< The axis title value.*/ CXTPChartColor m_clrTextColor; /**< The text color.*/ BOOL m_bVisible; /**< TRUE if the axis title is visible and FALSE if invisible.*/ CXTPChartFont* m_pFont; /**< Pointer to the associated font object.*/ BOOL m_bAntialiasing; /**< TRUE if the antialiasing ON and FALSE if antialiasing OFF.*/ XTPChartStringAlignment m_nAlignment; /**< The axis title alignment.*/ }; AFX_INLINE CXTPChartAxis* CXTPChartAxisTitle::GetAxis() const { return (CXTPChartAxis*)m_pOwner; } AFX_INLINE CXTPChartString CXTPChartAxisTitle::GetText() const { return m_strText; } AFX_INLINE CXTPChartFont* CXTPChartAxisTitle::GetFont() const { return m_pFont; } AFX_INLINE XTPChartStringAlignment CXTPChartAxisTitle::GetAlignment() const { return m_nAlignment; } AFX_INLINE BOOL CXTPChartAxisTitle::IsVisible() const { return m_bVisible; } AFX_INLINE void CXTPChartAxisTitle::SetAntialiasing(BOOL bAntialiasing) { m_bAntialiasing = bAntialiasing; OnChartChanged(); } AFX_INLINE BOOL CXTPChartAxisTitle::GetAntialiasing() const { return m_bAntialiasing; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTAXISTITLE_H__) /** @endcond */