Commit a bunch of stubs I did months ago, might be useful to someone picking it up
authorMiguel de Icaza <miguel@gnome.org>
Mon, 27 Feb 2006 21:36:53 +0000 (21:36 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 27 Feb 2006 21:36:53 +0000 (21:36 -0000)
svn path=/trunk/mcs/; revision=57355

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnStyle.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEngine.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutSettings.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/RowStyle.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/SizeType.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayout.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanelGrowStyle.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutSettings.cs [new file with mode: 0644]

diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnStyle.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnStyle.cs
new file mode 100644 (file)
index 0000000..a2f0fc1
--- /dev/null
@@ -0,0 +1,57 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+
+namespace System.Windows.Forms {
+
+       public class ColumnStyle : TableLayoutSettings.Style {
+               float width;
+               
+               public ColumnStyle ()
+               {
+               }
+
+               public ColumnStyle (SizeType st) 
+               {
+                       size_type = st;
+               }
+
+               public ColumnStyle (SizeType st, float width)
+               {
+                       size_type = st;
+                       this.width = width;
+               }
+
+               public float Width {
+                       get {
+                               return width;
+                       }
+
+                       set {
+                               width = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEngine.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEngine.cs
new file mode 100644 (file)
index 0000000..1d8a23e
--- /dev/null
@@ -0,0 +1,43 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+using System;
+using System.ComponentModel;
+
+namespace System.Windows.Forms.Layout {
+
+       public abstract class LayoutEngine {
+               
+               public virtual void InitLayout (object child, BoundsSpecified specified)
+               {
+               }
+
+               public virtual bool Layout (object container, LayoutEventArgs args)
+               {
+                       return false;
+               }
+       }
+}
+
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutSettings.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutSettings.cs
new file mode 100644 (file)
index 0000000..3fbded3
--- /dev/null
@@ -0,0 +1,39 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+using System;
+using System.ComponentModel;
+using System.Windows.Forms.Layout;
+
+namespace System.Windows.Forms {
+
+       public abstract class LayoutSettings {
+               public virtual LayoutEngine LayoutEngine {
+                       get {
+                               return null;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RowStyle.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RowStyle.cs
new file mode 100644 (file)
index 0000000..83e1f49
--- /dev/null
@@ -0,0 +1,57 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+
+namespace System.Windows.Forms {
+
+       public class RowStyle : TableLayoutSettings.Style {
+               float height;
+               
+               public RowStyle ()
+               {
+               }
+
+               public RowStyle (SizeType st) 
+               {
+                       size_type = st;
+               }
+
+               public RowStyle (SizeType st, float height)
+               {
+                       size_type = st;
+                       this.height = height;
+               }
+
+               public float Height {
+                       get {
+                               return height;
+                       }
+
+                       set {
+                               height = value;
+                       }
+               }
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SizeType.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SizeType.cs
new file mode 100644 (file)
index 0000000..7fcb66e
--- /dev/null
@@ -0,0 +1,33 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+
+namespace System.Windows.Forms {
+       public enum SizeType {
+               AutoSize = 0,
+               Absolute = 1,
+               Percent = 2
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayout.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayout.cs
new file mode 100644 (file)
index 0000000..05fb95b
--- /dev/null
@@ -0,0 +1,43 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+using System;
+using System.ComponentModel;
+using System.Windows.Forms.Layout;
+
+namespace System.Windows.Forms {
+
+       public class TableLayout : LayoutEngine {
+
+               public override void InitLayout (object child, BoundsSpecified specified)
+               {
+               }
+
+               public override bool Layout (object container, LayoutEventArgs args)
+               {
+                       return false;
+               }
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs
new file mode 100644 (file)
index 0000000..780fcd9
--- /dev/null
@@ -0,0 +1,85 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+using System;
+using System.ComponentModel;
+
+namespace System.Windows.Forms {
+
+       public class TableLayoutPanel : Panel, IExtenderProvider {
+               TableLayoutSettings settings;
+               
+               public TableLayoutPanel ()
+               {
+                       settings = new TableLayoutSettings (this);
+               }
+
+               internal void Relayout ()
+               {
+               }
+               
+#region Proxy Properties
+               new public BorderStyle BorderStyle {
+                       get {
+                               return base.BorderStyle;
+                       }
+
+                       set {
+                               base.BorderStyle = value;
+                       }
+               }
+
+               public int ColumnCount {
+                       get {
+                               return settings.ColumnCount;
+                       }
+
+                       set {
+                               settings.ColumnCount = value;
+                       }
+               }
+
+               public int RowCount {
+                       get {
+                               return settings.RowCount;
+                       }
+
+                       set {
+                               settings.RowCount = value;
+                       }
+               }
+#endregion
+               
+#region IExtenderProvider
+               bool IExtenderProvider.CanExtend (object extendee)
+               {
+                       //
+                       // Read: `Implementing an Extender Provider'
+                       //
+                       throw new NotImplementedException ();
+               }
+#endregion
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanelGrowStyle.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanelGrowStyle.cs
new file mode 100644 (file)
index 0000000..1c50a7a
--- /dev/null
@@ -0,0 +1,33 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+
+namespace System.Windows.Forms {
+       public enum TableLayoutPanelGrowStyle {
+               FixedSize,
+               AddRows,
+               AddColumns,
+       }
+}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutSettings.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutSettings.cs
new file mode 100644 (file)
index 0000000..c9657c5
--- /dev/null
@@ -0,0 +1,206 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+// Author:
+//   Miguel de Icaza (miguel@gnome.org)
+//
+// (C) 2004 Novell, Inc.
+//
+using System;
+using System.ComponentModel;
+using System.Collections;
+using System.Windows.Forms.Layout;
+
+namespace System.Windows.Forms {
+
+       public class TableLayoutSettings : LayoutSettings {
+               TableLayoutPanel panel;
+               ColumnStyleCollection column_style;
+               TableLayoutPanelGrowStyle grow_style;
+               int column_count;
+               int row_count;
+
+               // Statics
+               static LayoutEngine layout_engine = new TableLayout ();
+               
+               internal TableLayoutSettings (TableLayoutPanel panel)
+               {
+                       this.panel = panel;
+                       column_count = 0;
+                       row_count = 0;
+                       grow_style = TableLayoutPanelGrowStyle.AddRows;
+                       column_style = new ColumnStyleCollection (panel);
+               }
+
+               public int ColumnCount {
+                       get {
+                               return column_count;
+                       }
+
+                       set {
+                               column_count = value;
+                       }
+               }
+
+               public int RowCount {
+                       get {
+                               return row_count;
+                       }
+
+                       set {
+                               row_count = value;
+                       }
+               }
+
+               public TableLayoutPanelGrowStyle GrowStyle {
+                       get {
+                               return grow_style;
+                       }
+               }
+
+               public override LayoutEngine LayoutEngine {
+                       get {
+                               return layout_engine;
+                       }
+               }
+                               
+               public TableLayoutSettings.ColumnStyleCollection ColumnStyle {
+                       get {
+                               return column_style;
+                       }
+               }
+
+               public abstract class StyleCollection {
+                       ArrayList al = new ArrayList ();
+                       TableLayoutPanel table;
+                       
+                       internal StyleCollection (TableLayoutPanel table)
+                       {
+                               this.table = table;
+                       }
+                       
+                       public int Add (TableLayoutSettings.Style style)
+                       {
+                               return al.Add (style);
+                       }
+
+                       // FIXME; later this should be an override.
+                       public void Clear ()
+                       {
+                               al.Clear ();
+
+                               // FIXME: Need to investigate what happens when the style is gone.
+                               table.Relayout ();
+                       }
+
+#region IList methods
+                       //
+                       // The IList methods will later be implemeneted, this is to get us started
+                       //
+                       internal bool Contains (Style style)
+                       {
+                               return al.Contains (style);
+                       }
+
+                       internal int IndexOf (Style style)
+                       {
+                               return al.IndexOf (style);
+                       }
+
+                       internal void Insert (int index, Style style)
+                       {
+                               al.Insert (index, style);
+                       }
+
+                       internal void Remove (Style style)
+                       {
+                               al.Remove (style);
+                       }
+
+#endregion
+                       public Style this [int idx] {
+                               get {
+                                       return (Style) al [idx];
+                               }
+
+                               set {
+                                       al [idx] = value;
+                               }
+                       }
+               }
+               
+               public class ColumnStyleCollection : StyleCollection {
+
+                       internal ColumnStyleCollection (TableLayoutPanel panel) : base (panel)
+                       {
+                       }
+                       
+                       public void Add (ColumnStyle style)
+                       {
+                               base.Add (style);
+                       }
+
+                       public bool Contains (ColumnStyle style)
+                       {
+                               return base.Contains (style);
+                       }
+
+                       public int IndexOf (ColumnStyle style)
+                       {
+                               return base.IndexOf (style);
+                       }
+
+                       public void Insert (int index, ColumnStyle style)
+                       {
+                               base.Insert (index, style);
+                       }
+
+                       public void Remove (ColumnStyle style)
+                       {
+                               base.Remove (style);
+                       }
+
+                       public new ColumnStyle this [int index] {
+                               get {
+                                       return (ColumnStyle) base [index];
+                               }
+
+                               set {
+                                       base [index] = value;
+                               }
+                       }
+               }
+
+               public class Style {
+                       internal SizeType size_type;
+                       
+                       public SizeType SizeType {
+                               get {
+                                       return size_type;
+                               }
+
+                               set {
+                                       size_type = value;
+                               }
+                       }
+               }
+       }
+
+}