/** * @file XTPMarkupDefinitionBase.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(__XTPMARKUPDEFINITIONBASE_H__) # define __XTPMARKUPDEFINITIONBASE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupGrid; class CXTPMarkupObject; class CXTPMarkupPropertyChangedEventArgs; class CXTPMarkupGridLength; /** * @brief * CXTPMarkupDefinitionBase is the base class for CXTPMarkupColumnDefinition * and CXTPMarkupRowDefinition that defines constraints and definitions * for grid rows and columns. */ class _XTP_EXT_CLASS CXTPMarkupDefinitionBase : public CXTPMarkupFrameworkContentElement { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupDefinitionBase); /** @endcond */ protected: /** * @brief * Constructs a CXTPMarkupDefinitionBase object. * @param bIsColumnDefinition TRUE for CXTPMarkupColumnDefinition, * FALSE for CXTPMarkupRowDefinition. */ CXTPMarkupDefinitionBase(BOOL bIsColumnDefinition = FALSE); public: /** * @brief * Retrieves the minimum constraint for user-defined column or row size. * @return * The minimum constraint for user-defined column or row size. */ int GetUserMinSize() const; /** * @brief * Retrieves the maximum constraint for user-defined column or row size. * @return * The maximum constraint for user-defined column or row size. */ int GetUserMaxSize() const; /** * @brief * Retrieves the user-defined column or row size. * @return * The user-defined column or row size. */ CXTPMarkupGridLength* GetUserSize() const; /** @cond */ // Implementation private: void OnBeforeLayout(); void UpdateMinSize(int nMinSize); double GetPreferredSize() const; protected: static void AFX_CDECL OnDefinitionPropertyChanged(CXTPMarkupObject* d, CXTPMarkupPropertyChangedEventArgs* /*e*/); protected: BOOL m_bIsColumnDefinition; int m_nMinSize; int m_nSizeType; double m_nMeasureSize; double m_nSizeCache; int m_nFinalOffset; friend class CXTPMarkupGrid; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupDefinitionBase); # endif /** @endcond */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPDEFINITIONBASE_H__) /** @endcond */