Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef MOUSESCROLL_H
  6. #define MOUSESCROLL_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "mathlib/mathlib.h"
  11. #include "mathlib/beziercurve.h"
  12. #include "panel2d.h"
  13. #include "panorama/controls/label.h"
  14. #include "panorama/controls/mousescroll.h"
  15. #include "panorama/uischeduleddel.h"
  16. namespace panorama
  17. {
  18. DECLARE_PANEL_EVENT1( MouseScroll, int );
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Panel which is the clickable mouse region to scroll a carousel or other horizontal list type panel
  21. //-----------------------------------------------------------------------------
  22. class CMouseScrollRegion : public CPanel2D
  23. {
  24. DECLARE_PANEL2D( CMouseScrollRegion, CPanel2D );
  25. public:
  26. CMouseScrollRegion( CPanel2D *parent, const char * pchPanelID );
  27. virtual ~CMouseScrollRegion();
  28. virtual bool OnMouseButtonDown( const MouseData_t &code );
  29. virtual bool OnMouseButtonDoubleClick( const MouseData_t &code );
  30. virtual bool OnMouseButtonTripleClick( const MouseData_t &code );
  31. virtual bool OnMouseButtonUp( const MouseData_t &code );
  32. private:
  33. void DispatchScrollEvent();
  34. void MouseButtonDown();
  35. CCubicBezierCurve< Vector2D > m_repeatCurve;
  36. panorama::CUIScheduledDel m_scheduledScrollRepeat;
  37. double m_flMouseDownTimestamp;
  38. int m_cMouseDownRepeats;
  39. };
  40. } // namespace panorama
  41. #endif // MOUSESCROLL_H