2 // System.Windows.Forms.StatusBar.cs
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)
9 // (C) 2002 Ximian, Inc
13 using System
.Collections
;
15 using System
.ComponentModel
;
17 namespace System
.Windows
.Forms
{
20 // This is only a template. Nothing is implemented yet.
21 // Represents a Windows status bar control.
23 public class StatusBar
: Control
{
28 private bool showPanels
;
29 private bool sizingGrip
;
32 // --- Constructors/Destructors
35 public StatusBar() : base()
37 Dock
= DockStyle
.Bottom
;
40 throw new NotImplementedException ();
47 public override string ToString()
49 throw new NotImplementedException ();
53 // --- Protected Methods
56 protected override void CreateHandle()
58 throw new NotImplementedException ();
62 //protected override void Dispose(bool disposing)
64 // throw new NotImplementedException ();
67 protected virtual void OnDrawItem(StatusBarDrawItemEventArgs e
)
69 throw new NotImplementedException ();
72 protected override void OnHandleCreated(EventArgs e
)
74 throw new NotImplementedException ();
77 protected override void OnHandleDestroyed(EventArgs e
)
79 throw new NotImplementedException ();
82 protected override void OnLayout(LayoutEventArgs e
)
84 throw new NotImplementedException ();
87 protected override void OnMouseDown(MouseEventArgs e
)
89 throw new NotImplementedException ();
92 protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e
)
94 throw new NotImplementedException ();
97 protected override void OnResize(EventArgs e
)
99 throw new NotImplementedException ();
102 protected override void WndProc(ref Message m
)
104 throw new NotImplementedException ();
110 public event StatusBarDrawItemEventHandler DrawItem
;
111 public event StatusBarPanelClickEventHandler PanelClick
;
114 // --- Public Properties
117 public override Color BackColor
{
119 get { throw new NotImplementedException (); }
120 set { throw new NotImplementedException (); }
123 public override Image BackgroundImage
{
125 get { throw new NotImplementedException (); }
126 set { throw new NotImplementedException (); }
129 public override DockStyle Dock
{
131 get { throw new NotImplementedException (); }
132 set { throw new NotImplementedException (); }
135 public override Font Font
{
137 get { throw new NotImplementedException (); }
138 set { throw new NotImplementedException (); }
141 public override Color ForeColor
{
143 get { throw new NotImplementedException (); }
144 set { throw new NotImplementedException (); }
147 public new ImeMode ImeMode
{
149 get { throw new NotImplementedException (); }
150 set { throw new NotImplementedException (); }
153 public StatusBar
.StatusBarPanelCollection Panels
{
155 get { throw new NotImplementedException (); }
158 public bool ShowPanels
{// default false {
160 get { throw new NotImplementedException (); }
161 set { throw new NotImplementedException (); }
164 public bool SizingGrip
// default true {
166 get { throw new NotImplementedException (); }
167 set { throw new NotImplementedException (); }
170 public new bool TabStop
{
172 get { throw new NotImplementedException (); }
173 set { throw new NotImplementedException (); }
176 public override string Text
{
178 get { throw new NotImplementedException (); }
179 set { throw new NotImplementedException (); }
183 // --- Protected Properties
186 protected override CreateParams CreateParams
{
188 get { throw new NotImplementedException (); }
191 protected override ImeMode DefaultImeMode
{
193 get { throw new NotImplementedException (); }
196 protected override Size DefaultSize
{
198 get { throw new NotImplementedException (); }
202 // System.Windows.Forms.StatusBar.StatusBarPanelCollection
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
211 // Represents the collection of panels in a StatusBar control.
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();
232 // --- Public Methods
235 public virtual int Add(StatusBarPanel panel
)
237 string method_string
= "Add(StatusBarPanel) ";
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
);
251 public virtual StatusBarPanel
Add(string s
)
253 throw new NotImplementedException ();
254 // StatusBarPanel tmp = new StatusBarPanel();
256 // // FIXME: StatusBarPanel.Parent is readonly!
257 // //tmp.Parent = owner;
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()
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
);
292 public virtual void Insert(int index
, StatusBarPanel panel
)
294 string method_string
= "Insert(int,StatusBarPanel) ";
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) ";
320 throw new ArgumentNullException(class_string
+ method_string
+ "panel == null");
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) ";
333 throw new ArgumentNullException(class_string
+ method_string
+ "array == null");
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
)) {
372 return Contains((StatusBarPanel
) panel
);
374 int IList
.IndexOf(object panel
)
376 if (!(panel
is StatusBarPanel
)) {
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
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) ";
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) ";
441 // throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
443 //if (index >= Count)
445 // throw new ArgumentOutOfRangeException(class_string + method_string + "index >= Count");
449 // throw new ArgumentNullException(class_string + method_string + "panel == null");
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]
473 // get { return (StatusBarPanel) this[index]; }
476 // string method_string = "IList.set_Item(int,object) ";
477 // if (!(value is StatusBarPanel))
479 // throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
481 // this[index] = (StatusBarPanel) value;