diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/client/vgui_bitmappanel.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/client/vgui_bitmappanel.h')
| -rw-r--r-- | sp/src/game/client/vgui_bitmappanel.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/sp/src/game/client/vgui_bitmappanel.h b/sp/src/game/client/vgui_bitmappanel.h new file mode 100644 index 00000000..ee21a251 --- /dev/null +++ b/sp/src/game/client/vgui_bitmappanel.h @@ -0,0 +1,72 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is a panel which is rendered image on top of an entity
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VGUI_BITMAPPANEL_H
+#define VGUI_BITMAPPANEL_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui_controls/Panel.h>
+
+//-----------------------------------------------------------------------------
+// forward declarations
+//-----------------------------------------------------------------------------
+class KeyValues;
+class BitmapImage;
+struct Bitmap_t;
+
+//-----------------------------------------------------------------------------
+// This is a base class for a panel which always is rendered on top of an entity
+//-----------------------------------------------------------------------------
+class CBitmapPanel : public vgui::Panel
+{
+ typedef vgui::Panel BaseClass;
+
+public:
+ // constructor
+ CBitmapPanel( );
+ CBitmapPanel( vgui::Panel *pParent, const char *pName );
+ ~CBitmapPanel();
+
+ // initialization
+ bool Init( KeyValues* pInitData );
+
+ // initialization from build-mode dialog style .res files
+ virtual void ApplySettings(KeyValues *inResourceData);
+
+ virtual void Paint( void );
+ virtual void PaintBackground( void ) {}
+
+ virtual void OnCursorEntered();
+ virtual void OnCursorExited();
+
+ // Setup for panels that aren't created by the commander overlay factory (i.e. aren't parsed from a keyvalues file)
+ virtual void SetImage( BitmapImage *pImage );
+
+ /// Set bitmap data directly
+ virtual void SetBitmap( const Bitmap_t &bitmap );
+
+ const char *GetMouseOverText( void );
+
+private:
+ enum
+ {
+ MAX_ENTITY_MOUSEOVER = 256
+ };
+ // The bitmap to render
+ BitmapImage *m_pImage;
+ int m_r, m_g, m_b, m_a;
+ bool m_bOwnsImage;
+
+ char m_szMouseOverText[ MAX_ENTITY_MOUSEOVER ];
+
+};
+
+#endif // VGUI_BITMAPPANEL_H
\ No newline at end of file |