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.

63 lines
1.7 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef EDGE_SCROLLER_H
  6. #define EDGE_SCROLLER_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "panorama/controls/panel2d.h"
  11. namespace panorama
  12. {
  13. class CEdgeScrollBar;
  14. class CUIEdgeScrollBar;
  15. class CButton;
  16. //-----------------------------------------------------------------------------
  17. // Purpose: Control that shows buttons on the edges to scroll rather than a normal scroll bar
  18. //-----------------------------------------------------------------------------
  19. class CEdgeScroller : public CPanel2D
  20. {
  21. DECLARE_PANEL2D( CEdgeScroller, CPanel2D );
  22. public:
  23. CEdgeScroller( CPanel2D *pParent, const char *pchID );
  24. virtual ~CEdgeScroller();
  25. // Callback to client panel to create a scrollbar
  26. virtual IUIScrollBar *CreateNewVerticalScrollBar( float flInitialScrollPos ) OVERRIDE;
  27. virtual IUIScrollBar *CreateNewHorizontalScrollBar( float flInitialScrollPos ) OVERRIDE;
  28. };
  29. //-----------------------------------------------------------------------------
  30. // Purpose: Scrollbar that just shows buttons on the edges of the panel rather than an actual Scrollbar
  31. //-----------------------------------------------------------------------------
  32. class CEdgeScrollBar : public CBaseScrollBar
  33. {
  34. DECLARE_PANEL2D( CEdgeScrollBar, CBaseScrollBar );
  35. public:
  36. CEdgeScrollBar( CPanel2D *pParent, const char *pchID, bool bHorizontal );
  37. virtual ~CEdgeScrollBar();
  38. protected:
  39. virtual void UpdateLayout( bool bImmediateMove ) OVERRIDE;
  40. private:
  41. bool m_bHorizontal;
  42. CButton *m_pMinButton;
  43. CButton *m_pMaxButton;
  44. };
  45. } // namespace panorama
  46. #endif // EDGE_SCROLLER_H