In corlib/System.Runtime.InteropServices:
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / SplitterPanel.cs
1 //
2 // SplitterPanel.cs
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
11 // 
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
14 // 
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 //
23 // Copyright (c) 2006 Jonathan Pobst
24 //
25 // Authors:
26 //      Jonathan Pobst (monkey@jpobst.com)
27 //
28
29 #if NET_2_0
30 using System;
31 using System.Runtime.InteropServices;
32 using System.ComponentModel;
33 using System.Drawing;
34 using System.Drawing.Drawing2D;
35
36 namespace System.Windows.Forms
37 {
38         [ToolboxItem (false)]
39         [ComVisibleAttribute (true)]
40         [ClassInterfaceAttribute (ClassInterfaceType.AutoDispatch)]
41         [Docking (DockingBehavior.Never)]
42         public sealed class SplitterPanel : Panel
43         {
44                 //private SplitContainer owner;
45
46                 public SplitterPanel (SplitContainer owner)
47                 {
48                         //this.owner = owner;
49                 }
50
51                 #region Public Properties
52                 // All of these are overriden just to hide them from the IDE  :/
53                 [Browsable (false)]
54                 [EditorBrowsable (EditorBrowsableState.Never)]
55                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
56                 new public AnchorStyles Anchor {
57                         get { return base.Anchor; }
58                         set { base.Anchor = value; }
59                 }
60
61                 [Browsable (false)]
62                 [EditorBrowsable (EditorBrowsableState.Never)]
63                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
64                 new public bool AutoSize {
65                         get { return base.AutoSize; }
66                         set { base.AutoSize = value; }
67                 }
68
69                 //Uncomment once this has been implemented in ContainerControl.cs
70                 //[Browsable (false)]
71                 //[EditorBrowsable (EditorBrowsableState.Never)]
72                 //[Localizable(false)]
73                 //public override AutoSizeMode AutoSizeMode {
74                 //        get { return base.AutoSizeMode; }
75                 //        set { base.AutoSizeMode = value; }
76                 //}
77
78                 [Browsable (false)]
79                 [EditorBrowsable (EditorBrowsableState.Never)]
80                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
81                 new public BorderStyle BorderStyle {
82                         get { return base.BorderStyle; }
83                         set { base.BorderStyle = value; }
84                 }
85
86                 [Browsable (false)]
87                 [EditorBrowsable (EditorBrowsableState.Never)]
88                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
89                 new public DockStyle Dock {
90                         get { return base.Dock; }
91                         set { base.Dock = value; }
92                 }
93
94                 [Browsable (false)]
95                 [EditorBrowsable (EditorBrowsableState.Never)]
96                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
97                 new public DockPaddingEdges DockPadding {
98                         get { return base.DockPadding; }
99                 }
100
101                 [Browsable (false)]
102                 [EditorBrowsable (EditorBrowsableState.Always)]
103                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
104                 new public int Height {
105                         get { return this.Visible ? base.Height : 0; }
106                         set { throw new NotSupportedException ("The height cannot be set"); }
107                 }
108
109                 [Browsable (false)]
110                 [EditorBrowsable (EditorBrowsableState.Never)]
111                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
112                 new public Point Location {
113                         get { return base.Location; }
114                         set { base.Location = value; }
115                 }
116
117                 [Browsable (false)]
118                 [EditorBrowsable (EditorBrowsableState.Never)]
119                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
120                 new public Size MaximumSize {
121                         get { return base.MaximumSize; }
122                         set { base.MaximumSize = value; }
123                 }
124
125                 [Browsable (false)]
126                 [EditorBrowsable (EditorBrowsableState.Never)]
127                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
128                 new public Size MinimumSize {
129                         get { return base.MinimumSize; }
130                         set { base.MinimumSize = value; }
131                 }
132
133                 [Browsable (false)]
134                 [EditorBrowsable (EditorBrowsableState.Never)]
135                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
136                 new public string Name {
137                         get { return base.Name; }
138                         set { base.Name = value; }
139                 }
140
141                 [Browsable (false)]
142                 [EditorBrowsable (EditorBrowsableState.Never)]
143                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
144                 new public Control Parent {
145                         get { return base.Parent; }
146                         set { throw new NotSupportedException ("The parent cannot be set"); }
147                 }
148
149                 [Browsable (false)]
150                 [EditorBrowsable (EditorBrowsableState.Never)]
151                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
152                 new public Size Size {
153                         get { return base.Size; }
154                         set { base.Size = value; }
155                 }
156
157                 [Browsable (false)]
158                 [EditorBrowsable (EditorBrowsableState.Never)]
159                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
160                 new public int TabIndex {
161                         get { return base.TabIndex; }
162                         set { base.TabIndex = value; }
163                 }
164
165                 [Browsable (false)]
166                 [EditorBrowsable (EditorBrowsableState.Never)]
167                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
168                 new public bool TabStop {
169                         get { return base.TabStop; }
170                         set { base.TabStop = value; }
171                 }
172
173                 [Browsable (false)]
174                 [EditorBrowsable (EditorBrowsableState.Never)]
175                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
176                 new public bool Visible {
177                         get { return base.Visible; }
178                         set { base.Visible = value; }
179                 }
180
181                 [Browsable (false)]
182                 [EditorBrowsable (EditorBrowsableState.Always)]
183                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
184                 new public int Width {
185                         get { return this.Visible ? base.Width : 0; }
186                         set { throw new NotSupportedException ("The width cannot be set"); }
187                 }
188                 #endregion
189
190                 #region Public Events
191                 [Browsable (false)]
192                 [EditorBrowsable (EditorBrowsableState.Never)]
193                 public new event EventHandler AutoSizeChanged {
194                         add { base.AutoSizeChanged += value; }
195                         remove { base.AutoSizeChanged -= value; }
196                 }
197
198                 [Browsable (false)]
199                 [EditorBrowsable (EditorBrowsableState.Never)]
200                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
201                 public new event EventHandler DockChanged {
202                         add { base.DockChanged += value; }
203                         remove { base.DockChanged -= value; }
204                 }
205
206                 [Browsable (false)]
207                 [EditorBrowsable (EditorBrowsableState.Never)]
208                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
209                 public new event EventHandler LocationChanged {
210                         add { base.LocationChanged += value; }
211                         remove { base.LocationChanged -= value; }
212                 }
213
214                 [Browsable (false)]
215                 [EditorBrowsable (EditorBrowsableState.Never)]
216                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
217                 public new event EventHandler TabIndexChanged {
218                         add { base.TabIndexChanged += value; }
219                         remove { base.TabIndexChanged -= value; }
220                 }
221
222                 [Browsable (false)]
223                 [EditorBrowsable (EditorBrowsableState.Never)]
224                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
225                 public new event EventHandler TabStopChanged {
226                         add { base.TabStopChanged += value; }
227                         remove { base.TabStopChanged -= value; }
228                 }
229
230                 [Browsable (false)]
231                 [EditorBrowsable (EditorBrowsableState.Never)]
232                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
233                 public new event EventHandler VisibleChanged {
234                         add { base.VisibleChanged += value; }
235                         remove { base.VisibleChanged -= value; }
236                 }
237                 #endregion
238
239                 #region Protected Properties
240                 protected override Padding DefaultMargin { get { return new Padding (0); } }
241                 #endregion
242                 
243                 #region Internal Properties
244                 internal int InternalHeight { set { base.Height = value; } }
245                 internal int InternalWidth { set { base.Width = value; } }
246                 #endregion
247         }
248 }
249 #endif