Counter Strike : Global Offensive Source Code
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.

61 lines
1.6 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: A button with no borders that shows a left-pointing or down-pointing triangle
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef EXPANDBUTTON_H
  8. #define EXPANDBUTTON_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui/vgui.h>
  13. #include <vgui_controls/ToggleButton.h>
  14. namespace vgui
  15. {
  16. //-----------------------------------------------------------------------------
  17. // Purpose: A button with no borders that shows a left-pointing or down-pointing arrow
  18. //-----------------------------------------------------------------------------
  19. class ExpandButton : public ToggleButton
  20. {
  21. DECLARE_CLASS_SIMPLE( ExpandButton, ToggleButton );
  22. public:
  23. ExpandButton( Panel *parent, const char *panelName );
  24. ~ExpandButton();
  25. // Expand the button (selected == expanded)
  26. virtual void SetSelected( bool bExpand );
  27. // sets whether or not the state of the check can be changed
  28. // if this is set to false, then no input in the code or by the user can change it's state
  29. void SetExpandable(bool state);
  30. virtual void Paint();
  31. protected:
  32. virtual void ApplySchemeSettings(IScheme *pScheme);
  33. MESSAGE_FUNC_PTR( OnExpanded, "Expanded", panel );
  34. virtual IBorder *GetBorder(bool depressed, bool armed, bool selected, bool keyfocus);
  35. /* MESSAGES SENT
  36. "Expanded" - sent when the expand button state is changed
  37. "state" - button state: 1 is expanded, 0 is unexpanded
  38. */
  39. private:
  40. bool m_bExpandable;
  41. HFont m_hFont;
  42. Color m_Color;
  43. };
  44. } // namespace vgui
  45. #endif // EXPANDBUTTON_H