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.

43 lines
1.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VGUI_ROTATION_SLIDER_H
  8. #define VGUI_ROTATION_SLIDER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Slider.h>
  13. #include "c_baseobject.h"
  14. //-----------------------------------------------------------------------------
  15. //
  16. // Slider for object control
  17. //
  18. //-----------------------------------------------------------------------------
  19. class CRotationSlider : public vgui::Slider
  20. {
  21. DECLARE_CLASS_SIMPLE( CRotationSlider, vgui::Slider );
  22. public:
  23. CRotationSlider( vgui::Panel *pParent, const char *pName );
  24. void SetControlledObject( C_BaseObject *pObject );
  25. virtual void OnMousePressed( vgui::MouseCode code );
  26. virtual void OnMouseReleased( vgui::MouseCode code );
  27. MESSAGE_FUNC_INT( OnSliderMoved, "SliderMoved", position );
  28. private:
  29. CHandle<C_BaseObject> m_hObject;
  30. float m_flInitialYaw;
  31. float m_flYaw;
  32. };
  33. #endif // VGUI_ROTATION_SLIDER_H