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 /mp/src/public/vgui_controls/CircularProgressBar.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/vgui_controls/CircularProgressBar.h')
| -rw-r--r-- | mp/src/public/vgui_controls/CircularProgressBar.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/mp/src/public/vgui_controls/CircularProgressBar.h b/mp/src/public/vgui_controls/CircularProgressBar.h new file mode 100644 index 00000000..6d1d0676 --- /dev/null +++ b/mp/src/public/vgui_controls/CircularProgressBar.h @@ -0,0 +1,74 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef CIRCULARPROGRESSBAR_H
+#define CIRCULARPROGRESSBAR_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui/VGUI.h>
+#include <vgui_controls/Panel.h>
+#include <vgui_controls/ProgressBar.h>
+
+enum progress_textures_t
+{
+ PROGRESS_TEXTURE_FG,
+ PROGRESS_TEXTURE_BG,
+
+ NUM_PROGRESS_TEXTURES,
+};
+
+namespace vgui
+{
+
+//-----------------------------------------------------------------------------
+// Purpose: Progress Bar in the shape of a pie graph
+//-----------------------------------------------------------------------------
+class CircularProgressBar : public ProgressBar
+{
+ DECLARE_CLASS_SIMPLE( CircularProgressBar, ProgressBar );
+
+public:
+ CircularProgressBar(Panel *parent, const char *panelName);
+ ~CircularProgressBar();
+
+ virtual void ApplySettings(KeyValues *inResourceData);
+ virtual void ApplySchemeSettings(IScheme *pScheme);
+
+ void SetFgImage(const char *imageName) { SetImage( imageName, PROGRESS_TEXTURE_FG ); }
+ void SetBgImage(const char *imageName) { SetImage( imageName, PROGRESS_TEXTURE_BG ); }
+
+ enum CircularProgressDir_e
+ {
+ PROGRESS_CW,
+ PROGRESS_CCW
+ };
+ int GetProgressDirection() const { return m_iProgressDirection; }
+ void SetProgressDirection( int val ) { m_iProgressDirection = val; }
+ void SetStartSegment( int val ) { m_iStartSegment = val; }
+
+protected:
+ virtual void Paint();
+ virtual void PaintBackground();
+
+ void DrawCircleSegment( Color c, float flEndDegrees, bool clockwise /* = true */ );
+ void SetImage(const char *imageName, progress_textures_t iPos);
+
+private:
+ int m_iProgressDirection;
+ int m_iStartSegment;
+
+ int m_nTextureId[NUM_PROGRESS_TEXTURES];
+ char *m_pszImageName[NUM_PROGRESS_TEXTURES];
+ int m_lenImageName[NUM_PROGRESS_TEXTURES];
+};
+
+} // namespace vgui
+
+#endif // CIRCULARPROGRESSBAR_H
\ No newline at end of file |