/** * @file XTPMarkupBorder.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(__XTPMARKUPBORDER_H__) # define __XTPMARKUPBORDER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupBrush; class CXTPMarkupBuilder; /** * @brief * CXTPMarkupBorder is a CXTPMarkupDecorator derived class. * It implements the Border XAML Tag. */ class _XTP_EXT_CLASS CXTPMarkupBorder : public CXTPMarkupDecorator { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupBorder); /** @endcond */ protected: /** * @brief * Constructs a CXTPMarkupBorder object. */ CXTPMarkupBorder(); /** * @brief * Destroys a CXTPMarkupBorder object, handles cleanup and deallocation. */ virtual ~CXTPMarkupBorder(); public: /** * @brief * Sets a value that indicates the thickness of the padding space * between the boundaries of the content area and the content * displayed by a border. * @param nLeft Left space. * @param nTop Top space. * @param nRight Right space. * @param nBottom Bottom space. */ void SetPadding(int nLeft, int nTop, int nRight, int nBottom); /** * @brief * Sets a value that indicates the thickness of the padding space * between the boundaries of the content area and the content * displayed by a border. * @param nPadding All borders. */ void SetPadding(int nPadding); /** * @brief * Retrieves a value that indicates the thickness of the padding space * between the boundaries of the content area and the content * displayed by a border. * @return * A pointer to a CXTPMarkupThickness object that indicates the thickness * of the padding space between the boundaries of the content area * and the content displayed by a border. * @see * SetPadding */ CXTPMarkupThickness* GetPadding() const; /** * @brief * Sets the thickness of the border. * @param nLeft Left border width. * @param nTop Top border width. * @param nRight Right border width. * @param nBottom Bottom border width. */ void SetBorderThickness(int nLeft, int nTop, int nRight, int nBottom); /** * @brief * Sets the thickness of the border. * @param nBorderThickness Thickness for all borders. */ void SetBorderThickness(int nBorderThickness); /** * @brief * Gets the thickness of the border. * @return * A pointer to a CXTPMarkupThickness object containing border widths. * @see * SetBorderThickness */ CXTPMarkupThickness* GetBorderThickness() const; /** * @brief * Sets the background brush for the border object. * @param pBrush Pointer to a CBrush object. */ void SetBackground(CXTPMarkupBrush* pBrush); /** * @brief * Gets the background brush of the border object. * @return * A pointer to the background brush of the border object. */ CXTPMarkupBrush* GetBackground() const; /** * @brief * Sets the border brush for the border object. * @param pBrush Pointer to a CBrush object. */ void SetBorderBrush(CXTPMarkupBrush* pBrush); /** * @brief * Gets the border brush of the border object. * @return * A pointer to the border brush of the border object. */ CXTPMarkupBrush* GetBorderBrush() const; /** * @brief * Sets the corner radius for the border. * * @param nCornerRadius New corner radius for the border. */ void SetCornerRadius(int nCornerRadius); /** * @brief * Gets the corner radius of the border. * @return * A pointer to a CXTPMarkupThickness object containing the corner * radius of the border. * @see * SetCornerRadius */ CXTPMarkupThickness* GetCornerRadius() const; /** * @brief * Gets the total horizontal and vertical size of the padding, * border, and margin. * @return * A CSize object containing the total horizontal and vertical * size of the padding, border, and margin. */ CSize GetSize() const; protected: /** @cond */ // Implementation virtual CSize MeasureOverride(CXTPMarkupDrawingContext* pDC, CSize szAvailableSize); virtual CSize ArrangeOverride(CSize szFinalSize); virtual void OnRender(CXTPMarkupDrawingContext* drawingContext); virtual CXTPMarkupInputElement* InputHitTestOverride(CPoint point) const; public: static CXTPMarkupDependencyProperty* m_pBackgroundProperty; static CXTPMarkupDependencyProperty* m_pBorderThicknessProperty; static CXTPMarkupDependencyProperty* m_pPaddingProperty; static CXTPMarkupDependencyProperty* m_pBorderBrushProperty; static CXTPMarkupDependencyProperty* m_pCornerRadiusProperty; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupBorder); # endif afx_msg LPDISPATCH OleGetBackground(); afx_msg void OleSetBackground(LPDISPATCH lpBackground); afx_msg LPDISPATCH OleGetBorderBrush(); afx_msg void OleSetBorderBrush(LPDISPATCH lpBackground); afx_msg LPDISPATCH OleGetBorderThickness(); afx_msg void OleSetBorderThickness(LPDISPATCH lpThickness); afx_msg LPDISPATCH OleGetPadding(); afx_msg void OleSetPadding(LPDISPATCH lpThickness); afx_msg LPDISPATCH OleGetCornerRadius(); afx_msg void OleSetCornerRadius(LPDISPATCH lpThickness); afx_msg LPDISPATCH OleGetChild(); afx_msg void OleSetChild(LPDISPATCH lpDisp); /** @endcond */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPBORDER_H__) /** @endcond */