* X11Keyboard.cs: Detect and use the num lock mask.
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ContainerControl.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) 2004 Novell, Inc.
21 //
22 // Authors:
23 //      Peter Bartok    pbartok@novell.com
24 //
25 //
26 // $Revision: 1.3 $
27 // $Modtime: $
28 // $Log: ContainerControl.cs,v $
29 // Revision 1.3  2004/11/08 20:36:11  pbartok
30 // - Implemented BindingContext
31 // - Implemented ParentForm
32 //
33 // Revision 1.2  2004/08/11 22:20:59  pbartok
34 // - Signature fixes
35 //
36 // Revision 1.1  2004/07/09 05:21:25  pbartok
37 // - Initial check-in
38 //
39 //
40
41 // NOT COMPLETE
42
43 namespace System.Windows.Forms {
44         public class ContainerControl : ScrollableControl, IContainerControl {
45                 private Control active_control;
46                 private Control focused_control;
47
48                 #region Public Constructors
49                 public ContainerControl() {
50                 }
51                 #endregion      // Public Constructors
52
53                 #region Public Instance Properties
54                 public Control ActiveControl {
55                         get {
56                                 return active_control;
57                         }
58
59                         set {
60                                 if ((active_control==value) || (value==null)) {
61                                         return;
62                                 }
63
64                                 if (!Contains(value)) {
65                                         throw new ArgumentException("Not a child control");
66                                 }
67
68                                 XplatUI.Activate(active_control.window.Handle);
69                         }
70                 }
71
72                 public override BindingContext BindingContext {
73                         get {
74                                 if (base.BindingContext == null) {
75                                         base.BindingContext = new BindingContext();
76                                 }
77                                 return base.BindingContext;
78                         }
79
80                         set {
81                                 base.BindingContext = value;
82                         }
83                 }
84
85                 public Form ParentForm {
86                         get {
87                                 Control parent;
88
89                                 parent = this.parent;
90
91                                 while (parent != null) {
92                                         if (parent is Form) {
93                                                 return (Form)parent;
94                                         }
95                                         parent = parent.parent;
96                                 }
97
98                                 return null;
99                         }
100                 }
101                 #endregion      // Public Instance Properties
102
103                 #region Protected Instance Methods
104                 protected override CreateParams CreateParams {
105                         get {
106                                 return base.CreateParams;
107                         }
108                 }
109                 #endregion      // Public Instance Methods
110
111                 #region Public Instance Methods
112                 public bool Validate() {
113                         throw new NotImplementedException();
114                 }
115
116                 bool IContainerControl.ActivateControl(Control control) {
117                         throw new NotImplementedException();
118                 }
119                 #endregion      // Public Instance Methods
120
121                 #region Protected Instance Methods
122                 protected override void AdjustFormScrollbars(bool displayScrollbars) {
123                 }
124
125                 protected override void Dispose(bool disposing) {
126                 }
127
128                 protected override void OnControlRemoved(ControlEventArgs e) {
129                 }
130
131                 protected override void OnCreateControl() {
132                 }
133
134                 protected override bool ProcessDialogChar(char charCode) {
135                         throw new NotImplementedException();
136                 }
137
138                 protected override bool ProcessDialogKey(Keys keyData) {
139                         throw new NotImplementedException();
140                 }
141
142                 protected override bool ProcessMnemonic(char charCode) {
143                         throw new NotImplementedException();
144                 }
145
146                 protected virtual bool ProcessTabKey(bool forward) {
147                         throw new NotImplementedException();
148                 }
149
150                 protected override void Select(bool directed, bool forward) {
151                 }
152
153                 protected virtual void UpdateDefaultButton() {
154                 }
155
156                 protected override void WndProc(ref Message m) {
157                         base.WndProc(ref m);
158                 }
159                 #endregion      // Protected Instance Methods
160         }
161 }