ProgressCtrl.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/wwui/ProgressCtrl.h $
  22. *
  23. * DESCRIPTION
  24. * Progress bar control
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. * $Author: Denzil_l $
  29. *
  30. * VERSION INFO
  31. * $Revision: 2 $
  32. * $Modtime: 10/18/01 9:22a $
  33. *
  34. ******************************************************************************/
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __PROGRESS_CTRL_H
  39. #define __PROGRESS_CTRL_H
  40. #include "DialogControl.h"
  41. #include "Render2D.h"
  42. //#include "vector3.h"
  43. //#include "bittype.h"
  44. class ProgressCtrlClass :
  45. public DialogControlClass
  46. {
  47. public:
  48. ProgressCtrlClass(void);
  49. virtual ~ProgressCtrlClass();
  50. // RTTI
  51. ProgressCtrlClass* As_ProgressCtrlClass(void)
  52. {return this;}
  53. void Render(void);
  54. // Sets the minimum and maximum values for the progress bar and redraws
  55. // the bar to reflect the new range.
  56. void Set_Range(unsigned int min, unsigned int max);
  57. // Get the minimun and maximum values for the progress bar.
  58. void Get_Range(unsigned int& min, unsigned int& max);
  59. // Set the current position for the progress bar.
  60. void Set_Position(unsigned int position);
  61. // Advance the position of the progress bar by a specified increment.
  62. void Delta_Position(int delta);
  63. // Get the current position of the progress bar.
  64. unsigned int Get_Position(void) const;
  65. // Specify the step increment for the progress bar. This is the amount
  66. // the progress bar increases its position whenever Step_Position()
  67. // is called.
  68. void Set_Step(unsigned int step);
  69. // Advance the position for the progress bar by the step increment.
  70. void Step_Position(void);
  71. protected:
  72. void Create_Control_Renderers(void);
  73. float Calculate_Bar_Width(unsigned int position);
  74. void Update_Client_Rect(void);
  75. protected:
  76. Render2DClass mControlRenderer;
  77. RectClass mBarRect;
  78. unsigned int mMinLimit;
  79. unsigned int mMaxLimit;
  80. unsigned int mPosition;
  81. unsigned int mStep;
  82. };
  83. #endif //__PROGRESS_CTRL_H