summaryrefslogtreecommitdiff
path: root/game/client/vgui_bitmapbutton.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/vgui_bitmapbutton.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/vgui_bitmapbutton.h')
-rw-r--r--game/client/vgui_bitmapbutton.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/game/client/vgui_bitmapbutton.h b/game/client/vgui_bitmapbutton.h
new file mode 100644
index 0000000..a52e766
--- /dev/null
+++ b/game/client/vgui_bitmapbutton.h
@@ -0,0 +1,65 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is a panel which is rendered image on top of an entity
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VGUI_BITMAPBUTTON_H
+#define VGUI_BITMAPBUTTON_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui_controls/Button.h>
+#include "vgui_bitmapimage.h"
+
+//-----------------------------------------------------------------------------
+// forward declarations
+//-----------------------------------------------------------------------------
+class KeyValues;
+
+//-----------------------------------------------------------------------------
+// A button that renders images instead of standard vgui stuff...
+//-----------------------------------------------------------------------------
+class CBitmapButton : public vgui::Button
+{
+ typedef vgui::Button BaseClass;
+
+public:
+ enum ButtonImageType_t
+ {
+ BUTTON_ENABLED = 0,
+ BUTTON_ENABLED_MOUSE_OVER,
+ BUTTON_PRESSED,
+ BUTTON_DISABLED,
+
+ BUTTON_STATE_COUNT
+ };
+
+ // constructor
+ CBitmapButton( vgui::Panel *pParent, const char *pName, const char *pText );
+ ~CBitmapButton();
+
+ // initialization
+ bool Init( KeyValues* pInitData );
+
+ void SetImage( ButtonImageType_t type, const char *pMaterialName, color32 color );
+ bool IsImageLoaded( ButtonImageType_t type ) const;
+
+ // initialization from build-mode dialog style .res files
+ virtual void ApplySettings(KeyValues *inResourceData);
+
+ virtual void Paint( void );
+ virtual void PaintBackground( void ) {}
+
+private:
+
+ BitmapImage m_pImage[BUTTON_STATE_COUNT];
+ bool m_bImageLoaded[BUTTON_STATE_COUNT];
+};
+
+
+#endif // VGUI_BITMAPBUTTON_H \ No newline at end of file