| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- //
- // System.Windows.Forms.StatusBar.cs
- //
- // Author:
- // stubbed out by Daniel Carrera ([email protected])
- // stubbed out by Richard Baumann ([email protected])
- // Dennis Hayes ([email protected])
- //
- // (C) 2002 Ximian, Inc
- //
- using System;
- using System.Collections;
- using System.Drawing;
- using System.ComponentModel;
- namespace System.Windows.Forms {
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // Represents a Windows status bar control.
- // </summary>
- public class StatusBar : Control {
- //
- // --- Private Fields
- //
- private bool showPanels;
- private bool sizingGrip;
- //
- // --- Constructors/Destructors
- //
- [MonoTODO]
- public StatusBar() : base()
- {
- Dock = DockStyle.Bottom;
- showPanels = false;
- sizingGrip = true;
- throw new NotImplementedException ();
- }
- //
- // --- Public Methods
- //
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
- //
- // --- Protected Methods
- //
- [MonoTODO]
- protected override void CreateHandle()
- {
- throw new NotImplementedException ();
- }
- //inherited
- //protected override void Dispose(bool disposing)
- //{
- // throw new NotImplementedException ();
- //}
- [MonoTODO]
- protected virtual void OnDrawItem(StatusBarDrawItemEventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected override void OnHandleCreated(EventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected override void OnHandleDestroyed(EventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected override void OnLayout(LayoutEventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected override void OnMouseDown(MouseEventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected override void OnResize(EventArgs e)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- protected override void WndProc(ref Message m)
- {
- throw new NotImplementedException ();
- }
- //
- // --- Public Events
- //
- public event StatusBarDrawItemEventHandler DrawItem;
- public event StatusBarPanelClickEventHandler PanelClick;
- //
- // --- Public Properties
- //
- [MonoTODO]
- public override Color BackColor {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override Image BackgroundImage {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override DockStyle Dock {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override Font Font {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override Color ForeColor {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public new ImeMode ImeMode {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public StatusBar.StatusBarPanelCollection Panels {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public bool ShowPanels {// default false {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public bool SizingGrip // default true {
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public new bool TabStop {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override string Text {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- //
- // --- Protected Properties
- //
- [MonoTODO]
- protected override CreateParams CreateParams {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- protected override ImeMode DefaultImeMode {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- protected override Size DefaultSize {
- get { throw new NotImplementedException (); }
- }
- //
- // System.Windows.Forms.StatusBar.StatusBarPanelCollection
- //
- // Author:
- // stubbed out by Richard Baumann ([email protected])
- // stub ammended by Jaak Simm ([email protected])
- // Implemented by Richard Baumann <[email protected]>
- // (C) Ximian, Inc., 2002
- //
- // <summary>
- // Represents the collection of panels in a StatusBar control.
- // </summary>
- public class StatusBarPanelCollection : IList, ICollection, IEnumerable {
- //
- // --- Private Fields
- //
- private ArrayList list;
- private StatusBar owner;
- private static string class_string = "System.Windows.Forms.StatusBar.StatusBarPanelCollection::";
- //
- // --- Constructors/Destructors
- //
- StatusBarPanelCollection(StatusBar owner) : base()
- {
- list = new ArrayList();
- this.owner = owner;
- }
- //
- // --- Public Methods
- //
- [MonoTODO]
- public virtual int Add(StatusBarPanel panel)
- {
- string method_string = "Add(StatusBarPanel) ";
- if (panel == null) {
- throw new ArgumentNullException(class_string + method_string + "panel == null");
- }
- if (panel.Parent == null) {
- throw new ArgumentException(class_string + method_string + "panel.Parent != null");
- }
- // FIXME: StatusBarPanel.Parent is readonly!
- //panel.Parent = owner;
- return list.Add(panel);
- }
- [MonoTODO]
- public virtual StatusBarPanel Add(string s)
- {
- throw new NotImplementedException ();
- // StatusBarPanel tmp = new StatusBarPanel();
- // tmp.Text = s;
- // // FIXME: StatusBarPanel.Parent is readonly!
- // //tmp.Parent = owner;
- // list.Add(tmp);
- // return tmp;
- }
- [MonoTODO]
- public virtual void AddRange(StatusBarPanel[] panels)
- {
- string method_string = "AddRange(StatusBarPanel[]) ";
- if (panels == null) {
- throw new ArgumentNullException(class_string + method_string + "panels == null");
- }
- for (int i = 0; i < panels.Length; i++) {
- // FIXME: StatusBarPanel.Parent is readonly!
- //panels[i].Parent = owner;
- }
- list.AddRange(panels);
- }
- public virtual void Clear()
- {
- list.Clear();
- }
- public bool Contains(StatusBarPanel panel)
- {
- return list.Contains(panel);
- }
- public IEnumerator GetEnumerator()
- {
- return list.GetEnumerator();
- }
- public int IndexOf(StatusBarPanel panel)
- {
- return list.IndexOf(panel);
- }
- [MonoTODO]
- public virtual void Insert(int index, StatusBarPanel panel)
- {
- string method_string = "Insert(int,StatusBarPanel) ";
- if (panel == null) {
- throw new ArgumentNullException(class_string + method_string + "panel == null");
- }
- if (panel.Parent == null) {
- throw new ArgumentException(class_string + method_string + "panel.Parent != null");
- }
- if (panel.AutoSize != StatusBarPanelAutoSize.None &&
- panel.AutoSize != StatusBarPanelAutoSize.Contents &&
- panel.AutoSize != StatusBarPanelAutoSize.Spring)
- {
- throw new InvalidEnumArgumentException(class_string + method_string + "panel.AutoSize is not a valid StatusBarPanelAutoSize value");
- }
- list.Insert(index,panel);
-
- // do this after insert because insert does the range checking and might throw an exception
- // FIXME: StatusBarPanel.Parent is readonly!
- // panel.Parent = owner; // a rethrow for a better exception message, or an extra range check, would incur an unnecessary performance cost
- }
- public virtual void Remove(StatusBarPanel panel)
- {
- string method_string = "Remove(StatusBarPanel) ";
- if (panel == null) {
- throw new ArgumentNullException(class_string + method_string + "panel == null");
- }
- list.Remove(panel);
- }
- public virtual void RemoveAt(int index)
- {
- list.RemoveAt(index);
- }
- void ICollection.CopyTo(Array dest, int index)
- {
- string method_string = "ICollection.CopyTo(Array,int) ";
- if (dest == null) {
- throw new ArgumentNullException(class_string + method_string + "array == null");
- }
- if (index < 0) {
- throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
- }
- if (dest.Rank != 1) {
- throw new ArgumentException(class_string + method_string + "array is multidimensional");
- }
- if (index >= dest.Length) {
- throw new ArgumentException(class_string + method_string + "index >= array.Length");
- }
- if (Count+index >= dest.Length) {
- throw new ArgumentException(class_string + method_string + "insufficient array capacity");
- }
- // easier/quicker to let the runtime throw the invalid cast exception if necessary
- for (int i = 0; index < dest.Length; i++, index++) {
- dest.SetValue(list[i], index);
- }
- }
- int IList.Add(object panel)
- {
- string method_string = "IList.Add(object) ";
- if (!(panel is StatusBarPanel)) {
- throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
- }
- return Add((StatusBarPanel) panel);
- }
- bool IList.Contains(object panel)
- {
- if (!(panel is StatusBarPanel)) {
- return false;
- }
- return Contains((StatusBarPanel) panel);
- }
- int IList.IndexOf(object panel)
- {
- if (!(panel is StatusBarPanel)) {
- return -1;
- }
- return IndexOf((StatusBarPanel) panel);
- }
- void IList.Insert(int index, object panel)
- {
- string method_string = "IList.Insert(int,object) ";
- if (!(panel is StatusBarPanel)) {
- throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
- }
- Insert(index, (StatusBarPanel) panel);
- }
- void IList.Remove(object panel)
- {
- string method_string = "IList.Remove(object) ";
- if (!(panel is StatusBarPanel)) {
- throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
- }
- Remove((StatusBarPanel) panel);
- }
-
- // --- Public Properties
- [MonoTODO]
- public int Count {
- get { throw new NotImplementedException (); }
- //get { return list.Count; }
- }
- public bool IsReadOnly {
- get { return false; }
- }
- object IList.this[int index] {
- get { return this[index]; }
- set { this[index]=(StatusBarPanel)value; }
- }
- public virtual StatusBarPanel this[int index] {
- get
- {
- // The same checks are done by the list, so this is redundant
- // This is left here in case you prefer better exception messages over performance
- //string method_string = "get_Item(int) ";
- //if (index < 0)
- //{
- // throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
- //}
- //if (index >= Count)
- //{
- // throw new ArgumentOutOfRangeException(class_string + method_string + "index >= Count");
- //}
- return (StatusBarPanel)list[index];
- }
- set
- {
- // The same checks are done by the list, so this is redundant
- // This is left here in case you prefer better exception messages over performance
- //string method_string = "set_Item(int,StatusBarPanel) ";
- //if (index < 0)
- //{
- // throw new ArgumentOutOfRangeException(class_string + method_string + "index < 0");
- //}
- //if (index >= Count)
- //{
- // throw new ArgumentOutOfRangeException(class_string + method_string + "index >= Count");
- //}
- //if (value == null)
- //{
- // throw new ArgumentNullException(class_string + method_string + "panel == null");
- //}
- list[index] = value;
- }
- }
- bool IList.IsFixedSize {
- [MonoTODO] get { throw new NotImplementedException (); }
- }
- object ICollection.SyncRoot {
- [MonoTODO] get { throw new NotImplementedException (); }
- }
- bool ICollection.IsSynchronized {
- [MonoTODO] get { throw new NotImplementedException (); }
- }
-
-
- // --- Private Properties
-
- private bool IsFixedSize { get { return false; } }
- // private object ILList.this[int index]
- // {
- // get { return (StatusBarPanel) this[index]; }
- // set
- // {
- // string method_string = "IList.set_Item(int,object) ";
- // if (!(value is StatusBarPanel))
- // {
- // throw new ArgumentException(class_string + method_string + "panel is not a StatusBarPanel");
- // }
- // this[index] = (StatusBarPanel) value;
- // }
- // }
- }
- }
- }
|