* ImageList.cs: When the image stream is set pull all the images
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / MdiClient.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 // 
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 // 
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
21 //
22 // Authors:
23 //      Peter Bartok    pbartok@novell.com
24 //
25 //
26
27 // NOT COMPLETE
28
29 using System.Collections;
30 using System.ComponentModel;
31 using System.Drawing;
32
33 namespace System.Windows.Forms {
34         [DesignTimeVisible(false)]
35         [ToolboxItem(false)]
36         public sealed class MdiClient : Control {
37                 #region Local Variables
38                 #endregion      // Local Variables
39
40                 #region Public Classes
41                 public new class ControlCollection : Control.ControlCollection {
42                         MdiClient       owner;
43
44                         public ControlCollection(MdiClient owner) : base(owner) {
45                                 this.owner = owner;
46                         }
47
48                         public override void Add(Control value) {
49                                 if ((value is Form) == false || (((Form)value).IsMdiChild)) {
50                                         throw new ArgumentException("Form must be MdiChild");
51                                 }
52
53                                 for (int i=0; i<list.Count; i++) {
54                                         if (list[i]==value) {
55                                                 // Do we need to do anything here?
56                                                 return;
57                                         }
58                                 }
59                                 list.Add(value);
60                                 //((Form)value).owner=(Form)owner;
61                         }
62
63                         public override void Remove(Control value) {
64                                 //((Form)value).owner = null;
65                                 base.Remove (value);
66                         }
67                 }
68                 #endregion      // Public Classes
69
70                 #region Public Constructors
71                 public MdiClient() {
72                 }
73                 #endregion      // Public Constructors
74
75                 #region Public Instance Properties
76                 public override System.Drawing.Image BackgroundImage {
77                         get {
78                                 return base.BackgroundImage;
79                         }
80                         set {
81                                 base.BackgroundImage = value;
82                         }
83                 }
84
85                 public Form[] MdiChildren {
86                         get {
87                                 Form[]  children;
88
89                                 children = new Form[Controls.Count];
90                                 Controls.CopyTo(children, 0);
91
92                                 return children;
93                         }
94                 }
95                 #endregion      // Public Instance Properties
96
97                 #region Protected Instance Properties
98                 protected override CreateParams CreateParams {
99                         get {
100                                 XplatUIWin32.CLIENTCREATESTRUCT ccs;
101                                 CreateParams                    cp;
102
103                                 cp = base.CreateParams;
104
105                                 if (parent != null) {
106                                         cp.X = 0;
107                                         cp.Y = 0;
108                                         cp.Width = parent.Width;
109                                         cp.Height = parent.Height;
110                                 }
111
112
113                                 ccs = new System.Windows.Forms.XplatUIWin32.CLIENTCREATESTRUCT();
114                                 ccs.hWindowMenu = IntPtr.Zero;
115                                 ccs.idFirstChild = 27577;
116                                 cp.Param = ccs;
117
118                                 cp.ClassName = "MDICLIENT";
119                                 cp.Style |= (int)(WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE);
120                                 cp.ExStyle |= (int)WindowStyles.WS_EX_MDICHILD;
121
122                                 return cp;
123                         }
124                 }
125                 #endregion      // Protected Instance Properties
126
127                 #region Public Instance Methods
128                 public void LayoutMdi(MdiLayout value) {
129                         throw new NotImplementedException();
130                 }
131                 #endregion      // Public Instance Methods
132
133                 #region Protected Instance Methods
134                 #endregion      // Protected Instance Methods
135         }
136 }