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.

51 lines
1.2 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef PANORAMA_PROGRESSBAR_H
  6. #define PANORAMA_PROGRESSBAR_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "panorama/controls/panel2d.h"
  11. namespace panorama
  12. {
  13. //////////////////////////////////////////////////////////////////////////
  14. //
  15. // progress bar, just sizes two panels to represent progress
  16. //
  17. class CProgressBar: public CPanel2D
  18. {
  19. DECLARE_PANEL2D( CProgressBar, CPanel2D );
  20. public:
  21. CProgressBar( CPanel2D *pParent, const char *pchID );
  22. virtual ~CProgressBar();
  23. void SetMin( float flMin ) { m_flMin = flMin; InvalidateSizeAndPosition(); }
  24. void SetMax( float flMax ) { m_flMax = flMax; InvalidateSizeAndPosition(); }
  25. void SetValue( float flValue ) { m_flCur = flValue; InvalidateSizeAndPosition(); }
  26. float GetValue() { return m_flCur; }
  27. protected:
  28. virtual void OnLayoutTraverse( float flFinalWidth, float flFinalHeight );
  29. private:
  30. float m_flMin;
  31. float m_flMax;
  32. float m_flCur;
  33. CPanel2D *m_ppanelLeft;
  34. CPanel2D *m_ppanelRight;
  35. };
  36. } // namespace panorama
  37. #endif // PANORAMA_PROGRESSBAR_H