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.

67 lines
1.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: This is a panel which is rendered image on top of an entity
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef VGUI_BITMAPPANEL_H
  9. #define VGUI_BITMAPPANEL_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include <vgui_controls/Panel.h>
  14. //-----------------------------------------------------------------------------
  15. // forward declarations
  16. //-----------------------------------------------------------------------------
  17. class KeyValues;
  18. class BitmapImage;
  19. //-----------------------------------------------------------------------------
  20. // This is a base class for a panel which always is rendered on top of an entity
  21. //-----------------------------------------------------------------------------
  22. class CBitmapPanel : public vgui::Panel
  23. {
  24. typedef vgui::Panel BaseClass;
  25. public:
  26. // constructor
  27. CBitmapPanel( );
  28. CBitmapPanel( vgui::Panel *pParent, const char *pName );
  29. ~CBitmapPanel();
  30. // initialization
  31. bool Init( KeyValues* pInitData );
  32. // initialization from build-mode dialog style .res files
  33. virtual void ApplySettings(KeyValues *inResourceData);
  34. virtual void Paint( void );
  35. virtual void PaintBackground( void ) {}
  36. virtual void OnCursorEntered();
  37. virtual void OnCursorExited();
  38. // Setup for panels that aren't created by the commander overlay factory (i.e. aren't parsed from a keyvalues file)
  39. virtual void SetImage( BitmapImage *pImage );
  40. const char *GetMouseOverText( void );
  41. private:
  42. enum
  43. {
  44. MAX_ENTITY_MOUSEOVER = 256
  45. };
  46. // The bitmap to render
  47. BitmapImage *m_pImage;
  48. int m_r, m_g, m_b, m_a;
  49. bool m_bOwnsImage;
  50. char m_szMouseOverText[ MAX_ENTITY_MOUSEOVER ];
  51. };
  52. #endif // VGUI_BITMAPPANEL_H