/** * @file XTPMarkupScrollBar.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(__XTPMARKUPSCROLLBAR_H__) # define __XTPMARKUPSCROLLBAR_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** @cond */ struct XTP_SCROLLBAR_POSINFO; struct XTP_SCROLLBAR_TRACKINFO; /** @endcond */ class CXTPMarkupMouseEventArgs; class CXTPMarkupDrawingContext; class CXTPMarkupMouseButtonEventArgs; class _XTP_EXT_CLASS CXTPMarkupScrollBar : public CXTPMarkupControl { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupScrollBar); /** @endcond */ protected: CXTPMarkupScrollBar(); public: void SetOrientation(XTPMarkupOrientation orientation); void SetScrollInfo(SCROLLINFO* pScrollInfo); void GetScrollInfo(SCROLLINFO* pScrollInfo); protected: CSize MeasureOverride(CXTPMarkupDrawingContext* pDC, CSize szAvailableSize); CSize ArrangeOverride(CSize szFinalSize); void OnRender(CXTPMarkupDrawingContext* pDC); void CalcScrollBarInfo(LPRECT lprc, XTP_SCROLLBAR_POSINFO* pSBInfo, SCROLLINFO* pSI); void OnMouseLeave(CXTPMarkupMouseEventArgs* e); void OnMouseEnter(CXTPMarkupMouseEventArgs* e); void OnMouseMove(CXTPMarkupMouseEventArgs* e); void OnMouseLeftButtonUp(CXTPMarkupMouseButtonEventArgs* e); void OnMouseLeftButtonDown(CXTPMarkupMouseButtonEventArgs* e); BOOL IsEnabled() const; private: void PerformTrackInit(HWND hWnd, CPoint point, XTP_SCROLLBAR_POSINFO* pSBInfo, BOOL bDirect); void CalcTrackDragRect(XTP_SCROLLBAR_TRACKINFO* pSBTrack) const; void DoScroll(int cmd, int pos); int HitTestScrollBar(POINT pt) const; void EndScroll(BOOL fCancel); void RedrawScrollBar(); void MoveThumb(int px); void TrackThumb(UINT message, CPoint pt); void TrackBox(UINT message, CPoint point); void ContScroll(); void ScreenToClient(HWND hWnd, LPPOINT lpPoint); protected: XTPMarkupOrientation m_orientation; XTP_SCROLLBAR_POSINFO m_spi; /**< Scrollbar position. */ XTP_SCROLLBAR_TRACKINFO* m_pSBTrack; /**< Scrollbar tracking */ SCROLLINFO m_si; }; AFX_INLINE void CXTPMarkupScrollBar::SetOrientation(XTPMarkupOrientation orientation) { m_orientation = orientation; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPSCROLLBAR_H__) /** @endcond */