2 // System.Windows.Forms.ProgressBar
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Remco de Jong (rdj@rdj.cg.nu)
7 // Alberto Fernandez (infjaf00@yahoo.es)
9 // (C) Ximian, Inc., 2002
13 using System
.Drawing
.Printing
;
14 using System
.ComponentModel
;
16 namespace System
.Windows
.Forms
{
19 /// Represents a Windows progress bar control.
24 public sealed class ProgressBar
: Control
{
40 this.Size
= this.DefaultSize
;
47 public override bool AllowDrop {
48 get { throw new NotImplementedException (); }
49 set { throw new NotImplementedException (); }
54 public override Image BackgroundImage {
55 get { throw new NotImplementedException (); }
56 set { throw new NotImplementedException (); }
59 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
60 /// public new bool CausesValidation {get; set;}
63 protected override CreateParams CreateParams {
64 get { throw new NotImplementedException (); }
68 protected override ImeMode DefaultImeMode {
69 get { throw new NotImplementedException (); }
74 public override Font Font {
75 get { throw new NotImplementedException (); }
76 set { throw new NotImplementedException (); }
79 protected override Size DefaultSize
{
80 get { return new System.Drawing.Size (100, 23); }
83 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
84 /// public new ImeMode ImeMode {get; set;}
87 get { return maximum;}
90 String st
= String
.Format (
91 "'{0}' is not a valid value for Maximum."+
92 "It should be >= 0", value
94 throw new ArgumentException (st
);
101 UpdateGtkProgressBar();
106 get { return minimum; }
109 String st
= String
.Format (
110 "'{0}' is not a valid value for Minimum."+
111 "It should be >= 0", value
113 throw new ArgumentException (st
);
120 UpdateGtkProgressBar();
124 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
125 /// public new bool TabStop {get; set;}
127 public override RightToLeft RightToLeft {
128 get { throw new NotImplementedException (); }
129 set { throw new NotImplementedException (); }
144 if ((value > maximum
) || (value < minimum
)){
145 String st
= String
.Format (
146 "'{0}' is not a valid value for Value."+
147 " It should be betwen Minimum and Maximum", value);
149 throw new ArgumentException (st
);
153 UpdateGtkProgressBar();
163 protected override void CreateHandle()
165 throw new NotImplementedException ();
168 public void Increment(int value) {
169 int tmp
= Value
+ value;
170 tmp
= (tmp
< Minimum
) ? Minimum
: tmp
;
171 tmp
= (tmp
> Maximum
) ? Maximum
: tmp
;
176 protected override void OnHandleCreated(EventArgs e)
178 throw new NotImplementedException ();
181 public void PerformStep(){
182 this.Increment (this.Step
);
185 public override string ToString(){
186 String ret
= String
.Format (
187 "System.Windows.Forms.ProgressBar, " +
188 "Minimum: {0}, Maximum: {1}, Value: {2}",
201 * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
202 public new event EventHandler DoubleClick;
203 public new event EventHandler Enter;
204 public new event KeyEventHandler KeyDown;
205 public new event KeyPressEventHandler KeyPress;
206 public new event KeyEventHandler KeyUp;
207 public new event EventHandler Leave;
208 public new event PaintEventHandler Paint;
211 internal override Gtk
.Widget
CreateWidget () {
212 Gtk
.ProgressBar pbar
= new Gtk
.ProgressBar ();
215 protected override void OnTextChanged(EventArgs e
){
216 ((Gtk
.ProgressBar
)Widget
).Text
= Text
;
218 internal void UpdateGtkProgressBar(){
219 float fraction
= ((float) val
/ (float) maximum
);
220 (Widget
as Gtk
.ProgressBar
).Fraction
= fraction
;