2007-04-02 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ContainerControl.cs
index 20133b043c0c7509bec2d9783e3568694aae2e35..7483eeda8efa70ace9daeb4793cf662b6964fb14 100644 (file)
@@ -69,7 +69,7 @@ namespace System.Windows.Forms {
                        }
 
                        set {
-                               if (value==null || (active_control == value)) {
+                               if (value==null || (active_control == value && active_control.Focused)) {
                                        return;
                                }
 
@@ -393,6 +393,16 @@ namespace System.Windows.Forms {
                        OnBindingContextChanged (EventArgs.Empty);
                }
 
+#if NET_2_0
+               protected override bool ProcessCmdKey (ref Message msg, Keys keyData)
+               {
+                       if (ToolStripManager.ProcessCmdKey (ref msg, keyData) == true)
+                               return true;
+                               
+                       return base.ProcessCmdKey (ref msg, keyData);
+               }
+#endif
+
                [EditorBrowsable (EditorBrowsableState.Advanced)]
                protected override bool ProcessDialogChar(char charCode) {
                        if (GetTopLevel()) {
@@ -478,10 +488,7 @@ namespace System.Windows.Forms {
                        if (Parent != null) {
                                IContainerControl parent = Parent.GetContainerControl ();
                                if (parent != null) {
-                                       if (!(directed && auto_select_child))
-                                               ContainerSelected = true;
-                                       if (!(this.Parent.ContainerSelected))
-                                               parent.ActiveControl = this;
+                                       parent.ActiveControl = this;
                                }
                        }
 
@@ -498,12 +505,6 @@ namespace System.Windows.Forms {
                protected override void WndProc(ref Message m) {
                        switch ((Msg) m.Msg) {
 
-                               case Msg.WM_LBUTTONDOWN:
-                                       OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
-                                               mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()),
-                                               HighOrder ((int) m.LParam.ToInt32 ()), 0));
-                               break;
-
                                case Msg.WM_SETFOCUS:
                                        if (active_control != null)
                                                Select (active_control);
@@ -541,7 +542,16 @@ namespace System.Windows.Forms {
                        base.OnFontChanged (e);
                }
 
+               protected override void OnLayout (LayoutEventArgs levent)
+               {
+                       base.OnLayout (levent);
+               }
+               
                AutoValidate auto_validate = AutoValidate.Inherit;
+
+               [Browsable (false)]
+               [AmbientValue (AutoValidate.Inherit)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public virtual AutoValidate AutoValidate {
                        get {
                                return auto_validate;
@@ -565,6 +575,8 @@ namespace System.Windows.Forms {
                                eh (this, e);
                }
 
+               [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public event EventHandler AutoValidateChanged {
                        add { Events.AddHandler (OnValidateChanged, value); }
                        remove { Events.RemoveHandler (OnValidateChanged, value); }