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.

72 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "BackgroundMenuButton.h"
  8. #include <KeyValues.h>
  9. #include <vgui/IImage.h>
  10. #include <vgui/IScheme.h>
  11. #include <vgui_controls/Menu.h>
  12. #include <vgui_controls/MenuItem.h>
  13. // memdbgon must be the last include file in a .cpp file!!!
  14. #include <tier0/memdbgon.h>
  15. using namespace vgui;
  16. //-----------------------------------------------------------------------------
  17. // Purpose: Constructor
  18. //-----------------------------------------------------------------------------
  19. CBackgroundMenuButton::CBackgroundMenuButton(vgui::Panel *parent, const char *name) : BaseClass(parent, name, "")
  20. {
  21. m_pImage = NULL;
  22. m_pMouseOverImage = NULL;
  23. }
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Destructor
  26. //-----------------------------------------------------------------------------
  27. CBackgroundMenuButton::~CBackgroundMenuButton()
  28. {
  29. }
  30. //-----------------------------------------------------------------------------
  31. // Purpose:
  32. //-----------------------------------------------------------------------------
  33. void CBackgroundMenuButton::OnCommand(const char *command)
  34. {
  35. BaseClass::OnCommand(command);
  36. }
  37. //-----------------------------------------------------------------------------
  38. // Purpose: Makes the button transparent
  39. //-----------------------------------------------------------------------------
  40. void CBackgroundMenuButton::ApplySchemeSettings(IScheme *pScheme)
  41. {
  42. BaseClass::ApplySchemeSettings(pScheme);
  43. // hack some colors in
  44. SetFgColor(Color(255, 255, 255, 255));
  45. SetBgColor(Color(0, 0, 0, 0));
  46. SetDefaultColor(Color(255, 255, 255, 255), Color(0, 0, 0, 0));
  47. SetArmedColor(Color(255, 255, 0, 255), Color(0, 0, 0, 0));
  48. SetDepressedColor(Color(255, 255, 0, 255), Color(0, 0, 0, 0));
  49. SetContentAlignment(Label::a_west);
  50. SetBorder(NULL);
  51. SetDefaultBorder(NULL);
  52. SetDepressedBorder(NULL);
  53. SetKeyFocusBorder(NULL);
  54. SetTextInset(0, 0);
  55. SetAlpha(0);
  56. /*
  57. // sounds disabled for this button (since it's so big now)
  58. SetArmedSound("UI/buttonrollover.wav");
  59. SetDepressedSound("UI/buttonclick.wav");
  60. SetReleasedSound("UI/buttonclickrelease.wav");
  61. */
  62. }