/** * @file XTPMarkupStatic.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(__MARKUPSTATIC_H__) # define __MARKUPSTATIC_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" # ifdef _XTP_INCLUDE_MARKUP class CXTPMarkupUIElement; class CXTPMarkupContext; /** * @brief * Represents a STATIC control with the ability to render markup content. */ class _XTP_EXT_CLASS CXTPMarkupStatic : public CStatic { public: /** * @brief * Constructs object instance. */ CXTPMarkupStatic(); /** * @brief * Performs object destruction. */ virtual ~CXTPMarkupStatic(); public: /** * @brief * Sets the Markup content to draw. * @param lpszMarkup Markup content to draw. */ void SetMarkupText(LPCSTR lpszMarkup); /** * @brief * Sets the Markup content to draw. * @param lpszMarkup Markup content to draw. */ void SetMarkupText(LPCWSTR lpszMarkup); /** * @brief * Special version used by the Ribbon Customize dialog and will * handle % to load a string from a resouce. * @param lpszMarkup Markup text. * @param nCodePage Optional code page. Default value is CP_UTF8. Ignored if * the markup charset is the same as the building charset. */ void SetMarkupTextEx(LPCSTR lpszMarkup, UINT nCodePage = CP_UTF8); /** * @brief * Special version used by the Ribbon Customize dialog and will * handle % to load a string from a resouce. * @param lpszMarkup Markup text. * @param nCodePage Optional code page. Default value is CP_UTF8. Ignored if * the markup charset is the same as the building charset. */ void SetMarkupTextEx(LPCWSTR lpszMarkup, UINT nCodePage = CP_UTF8); /** * @brief * Obtains the control's markup context. * @return * A pointer to the control's markup context. */ CXTPMarkupContext* GetMarkupContext() const; /** * @brief * Obtains the UI element of the control. * @return * A pointer to the UI element of the control. */ CXTPMarkupUIElement* GetUIElement() const; void SetIgnoreRTL(BOOL value); protected: DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPMarkupStatic) BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPMarkupStatic) afx_msg void OnPaint(); //}}AFX_MSG CXTPMarkupUIElement* m_pUIElement; CXTPMarkupContext* m_pMarkupContext; BOOL m_bIgnoreRTL; }; ///////////////////////////////////////////////////////////////////////////// /** @cond */ AFX_INLINE CXTPMarkupContext* CXTPMarkupStatic::GetMarkupContext() const { return m_pMarkupContext; } AFX_INLINE CXTPMarkupUIElement* CXTPMarkupStatic::GetUIElement() const { return m_pUIElement; } AFX_INLINE void CXTPMarkupStatic::SetIgnoreRTL(BOOL value) { m_bIgnoreRTL = value; } /** @endcond */ # endif //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__MARKUPSTATIC_H__) /** @endcond */