/** * @file XTPControlScrollBar.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(__XTPCONTROLSCROLLBAR_H__) # define __XTPCONTROLSCROLLBAR_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPControlScrollBar; /** * @brief * CXTPControlScrollBar is a CXTPControl derived class. * It represents a scrollbar control. */ class _XTP_EXT_CLASS CXTPControlScrollBar : public CXTPControl , public CXTPScrollBase { /** @cond */ DECLARE_XTP_CONTROL(CXTPControlScrollBar) /** @endcond */ public: /** * @brief * Constructs a CXTPControlScrollBar object. */ CXTPControlScrollBar(); /** * @brief * Destroys a CXTPControlScrollBar object, handles cleanup and deallocation. */ virtual ~CXTPControlScrollBar(); public: /** * @brief * Call this member function to set the current position of the scrollbar. * @param nPos New position of the scrollbar control. * @see * GetPos, SetRange */ void SetPos(int nPos); /** * @brief * Call this member function to get the current position of the scrollbar. * @return * The position of the scrollbar control. * @see * SetPos */ int GetPos() const; /** * @brief * Sets the upper and lower limits of the scrollbar control's range * @param nMin Specifies the lower limit of the range. * @param nMax Specifies the upper limit of the range. * @see * SetPos */ void SetRange(int nMin, int nMax); protected: /** * @brief * This method is called when the position of the scrollbar is changed. * @param nSBCode Specifies a scrollbar code that indicates the user's scrolling request. * @param nPos Contains the current scroll-box position. */ virtual void OnScroll(UINT nSBCode, UINT nPos); protected: /** @cond */ CSize GetSize(CDC* pDC); BOOL HasFocus() const; void Draw(CDC* pDC); void OnCalcDynamicSize(DWORD dwMode); void OnClick(BOOL bKeyboard = FALSE, CPoint pt = CPoint(0, 0)); virtual int GetCustomizeMinWidth() const; virtual BOOL IsCustomizeResizeAllow() const; void Copy(CXTPControl* pControl, BOOL bRecursive = FALSE); void DoPropExchange(CXTPPropExchange* pPX); void OnMouseMove(CPoint point); /** @endcond */ protected: /** @cond */ virtual CRect GetScrollBarRect(); virtual void GetScrollInfo(SCROLLINFO* psi); virtual void DoScroll(int cmd, int pos); virtual void RedrawScrollBar(); virtual CXTPScrollBarPaintManager* GetScrollBarPaintManager() const; virtual BOOL IsScrollBarEnabled() const; virtual CWnd* GetParentWindow() const; /** @endcond */ protected: int m_nMin; /**< Lower range. */ int m_nMax; /**< Upper range. */ int m_nPos; /**< Current position of scrollbar. */ int m_nPage; /**< Current page of the scrollbar. */ BOOL m_bInScroll; # ifdef _XTP_COMMANDBARS_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPControlSlider); void OleRangeChanged(); /** @endcond */ # endif friend class CXTPControlScrollBarCtrl; }; /** @cond */ AFX_INLINE BOOL CXTPControlScrollBar::IsCustomizeResizeAllow() const { return TRUE; } AFX_INLINE int CXTPControlScrollBar::GetCustomizeMinWidth() const { return 20; } /** @endcond */ /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCONTROLSCROLLBAR_H__) /** @endcond */