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.

59 lines
1.6 KiB

  1. //========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef SCALABLEIMAGEPANEL_H
  8. #define SCALABLEIMAGEPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui/vgui.h>
  13. #include <vgui_controls/Panel.h>
  14. namespace vgui
  15. {
  16. //-----------------------------------------------------------------------------
  17. // Purpose: 9-way Segmented background
  18. //-----------------------------------------------------------------------------
  19. class ScalableImagePanel : public Panel
  20. {
  21. DECLARE_CLASS_SIMPLE( ScalableImagePanel, Panel );
  22. public:
  23. ScalableImagePanel(Panel *parent, const char *name);
  24. ~ScalableImagePanel();
  25. virtual void SetImage(const char *imageName);
  26. void SetDrawColor( Color color ) { m_DrawColor = color; }
  27. protected:
  28. virtual void PaintBackground();
  29. virtual void GetSettings(KeyValues *outResourceData);
  30. virtual void ApplySettings(KeyValues *inResourceData);
  31. virtual void PerformLayout( void );
  32. virtual const char *GetDescription();
  33. private:
  34. int m_iSrcCornerHeight; // in pixels, how tall is the corner inside the image
  35. int m_iSrcCornerWidth; // same for width
  36. int m_iCornerHeight; // output size of the corner height in pixels
  37. int m_iCornerWidth; // same for width
  38. int m_iTextureID;
  39. float m_flCornerWidthPercent; // corner width as percentage of image width
  40. float m_flCornerHeightPercent; // same for height
  41. char *m_pszImageName;
  42. char *m_pszDrawColorName;
  43. Color m_DrawColor;
  44. };
  45. } // namespace vgui
  46. #endif // SCALABLEIMAGEPANEL_H