/** * @file XTPScrollInfo.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(__XTPSCROLLINFO_H__) # define __XTPSCROLLINFO_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" # define XTP_TID_HOVERUP 5001 # define XTP_TID_HOVERDOWN 5002 class _XTP_EXT_CLASS XTP_SCROLLINFO { public: class XTP_BTNSCROLL { public: void Init(CWnd* pParent, UINT nID) { m_pParent = pParent; m_nID = nID; m_rc.SetRectEmpty(); m_nTimer = 0; } UINT m_nID; UINT m_nTimer; CRect m_rc; CWnd* m_pParent; void KillTimer() { if (0 != m_nTimer) { m_pParent->KillTimer(m_nTimer); m_nTimer = 0; } } void SetTimer() { if (m_nTimer == 0) { m_nTimer = (UINT)m_pParent->SetTimer(m_nID, 200, 0); } } BOOL OnMouseMove(CPoint point) { if (m_rc.PtInRect(point)) { SetTimer(); return TRUE; } else if (m_nTimer) { KillTimer(); } return FALSE; } }; BOOL bScroll; int nScrollFirst, nScrollLast; XTP_BTNSCROLL btnUp; XTP_BTNSCROLL btnDown; void Init(CWnd* pWnd, UINT nIDUp, UINT nIDDown) { btnUp.Init(pWnd, nIDUp); btnDown.Init(pWnd, nIDDown); bScroll = nScrollFirst = nScrollLast = 0; } }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // #if !defined(__XTPSCROLLINFO_H__) /** @endcond */