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.

54 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef SCROLLABLEEDITABLEPANEL_H
  8. #define SCROLLABLEEDITABLEPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/EditablePanel.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. namespace vgui
  17. {
  18. class ScrollBar;
  19. }
  20. namespace vgui
  21. {
  22. //-----------------------------------------------------------------------------
  23. // An editable panel that has a scrollbar
  24. //-----------------------------------------------------------------------------
  25. class ScrollableEditablePanel : public vgui::EditablePanel
  26. {
  27. DECLARE_CLASS_SIMPLE( ScrollableEditablePanel, vgui::EditablePanel );
  28. public:
  29. ScrollableEditablePanel( vgui::Panel *pParent, vgui::EditablePanel *pChild, const char *pName );
  30. virtual ~ScrollableEditablePanel() {}
  31. virtual void ApplySettings( KeyValues *pInResourceData );
  32. virtual void PerformLayout();
  33. vgui::ScrollBar *GetScrollbar( void ) { return m_pScrollBar; }
  34. MESSAGE_FUNC( OnScrollBarSliderMoved, "ScrollBarSliderMoved" );
  35. virtual void OnMouseWheeled(int delta); // respond to mouse wheel events
  36. private:
  37. vgui::ScrollBar *m_pScrollBar;
  38. vgui::EditablePanel *m_pChild;
  39. };
  40. } // end namespace vgui
  41. #endif // SCROLLABLEEDITABLEPANEL_H