ProgressBar.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #include "UnitTest.h"
  2. #include "Gwen/Controls/RadioButtonController.h"
  3. #include "Gwen/Controls/ProgressBar.h"
  4. using namespace Gwen;
  5. class ProgressBar : public GUnit
  6. {
  7. public:
  8. GWEN_CONTROL_INLINE( ProgressBar, GUnit )
  9. {
  10. {
  11. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  12. pb->SetBounds( Gwen::Rect( 110, 20, 200, 20 ) );
  13. pb->SetValue( 0.27f );
  14. }
  15. {
  16. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  17. pb->SetBounds( Gwen::Rect( 110, 50, 200, 20 ) );
  18. pb->SetValue( 0.66f );
  19. pb->SetAlignment( Pos::Right | Pos::CenterV );
  20. }
  21. {
  22. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  23. pb->SetBounds( Gwen::Rect( 110, 80, 200, 20 ) );
  24. pb->SetValue( 0.88f );
  25. pb->SetAlignment( Pos::Left | Pos::CenterV );
  26. }
  27. {
  28. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  29. pb->SetBounds( Gwen::Rect( 110, 110, 200, 20 ) );
  30. pb->SetAutoLabel( false );
  31. pb->SetValue( 0.20f );
  32. pb->SetAlignment( Pos::Right | Pos::CenterV );
  33. pb->SetText( L"40,245 MB" );
  34. }
  35. {
  36. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  37. pb->SetBounds( Gwen::Rect( 110, 140, 200, 20 ) );
  38. pb->SetAutoLabel( false );
  39. pb->SetValue( 1.00f );
  40. }
  41. {
  42. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  43. pb->SetBounds( Gwen::Rect( 110, 170, 200, 20 ) );
  44. pb->SetAutoLabel( false );
  45. pb->SetValue( 0.00f );
  46. }
  47. {
  48. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  49. pb->SetBounds( Gwen::Rect( 110, 200, 200, 20 ) );
  50. pb->SetAutoLabel( false );
  51. pb->SetValue( 0.50f );
  52. }
  53. {
  54. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  55. pb->SetBounds( Gwen::Rect( 20, 20, 25, 200 ) );
  56. pb->SetVertical();
  57. pb->SetValue( 0.25f );
  58. pb->SetAlignment( Pos::Top | Pos::CenterH );
  59. }
  60. {
  61. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  62. pb->SetBounds( Gwen::Rect( 50, 20, 25, 200 ) );
  63. pb->SetVertical();
  64. pb->SetValue( 0.40f );
  65. }
  66. {
  67. Gwen::Controls::ProgressBar* pb = new Gwen::Controls::ProgressBar( this );
  68. pb->SetBounds( Gwen::Rect( 80, 20, 25, 200 ) );
  69. pb->SetVertical();
  70. pb->SetAlignment( Pos::Bottom | Pos::CenterH );
  71. pb->SetValue( 0.65f );
  72. }
  73. }
  74. };
  75. DEFINE_UNIT_TEST( ProgressBar, L"ProgressBar" );