1c7546066fc7f843c525f26154b9a53baaedda31
[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         [ComVisibleAttribute (true)]
39         [ClassInterfaceAttribute (ClassInterfaceType.AutoDispatch)]
40         public sealed class SplitterPanel : Panel
41         {
42                 private SplitContainer owner;
43
44                 public SplitterPanel (SplitContainer owner)
45                 {
46                         this.owner = owner;
47                 }
48
49                 #region Public Properties
50                 // All of these are overriden just to hide them from the IDE  :/
51                 [Browsable (false)]
52                 [EditorBrowsable (EditorBrowsableState.Never)]
53                 new public AnchorStyles Anchor {
54                         get { return base.Anchor; }
55                         set { base.Anchor = value; }
56                 }
57
58                 [Browsable (false)]
59                 [EditorBrowsable (EditorBrowsableState.Never)]
60                 new public bool AutoSize {
61                         get { return base.AutoSize; }
62                         set { base.AutoSize = value; }
63                 }
64
65                 //Uncomment once this has been implemented in ContainerControl.cs
66                 //[Browsable (false)]
67                 //[EditorBrowsable (EditorBrowsableState.Never)]
68                 //[Localizable(false)]
69                 //public override AutoSizeMode AutoSizeMode {
70                 //        get { return base.AutoSizeMode; }
71                 //        set { base.AutoSizeMode = value; }
72                 //}
73
74                 [Browsable (false)]
75                 [EditorBrowsable (EditorBrowsableState.Never)]
76                 new public BorderStyle BorderStyle {
77                         get { return base.BorderStyle; }
78                         set { base.BorderStyle = value; }
79                 }
80
81                 [Browsable (false)]
82                 [EditorBrowsable (EditorBrowsableState.Never)]
83                 new public DockStyle Dock {
84                         get { return base.Dock; }
85                         set { base.Dock = value; }
86                 }
87
88                 [Browsable (false)]
89                 [EditorBrowsable (EditorBrowsableState.Never)]
90                 new public DockPaddingEdges DockPadding {
91                         get { return base.DockPadding; }
92                 }
93
94                 [Browsable (false)]
95                 [EditorBrowsable (EditorBrowsableState.Never)]
96                 new public int Height {
97                         get { return this.Visible ? base.Height : 0; }
98                         set { throw new NotSupportedException ("The height cannot be set"); }
99                 }
100
101                 [Browsable (false)]
102                 [EditorBrowsable (EditorBrowsableState.Never)]
103                 new public Point Location {
104                         get { return base.Location; }
105                         set { base.Location = value; }
106                 }
107
108                 [Browsable (false)]
109                 [EditorBrowsable (EditorBrowsableState.Never)]
110                 new public Size MaximumSize {
111                         get { return base.MaximumSize; }
112                         set { base.MaximumSize = value; }
113                 }
114
115                 [Browsable (false)]
116                 [EditorBrowsable (EditorBrowsableState.Never)]
117                 new public Size MinimumSize {
118                         get { return base.MinimumSize; }
119                         set { base.MinimumSize = value; }
120                 }
121
122                 [Browsable (false)]
123                 [EditorBrowsable (EditorBrowsableState.Never)]
124                 new public string Name {
125                         get { return base.name; }
126                         set { base.name = value; }
127                 }
128
129                 [Browsable (false)]
130                 [EditorBrowsable (EditorBrowsableState.Never)]
131                 new public Control Parent {
132                         get { return base.Parent; }
133                         set { throw new NotSupportedException ("The parent cannot be set"); }
134                 }
135
136                 [Browsable (false)]
137                 [EditorBrowsable (EditorBrowsableState.Never)]
138                 new public Size Size {
139                         get { return base.Size; }
140                         set { base.Size = value; }
141                 }
142
143                 [Browsable (false)]
144                 [EditorBrowsable (EditorBrowsableState.Never)]
145                 new public int TabIndex {
146                         get { return base.TabIndex; }
147                         set { base.TabIndex = value; }
148                 }
149
150                 [Browsable (false)]
151                 [EditorBrowsable (EditorBrowsableState.Never)]
152                 new public bool TabStop {
153                         get { return base.TabStop; }
154                         set { base.TabStop = value; }
155                 }
156
157                 [Browsable (false)]
158                 [EditorBrowsable (EditorBrowsableState.Never)]
159                 new public bool Visible {
160                         get { return base.Visible; }
161                         set { base.Visible = value; }
162                 }
163
164                 [Browsable (false)]
165                 [EditorBrowsable (EditorBrowsableState.Never)]
166                 new public int Width {
167                         get { return this.Visible ? base.Width : 0; }
168                         set { throw new NotSupportedException ("The width cannot be set"); }
169                 }
170                 #endregion
171
172                 #region Internal Properties
173                 internal int InternalHeight { set { base.Height = value; } }
174
175                 internal int InternalWidth { set { base.Width = value; } }
176                 #endregion
177         }
178 }
179 #endif