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:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
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.
20 // Copyright (c) 2004 Novell, Inc.
23 // Peter Bartok pbartok@novell.com
28 // $Log: ContainerControl.cs,v $
29 // Revision 1.3 2004/11/08 20:36:11 pbartok
30 // - Implemented BindingContext
31 // - Implemented ParentForm
33 // Revision 1.2 2004/08/11 22:20:59 pbartok
36 // Revision 1.1 2004/07/09 05:21:25 pbartok
43 namespace System.Windows.Forms {
44 public class ContainerControl : ScrollableControl, IContainerControl {
45 private Control active_control;
46 private Control focused_control;
48 #region Public Constructors
49 public ContainerControl() {
51 #endregion // Public Constructors
53 #region Public Instance Properties
54 public Control ActiveControl {
56 return active_control;
60 if ((active_control==value) || (value==null)) {
64 if (!Contains(value)) {
65 throw new ArgumentException("Not a child control");
68 XplatUI.Activate(active_control.window.Handle);
72 public override BindingContext BindingContext {
74 if (base.BindingContext == null) {
75 base.BindingContext = new BindingContext();
77 return base.BindingContext;
81 base.BindingContext = value;
85 public Form ParentForm {
91 while (parent != null) {
95 parent = parent.parent;
101 #endregion // Public Instance Properties
103 #region Protected Instance Methods
104 protected override CreateParams CreateParams {
106 return base.CreateParams;
109 #endregion // Public Instance Methods
111 #region Public Instance Methods
112 public bool Validate() {
113 throw new NotImplementedException();
116 bool IContainerControl.ActivateControl(Control control) {
117 throw new NotImplementedException();
119 #endregion // Public Instance Methods
121 #region Protected Instance Methods
122 protected override void AdjustFormScrollbars(bool displayScrollbars) {
125 protected override void Dispose(bool disposing) {
128 protected override void OnControlRemoved(ControlEventArgs e) {
131 protected override void OnCreateControl() {
134 protected override bool ProcessDialogChar(char charCode) {
135 throw new NotImplementedException();
138 protected override bool ProcessDialogKey(Keys keyData) {
139 throw new NotImplementedException();
142 protected override bool ProcessMnemonic(char charCode) {
143 throw new NotImplementedException();
146 protected virtual bool ProcessTabKey(bool forward) {
147 throw new NotImplementedException();
150 protected override void Select(bool directed, bool forward) {
153 protected virtual void UpdateDefaultButton() {
156 protected override void WndProc(ref Message m) {
159 #endregion // Protected Instance Methods