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.

87 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_BUTTON_H
  8. #define DOD_BUTTON_H
  9. #include "mouseoverpanelbutton.h"
  10. #include "KeyValues.h"
  11. #include <vgui/IScheme.h>
  12. #include <vgui_controls/ProgressBar.h>
  13. #include <vgui_controls/EditablePanel.h>
  14. // a button with the bottom right corner cut out
  15. /*
  16. |``````````````|
  17. | PRESS ME! |
  18. |_____________/
  19. */
  20. class CDODButtonShape
  21. {
  22. public:
  23. CDODButtonShape()
  24. {
  25. m_iWhiteTexture = -1;
  26. }
  27. void DrawShapedBorder( int x, int y, int wide, int tall, Color fgcolor );
  28. void DrawShapedBackground( int x, int y, int wide, int tall, Color bgcolor );
  29. protected:
  30. int m_iWhiteTexture;
  31. };
  32. class CDODButton : public vgui::Button, public CDODButtonShape
  33. {
  34. private:
  35. DECLARE_CLASS_SIMPLE( CDODButton, vgui::Button );
  36. public:
  37. CDODButton(vgui::Panel *parent ) :
  38. vgui::Button( parent, "DODButton", "" )
  39. {
  40. }
  41. protected:
  42. virtual void PaintBackground();
  43. virtual void PaintBorder();
  44. };
  45. class CDODClassInfoPanel : public vgui::EditablePanel
  46. {
  47. private:
  48. DECLARE_CLASS_SIMPLE( CDODClassInfoPanel, vgui::EditablePanel );
  49. public:
  50. CDODClassInfoPanel( vgui::Panel *parent, const char *panelName ) : vgui::EditablePanel( parent, panelName )
  51. {
  52. }
  53. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  54. virtual vgui::Panel *CreateControlByName( const char *controlName );
  55. };
  56. // Solid coloured progress bar with no border
  57. class CDODProgressBar : public vgui::ProgressBar
  58. {
  59. private:
  60. DECLARE_CLASS_SIMPLE( CDODProgressBar, vgui::ProgressBar );
  61. public:
  62. CDODProgressBar(vgui::Panel *parent) : vgui::ProgressBar( parent, "statBar" )
  63. {
  64. }
  65. protected:
  66. virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
  67. };
  68. #endif //DOD_BUTTON_H