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.

81 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "tf_mouseforwardingpanel.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include <tier0/memdbgon.h>
  10. //=============================================================================//
  11. DECLARE_BUILD_FACTORY( CMouseMessageForwardingPanel );
  12. CMouseMessageForwardingPanel::CMouseMessageForwardingPanel( Panel *parent, const char *name ) : BaseClass( parent, name )
  13. {
  14. // don't draw an
  15. SetPaintEnabled(false);
  16. SetPaintBackgroundEnabled(false);
  17. SetPaintBorderEnabled(false);
  18. }
  19. void CMouseMessageForwardingPanel::PerformLayout()
  20. {
  21. // fill out the whole area
  22. int w, t;
  23. GetParent()->GetSize(w, t);
  24. SetBounds(0, 0, w, t);
  25. }
  26. void CMouseMessageForwardingPanel::OnCursorEntered()
  27. {
  28. if ( GetParent() )
  29. {
  30. GetParent()->OnCursorEntered();
  31. }
  32. }
  33. void CMouseMessageForwardingPanel::OnCursorExited()
  34. {
  35. if ( GetParent() )
  36. {
  37. GetParent()->OnCursorExited();
  38. }
  39. }
  40. void CMouseMessageForwardingPanel::OnMousePressed( vgui::MouseCode code )
  41. {
  42. if ( GetParent() )
  43. {
  44. GetParent()->OnMousePressed( code );
  45. }
  46. }
  47. void CMouseMessageForwardingPanel::OnMouseReleased( vgui::MouseCode code )
  48. {
  49. if ( GetParent() )
  50. {
  51. GetParent()->OnMouseReleased( code );
  52. }
  53. }
  54. void CMouseMessageForwardingPanel::OnMouseDoublePressed( vgui::MouseCode code )
  55. {
  56. if ( GetParent() )
  57. {
  58. GetParent()->OnMouseDoublePressed( code );
  59. }
  60. }
  61. void CMouseMessageForwardingPanel::OnMouseWheeled(int delta)
  62. {
  63. if ( GetParent() )
  64. {
  65. GetParent()->OnMouseWheeled( delta );
  66. }
  67. }