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.

57 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef BITMAPIMAGEPANEL_H
  8. #define BITMAPIMAGEPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Label.h>
  13. namespace vgui {
  14. class CBitmapImagePanel : public vgui::Panel
  15. {
  16. public:
  17. CBitmapImagePanel( vgui::Panel *parent, char const *panelName, char const *filename = NULL );
  18. ~CBitmapImagePanel();
  19. virtual void PaintBackground();
  20. virtual void setTexture( char const *filename, bool hardwareFiltered = true );
  21. void setImageColor( Color color ) { m_bgColor = color; }
  22. // Set how the image aligns itself within the panel
  23. virtual void SetContentAlignment(Label::Alignment alignment);
  24. protected:
  25. virtual void GetSettings(KeyValues *outResourceData);
  26. virtual void ApplySettings(KeyValues *inResourceData);
  27. virtual const char *GetDescription();
  28. virtual void ApplySchemeSettings( IScheme *pScheme );
  29. virtual void PaintBorder();
  30. private:
  31. typedef vgui::Panel BaseClass;
  32. virtual void ComputeImagePosition(int &x, int &y, int &w, int &h);
  33. Label::Alignment m_contentAlignment;
  34. bool m_preserveAspectRatio;
  35. bool m_hardwareFiltered;
  36. IImage *m_pImage;
  37. Color m_bgColor;
  38. char *m_pszImageName;
  39. char *m_pszColorName;
  40. };
  41. };
  42. #endif // BITMAPIMAGEPANEL_H