ProgressBar.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. //
  2. // System.Windows.Forms.ProgressBar
  3. //
  4. // Author:
  5. // stubbed out by Jaak Simm ([email protected])
  6. // Remco de Jong ([email protected])
  7. //
  8. // (C) Ximian, Inc., 2002
  9. //
  10. using System.Drawing;
  11. using System.Drawing.Printing;
  12. using System.ComponentModel;
  13. namespace System.Windows.Forms {
  14. /// <summary>
  15. /// Represents a Windows progress bar control.
  16. ///
  17. /// </summary>
  18. [MonoTODO]
  19. public sealed class ProgressBar : Control {
  20. #region Fields
  21. private int maximum;
  22. private int minimum;
  23. private int step;
  24. private int val;
  25. #endregion
  26. #region Constructor
  27. [MonoTODO]
  28. public ProgressBar()
  29. {
  30. maximum=100;
  31. minimum=0;
  32. step=10;
  33. val=0;
  34. }
  35. #endregion
  36. internal override Gtk.Widget CreateWidget () {
  37. Gtk.ProgressBar pbar = new Gtk.ProgressBar ();
  38. return pbar;
  39. }
  40. /* #region Properties
  41. [MonoTODO]
  42. public override bool AllowDrop {
  43. get { throw new NotImplementedException (); }
  44. set { throw new NotImplementedException (); }
  45. }
  46. [MonoTODO]
  47. public override Image BackgroundImage {
  48. get { throw new NotImplementedException (); }
  49. set { throw new NotImplementedException (); }
  50. }
  51. */
  52. /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  53. /// public new bool CausesValidation {get; set;}
  54. /* [MonoTODO]
  55. protected override CreateParams CreateParams {
  56. get { throw new NotImplementedException (); }
  57. }
  58. [MonoTODO]
  59. protected override ImeMode DefaultImeMode {
  60. get { throw new NotImplementedException (); }
  61. }
  62. [MonoTODO]
  63. protected override Size DefaultSize {
  64. get { throw new NotImplementedException (); }
  65. }
  66. [MonoTODO]
  67. public override Font Font {
  68. get { throw new NotImplementedException (); }
  69. set { throw new NotImplementedException (); }
  70. }
  71. */
  72. /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  73. /// public new ImeMode ImeMode {get; set;}
  74. public int Maximum {
  75. get {
  76. return maximum;
  77. }
  78. set {
  79. maximum=value;
  80. }
  81. }
  82. public int Minimum {
  83. get {
  84. return minimum;
  85. }
  86. set {
  87. minimum=value;
  88. }
  89. }
  90. /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  91. /// public new bool TabStop {get; set;}
  92. /* [MonoTODO]
  93. public override RightToLeft RightToLeft {
  94. get { throw new NotImplementedException (); }
  95. set { throw new NotImplementedException (); }
  96. }
  97. */
  98. public int Step {
  99. get {
  100. return step;
  101. }
  102. set {
  103. step=value;
  104. }
  105. }
  106. protected override void OnTextChanged(EventArgs e)
  107. {
  108. ((Gtk.ProgressBar)Widget).Text = Text;
  109. }
  110. public int Value {
  111. get {
  112. return val;
  113. }
  114. set {
  115. if (val <= maximum) {
  116. val=value;
  117. float fraction = ((float) val / (float) maximum);
  118. ((Gtk.ProgressBar)Widget).Fraction = fraction;
  119. }
  120. }
  121. }
  122. // #endregion
  123. /* #region Methods
  124. [MonoTODO]
  125. protected override void CreateHandle()
  126. {
  127. throw new NotImplementedException ();
  128. }
  129. */
  130. [MonoTODO]
  131. public void Increment(int value)
  132. {
  133. Value += value;
  134. }
  135. /* [MonoTODO]
  136. protected override void OnHandleCreated(EventArgs e)
  137. {
  138. throw new NotImplementedException ();
  139. }
  140. */
  141. [MonoTODO]
  142. public void PerformStep()
  143. {
  144. Value += step;
  145. }
  146. [MonoTODO]
  147. public override string ToString()
  148. {
  149. throw new NotImplementedException ();
  150. }
  151. // #endregion
  152. #region Events
  153. /*
  154. * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
  155. public new event EventHandler DoubleClick;
  156. public new event EventHandler Enter;
  157. public new event KeyEventHandler KeyDown;
  158. public new event KeyPressEventHandler KeyPress;
  159. public new event KeyEventHandler KeyUp;
  160. public new event EventHandler Leave;
  161. public new event PaintEventHandler Paint;
  162. */
  163. #endregion
  164. }
  165. }