/** * @file XTPMarkupScrollViewer.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(__XTPMARKUPSCROLLVIEWER_H__) # define __XTPMARKUPSCROLLVIEWER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupScrollBarGripper; class CXTPMarkupScrollBar; class CXTPMarkupVisual; class CXTPMarkupDrawingContext; class CXTPMarkupMouseWheelEventArgs; class CXTPMarkupDependencyProperty; enum XTPMarkupScrollBarVisibility { xtpMarkupScrollBarDisabled, xtpMarkupScrollBarAuto, xtpMarkupScrollBarVisible }; class _XTP_EXT_CLASS CXTPMarkupScrollBarGripper : public CXTPMarkupUIElement { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupScrollBarGripper) /** @endcond */ public: void OnRender(CXTPMarkupDrawingContext* pDC); }; class _XTP_EXT_CLASS CXTPMarkupScrollViewer : public CXTPMarkupContentControl { DECLARE_MARKUPCLASS(CXTPMarkupScrollViewer); protected: CXTPMarkupScrollViewer(); ~CXTPMarkupScrollViewer(); public: int GetVisualChildrenCount() const; CXTPMarkupVisual* GetVisualChild(int nIndex) const; void Scroll(int nBar, int cmd, int pos); void SetScrollPos(int nBar, int pos); int GetScrollPos(int nBar); int GetScrollLimit(int nBar); XTPMarkupScrollBarVisibility GetVerticalScrollBarVisibility() const; XTPMarkupScrollBarVisibility GetHorizontalScrollBarVisibility() const; protected: CSize ArrangeOverride(CSize szFinalSize); CSize MeasureOverride(CXTPMarkupDrawingContext* pDC, CSize szAvailableSize); void OnMouseWheel(CXTPMarkupMouseWheelEventArgs* e); protected: void CreateScrollBar(int nBar); /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupScrollViewer); # endif afx_msg long OleGetVerticalOffset(); afx_msg long OleGetHorizontalOffset(); afx_msg void OleSetVerticalOffset(int nOffset); afx_msg void OleSetHorizontalOffset(int nOffset); /** @endcond */ protected: CXTPMarkupScrollBar* m_pVerticalScrollBar; CXTPMarkupScrollBar* m_pHorizontalScrollBar; CXTPMarkupScrollBarGripper* m_pScrollBarGripper; int m_xOffset; int m_yOffset; public: static CXTPMarkupDependencyProperty* m_pVerticalScrollBarVisibilityProperty; static CXTPMarkupDependencyProperty* m_pHorizontalScrollBarVisibilityProperty; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPSCROLLVIEWER_H__) /** @endcond */