ProgressBar.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 Color BackColor {
  48. get { throw new NotImplementedException (); }
  49. set { throw new NotImplementedException (); }
  50. }
  51. [MonoTODO]
  52. public override Color ForeColor {
  53. get { throw new NotImplementedException (); }
  54. set { throw new NotImplementedException (); }
  55. }
  56. [MonoTODO]
  57. public override Image BackgroundImage {
  58. get { throw new NotImplementedException (); }
  59. set { throw new NotImplementedException (); }
  60. }
  61. */
  62. /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  63. /// public new bool CausesValidation {get; set;}
  64. /* [MonoTODO]
  65. protected override CreateParams CreateParams {
  66. get { throw new NotImplementedException (); }
  67. }
  68. [MonoTODO]
  69. protected override ImeMode DefaultImeMode {
  70. get { throw new NotImplementedException (); }
  71. }
  72. [MonoTODO]
  73. protected override Size DefaultSize {
  74. get { throw new NotImplementedException (); }
  75. }
  76. [MonoTODO]
  77. public override Font Font {
  78. get { throw new NotImplementedException (); }
  79. set { throw new NotImplementedException (); }
  80. }
  81. */
  82. /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  83. /// public new ImeMode ImeMode {get; set;}
  84. public int Maximum {
  85. get {
  86. return maximum;
  87. }
  88. set {
  89. maximum=value;
  90. }
  91. }
  92. public int Minimum {
  93. get {
  94. return minimum;
  95. }
  96. set {
  97. minimum=value;
  98. }
  99. }
  100. /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  101. /// public new bool TabStop {get; set;}
  102. /* [MonoTODO]
  103. public override RightToLeft RightToLeft {
  104. get { throw new NotImplementedException (); }
  105. set { throw new NotImplementedException (); }
  106. }
  107. */
  108. public int Step {
  109. get {
  110. return step;
  111. }
  112. set {
  113. step=value;
  114. }
  115. }
  116. protected override void OnTextChanged(EventArgs e)
  117. {
  118. ((Gtk.ProgressBar)Widget).Text = Text;
  119. }
  120. public int Value {
  121. get {
  122. return val;
  123. }
  124. set {
  125. if (val <= maximum) {
  126. val=value;
  127. float fraction = ((float) val / (float) maximum);
  128. ((Gtk.ProgressBar)Widget).Fraction = fraction;
  129. }
  130. }
  131. }
  132. // #endregion
  133. /* #region Methods
  134. [MonoTODO]
  135. protected override void CreateHandle()
  136. {
  137. throw new NotImplementedException ();
  138. }
  139. */
  140. [MonoTODO]
  141. public void Increment(int value)
  142. {
  143. Value += value;
  144. }
  145. /* [MonoTODO]
  146. protected override void OnHandleCreated(EventArgs e)
  147. {
  148. throw new NotImplementedException ();
  149. }
  150. */
  151. [MonoTODO]
  152. public void PerformStep()
  153. {
  154. Value += step;
  155. }
  156. [MonoTODO]
  157. public override string ToString()
  158. {
  159. throw new NotImplementedException ();
  160. }
  161. // #endregion
  162. #region Events
  163. /*
  164. * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
  165. public new event EventHandler DoubleClick;
  166. public new event EventHandler Enter;
  167. public new event KeyEventHandler KeyDown;
  168. public new event KeyPressEventHandler KeyPress;
  169. public new event KeyEventHandler KeyUp;
  170. public new event EventHandler Leave;
  171. public new event PaintEventHandler Paint;
  172. */
  173. #endregion
  174. }
  175. }