**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Windows.Forms / WINELib / StatusBar.cs
blob14ad7423aa99031cc6930a9f5905c985c14eb187
1 //
2 // System.Windows.Forms.StatusBar.cs
3 //
4 // Author:
5 // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
6 // stubbed out by Richard Baumann (biochem333@nyc.rr.com)
7 // Dennis Hayes (dennish@Raytek.com)
8 //
9 // (C) 2002 Ximian, Inc
12 using System;
13 using System.Collections;
14 using System.Drawing;
15 using System.ComponentModel;
17 namespace System.Windows.Forms {
19 // <summary>
20 // This is only a template. Nothing is implemented yet.
21 // Represents a Windows status bar control.
22 // </summary>
23 public class StatusBar : Control {
26 // --- Private Fields
28 private bool showPanels;
29 private bool sizingGrip;
32 // --- Constructors/Destructors
34 [MonoTODO]
35 public StatusBar() : base()
37 Dock = DockStyle.Bottom;
38 showPanels = false;
39 sizingGrip = true;
40 throw new NotImplementedException ();
44 // --- Public Methods
46 [MonoTODO]
47 public override string ToString()
49 throw new NotImplementedException ();
53 // --- Protected Methods
55 [MonoTODO]
56 protected override void CreateHandle()
58 throw new NotImplementedException ();
61 //inherited
62 //protected override void Dispose(bool disposing)
63 //{
64 // throw new NotImplementedException ();
65 //}
66 [MonoTODO]
67 protected virtual void OnDrawItem(StatusBarDrawItemEventArgs e)
69 throw new NotImplementedException ();
71 [MonoTODO]
72 protected override void OnHandleCreated(EventArgs e)
74 throw new NotImplementedException ();
76 [MonoTODO]
77 protected override void OnHandleDestroyed(EventArgs e)
79 throw new NotImplementedException ();
81 [MonoTODO]
82 protected override void OnLayout(LayoutEventArgs e)
84 throw new NotImplementedException ();
86 [MonoTODO]
87 protected override void OnMouseDown(MouseEventArgs e)
89 throw new NotImplementedException ();
91 [MonoTODO]
92 protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
94 throw new NotImplementedException ();
96 [MonoTODO]
97 protected override void OnResize(EventArgs e)
99 throw new NotImplementedException ();
101 [MonoTODO]
102 protected override void WndProc(ref Message m)
104 throw new NotImplementedException ();
108 // --- Public Events
110 public event StatusBarDrawItemEventHandler DrawItem;
111 public event StatusBarPanelClickEventHandler PanelClick;
114 // --- Public Properties
116 [MonoTODO]
117 public override Color BackColor {
119 get { throw new NotImplementedException (); }
120 set { throw new NotImplementedException (); }
122 [MonoTODO]
123 public override Image BackgroundImage {
125 get { throw new NotImplementedException (); }
126 set { throw new NotImplementedException (); }
128 [MonoTODO]
129 public override DockStyle Dock {
131 get { throw new NotImplementedException (); }
132 set { throw new NotImplementedException (); }
134 [MonoTODO]
135 public override Font Font {
137 get { throw new NotImplementedException (); }
138 set { throw new NotImplementedException (); }
140 [MonoTODO]
141 public override Color ForeColor {
143 get { throw new NotImplementedException (); }
144 set { throw new NotImplementedException (); }
146 [MonoTODO]
147 public new ImeMode ImeMode {
149 get { throw new NotImplementedException (); }
150 set { throw new NotImplementedException (); }
152 [MonoTODO]
153 public StatusBar.StatusBarPanelCollection Panels {
155 get { throw new NotImplementedException (); }
157 [MonoTODO]
158 public bool ShowPanels {// default false {
160 get { throw new NotImplementedException (); }
161 set { throw new NotImplementedException (); }
163 [MonoTODO]
164 public bool SizingGrip // default true {
166 get { throw new NotImplementedException (); }
167 set { throw new NotImplementedException (); }
169 [MonoTODO]
170 public new bool TabStop {
172 get { throw new NotImplementedException (); }
173 set { throw new NotImplementedException (); }
175 [MonoTODO]
176 public override string Text {
178 get { throw new NotImplementedException (); }
179 set { throw new NotImplementedException (); }
183 // --- Protected Properties
185 [MonoTODO]
186 protected override CreateParams CreateParams {
188 get { throw new NotImplementedException (); }
190 [MonoTODO]
191 protected override ImeMode DefaultImeMode {
193 get { throw new NotImplementedException (); }
195 [MonoTODO]
196 protected override Size DefaultSize {
198 get { throw new NotImplementedException (); }
202 // System.Windows.Forms.StatusBar.StatusBarPanelCollection
204 // Author:
205 // stubbed out by Richard Baumann (biochem333@nyc.rr.com)
206 // stub ammended by Jaak Simm (jaaksimm@firm.ee)
207 // Implemented by Richard Baumann <biochem333@nyc.rr.com>
208 // (C) Ximian, Inc., 2002
210 // <summary>
211 // Represents the collection of panels in a StatusBar control.
212 // </summary>
213 public class StatusBarPanelCollection : IList, ICollection, IEnumerable {
216 // --- Private Fields
218 private ArrayList list;
219 private StatusBar owner;
220 private static string class_string = "System.Windows.Forms.StatusBar.StatusBarPanelCollection::";
223 // --- Constructors/Destructors
225 StatusBarPanelCollection(StatusBar owner) : base()
227 list = new ArrayList();
228 this.owner = owner;
232 // --- Public Methods
234 [MonoTODO]
235 public virtual int Add(StatusBarPanel panel)
237 string method_string = "Add(StatusBarPanel) ";
238 if (panel == null) {
240 throw new ArgumentNullException(class_string + method_string + "panel == null");
242 if (panel.Parent == null) {
244 throw new ArgumentException(class_string + method_string + "panel.Parent != null");
246 // FIXME: StatusBarPanel.Parent is readonly!
247 //panel.Parent = owner;
248 return list.Add(panel);
250 [MonoTODO]
251 public virtual StatusBarPanel Add(string s)
253 throw new NotImplementedException ();
254 // StatusBarPanel tmp = new StatusBarPanel();
255 // tmp.Text = s;
256 // // FIXME: StatusBarPanel.Parent is readonly!
257 // //tmp.Parent = owner;
258 // list.Add(tmp);
259 // return tmp;
261 [MonoTODO]
262 public virtual void AddRange(StatusBarPanel[] panels)
264 string method_string = "AddRange(StatusBarPanel[]) ";
265 if (panels == null) {
267 throw new ArgumentNullException(class_string + method_string + "panels == null");
269 for (int i = 0; i < panels.Length; i++) {
270 // FIXME: StatusBarPanel.Parent is readonly!
271 //panels[i].Parent = owner;
273 list.AddRange(panels);
275 public virtual void Clear()
277 list.Clear();
279 public bool Contains(StatusBarPanel panel)
281 return list.Contains(panel);
283 public IEnumerator GetEnumerator()
285 return list.GetEnumerator();
287 public int IndexOf(StatusBarPanel panel)
289 return list.IndexOf(panel);
291 [MonoTODO]
292 public virtual void Insert(int index, StatusBarPanel panel)
294 string method_string = "Insert(int,StatusBarPanel) ";
295 if (panel == null) {
297 throw new ArgumentNullException(class_string + method_string + "panel == null");
299 if (panel.Parent == null) {
301 throw new ArgumentException(class_string + method_string + "panel.Parent != null");
303 if (panel.AutoSize != StatusBarPanelAutoSize.None &&
304 panel.AutoSize != StatusBarPanelAutoSize.Contents &&
305 panel.AutoSize != StatusBarPanelAutoSize.Spring)
307 throw new InvalidEnumArgumentException(class_string + method_string + "panel.AutoSize is not a valid StatusBarPanelAutoSize value");
309 list.Insert(index,panel);
311 // do this after insert because insert does the range checking and might throw an exception
312 // FIXME: StatusBarPanel.Parent is readonly!
313 // panel.Parent = owner; // a rethrow for a better exception message, or an extra range check, would incur an unnecessary performance cost
315 public virtual void Remove(StatusBarPanel panel)
317 string method_string = "Remove(StatusBarPanel) ";
318 if (panel == null) {
320 throw new ArgumentNullException(class_string + method_string + "panel == null");
322 list.Remove(panel);
324 public virtual void RemoveAt(int index)
326 list.RemoveAt(index);
328 void ICollection.CopyTo(Array dest, int index)
330 string method_string = "ICollection.CopyTo(Array,int) ";
331 if (dest == null) {
333 throw new ArgumentNullException(class_string + method_string + "array == null");
335 if (index < 0) {
337 throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
339 if (dest.Rank != 1) {
341 throw new ArgumentException(class_string + method_string + "array is multidimensional");
343 if (index >= dest.Length) {
345 throw new ArgumentException(class_string + method_string + "index >= array.Length");
347 if (Count+index >= dest.Length) {
349 throw new ArgumentException(class_string + method_string + "insufficient array capacity");
351 // easier/quicker to let the runtime throw the invalid cast exception if necessary
352 for (int i = 0; index < dest.Length; i++, index++) {
354 dest.SetValue(list[i], index);
357 int IList.Add(object panel)
359 string method_string = "IList.Add(object) ";
360 if (!(panel is StatusBarPanel)) {
362 throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
364 return Add((StatusBarPanel) panel);
366 bool IList.Contains(object panel)
368 if (!(panel is StatusBarPanel)) {
370 return false;
372 return Contains((StatusBarPanel) panel);
374 int IList.IndexOf(object panel)
376 if (!(panel is StatusBarPanel)) {
378 return -1;
380 return IndexOf((StatusBarPanel) panel);
382 void IList.Insert(int index, object panel)
384 string method_string = "IList.Insert(int,object) ";
385 if (!(panel is StatusBarPanel)) {
387 throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
389 Insert(index, (StatusBarPanel) panel);
391 void IList.Remove(object panel)
393 string method_string = "IList.Remove(object) ";
394 if (!(panel is StatusBarPanel)) {
396 throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
398 Remove((StatusBarPanel) panel);
402 // --- Public Properties
403 [MonoTODO]
404 public int Count {
405 get { throw new NotImplementedException (); }
406 //get { return list.Count; }
408 public bool IsReadOnly {
410 get { return false; }
412 object IList.this[int index] {
414 get { return this[index]; }
415 set { this[index]=(StatusBarPanel)value; }
417 public virtual StatusBarPanel this[int index] {
421 // The same checks are done by the list, so this is redundant
422 // This is left here in case you prefer better exception messages over performance
423 //string method_string = "get_Item(int) ";
424 //if (index < 0)
426 // throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
428 //if (index >= Count)
430 // throw new ArgumentOutOfRangeException(class_string + method_string + "index >= Count");
432 return (StatusBarPanel)list[index];
436 // The same checks are done by the list, so this is redundant
437 // This is left here in case you prefer better exception messages over performance
438 //string method_string = "set_Item(int,StatusBarPanel) ";
439 //if (index < 0)
441 // throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
443 //if (index >= Count)
445 // throw new ArgumentOutOfRangeException(class_string + method_string + "index >= Count");
447 //if (value == null)
449 // throw new ArgumentNullException(class_string + method_string + "panel == null");
451 list[index] = value;
454 bool IList.IsFixedSize {
455 [MonoTODO] get { throw new NotImplementedException (); }
457 object ICollection.SyncRoot {
459 [MonoTODO] get { throw new NotImplementedException (); }
461 bool ICollection.IsSynchronized {
463 [MonoTODO] get { throw new NotImplementedException (); }
467 // --- Private Properties
469 private bool IsFixedSize { get { return false; } }
471 // private object ILList.this[int index]
472 // {
473 // get { return (StatusBarPanel) this[index]; }
474 // set
475 // {
476 // string method_string = "IList.set_Item(int,object) ";
477 // if (!(value is StatusBarPanel))
478 // {
479 // throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
480 // }
481 // this[index] = (StatusBarPanel) value;
482 // }
483 // }