Author: jackson
Date: 2005-09-27 17:20:59 -0400 (Tue, 27 Sep 2005)
New Revision: 50893

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
Log:

        * ListBox.cs:
        * ListView.cs:
        * TextBoxBase.cs:
        * TreeView.cs:
        * ScrollableControl.cs:
        * ComboBox.cs: Add implicit controls using the new implict control
        functionality in ControlCollection. Also try to block multiple
        control add in a suspend/resume layout to save some cycles.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-09-27 21:19:48 UTC (rev 50892)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-09-27 21:20:59 UTC (rev 50893)
@@ -1,5 +1,16 @@
 2005-09-27  Jackson Harper  <[EMAIL PROTECTED]>
 
+       * ListBox.cs:
+       * ListView.cs:
+       * TextBoxBase.cs:
+       * TreeView.cs:
+       * ScrollableControl.cs:
+       * ComboBox.cs: Add implicit controls using the new implict control
+       functionality in ControlCollection. Also try to block multiple
+       control add in a suspend/resume layout to save some cycles.
+       
+2005-09-27  Jackson Harper  <[EMAIL PROTECTED]>
+
        * Control.cs: Add functionality to the controls collection to add
        'implicit controls' these are controls that are created by the
        containing control but should not be exposed to the user. Such as

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2005-09-27 21:19:48 UTC (rev 50892)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2005-09-27 21:20:59 UTC (rev 50893)
@@ -235,7 +235,7 @@
                                                                        
                                if (dropdown_style == ComboBoxStyle.Simple) {
                                        if (listbox_ctrl != null) {             
                                
-                                               Controls.Remove (listbox_ctrl);
+                                               Controls.RemoveImplicit 
(listbox_ctrl);
                                                listbox_ctrl.Dispose ();        
                                        
                                                listbox_ctrl = null;
                                        }
@@ -243,7 +243,7 @@
 
                                if (dropdown_style != 
ComboBoxStyle.DropDownList && value == ComboBoxStyle.DropDownList) {
                                        if (textbox_ctrl != null) {             
                                
-                                               Controls.Remove (textbox_ctrl);
+                                               Controls.RemoveImplicit 
(textbox_ctrl);
                                                textbox_ctrl.Dispose ();        
                                        
                                                textbox_ctrl = null;            
                                
                                        }
@@ -258,7 +258,7 @@
                                        CreateComboListBox ();
 
                                        if (IsHandleCreated == true) {
-                                               Controls.Add (listbox_ctrl);
+                                               Controls.AddImplicit 
(listbox_ctrl);
                                        }
                                }
                                else {
@@ -272,7 +272,7 @@
                                        textbox_ctrl.KeyPress += new 
KeyPressEventHandler(textbox_ctrl_KeyPress);
 
                                        if (IsHandleCreated == true) {
-                                               Controls.Add (textbox_ctrl);
+                                               Controls.AddImplicit 
(textbox_ctrl);
                                        }
                                }
                                
@@ -599,12 +599,12 @@
                        if (disposing == true) {
                                if (listbox_ctrl != null) {
                                        listbox_ctrl.Dispose ();
-                                       Controls.Remove (listbox_ctrl);
+                                       Controls.RemoveImplicit (listbox_ctrl);
                                        listbox_ctrl = null;
                                }                       
                        
                                if (textbox_ctrl != null) {
-                                       Controls.Remove (textbox_ctrl);
+                                       Controls.RemoveImplicit (textbox_ctrl);
                                        textbox_ctrl.Dispose ();
                                        textbox_ctrl = null;
                                }                       
@@ -782,12 +782,12 @@
                        base.OnHandleCreated (e);
 
                        if (listbox_ctrl != null) {
-                               Controls.Add (listbox_ctrl);
+                               Controls.AddImplicit (listbox_ctrl);
                                Height = combobox_info.combosimple_height;
                        }
                        
                        if (textbox_ctrl != null) {
-                               Controls.Add (textbox_ctrl);
+                               Controls.AddImplicit (textbox_ctrl);
                        }
 
                        CalcTextArea ();
@@ -1526,7 +1526,7 @@
                                                vscrollbar_ctrl.Maximum = 0;
                                                vscrollbar_ctrl.ValueChanged += 
new EventHandler (VerticalScrollEvent);
                                                
-                                               Controls.Add (vscrollbar_ctrl);
+                                               Controls.AddImplicit 
(vscrollbar_ctrl);
                                        }
                                        
                                        vscrollbar_ctrl.Height = height - 
ThemeEngine.Current.DrawComboListBoxDecorationBottom (owner.DropDownStyle) -

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs       
2005-09-27 21:19:48 UTC (rev 50892)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs       
2005-09-27 21:20:59 UTC (rev 50893)
@@ -858,8 +858,10 @@
                        base.OnHandleCreated (e);
 
                        UpdateInternalClientRect (ClientRectangle);
-                       Controls.Add (vscrollbar_ctrl);
-                       Controls.Add (hscrollbar_ctrl);
+                       SuspendLayout ();
+                       Controls.AddImplicit (vscrollbar_ctrl);
+                       Controls.AddImplicit (hscrollbar_ctrl);
+                       ResumeLayout ();
                        UpdateItemInfo (UpdateOperation.AllItems, 0, 0);
                }
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2005-09-27 21:19:48 UTC (rev 50892)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2005-09-27 21:20:59 UTC (rev 50893)
@@ -1341,8 +1341,10 @@
                protected override void OnHandleCreated (EventArgs e)
                {
                        base.OnHandleCreated (e);
-                       this.Controls.Add (this.v_scroll);
-                       this.Controls.Add (this.h_scroll);                      
+                       SuspendLayout ();
+                       Controls.AddImplicit (this.v_scroll);
+                       Controls.AddImplicit (this.h_scroll);
+                       ResumeLayout ();
                }
 
                protected override void OnHandleDestroyed (EventArgs e)

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs 
    2005-09-27 21:19:48 UTC (rev 50892)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs 
    2005-09-27 21:20:59 UTC (rev 50893)
@@ -237,33 +237,41 @@
 
                                auto_scroll = value;
                                if (!auto_scroll) {
-                                       Controls.Remove(hscrollbar);
+                                       SuspendLayout ();
+
+                                       Controls.RemoveImplicit (hscrollbar);
                                        hscrollbar.Dispose();
                                        hscrollbar = null;
 
-                                       Controls.Remove(vscrollbar);
+                                       Controls.RemoveImplicit (vscrollbar);
                                        vscrollbar.Dispose();
                                        vscrollbar = null;
 
-                                       Controls.Remove(sizegrip);
+                                       Controls.RemoveImplicit (sizegrip);
                                        sizegrip.Dispose();
                                        sizegrip = null;
+
+                                       ResumeLayout ();
                                } else {
+                                       SuspendLayout ();
+
                                        hscrollbar = new HScrollBar();
                                        hscrollbar.Visible = false;
                                        hscrollbar.ValueChanged += new 
EventHandler(HandleScrollBar);
                                        hscrollbar.Height = 
SystemInformation.HorizontalScrollBarHeight;
-                                       this.Controls.Add(hscrollbar);
+                                       this.Controls.AddImplicit (hscrollbar);
 
                                        vscrollbar = new VScrollBar();
                                        vscrollbar.Visible = false;
                                        vscrollbar.ValueChanged += new 
EventHandler(HandleScrollBar);
                                        vscrollbar.Width = 
SystemInformation.VerticalScrollBarWidth;
-                                       this.Controls.Add(vscrollbar);
+                                       this.Controls.AddImplicit (vscrollbar);
 
                                        sizegrip = new SizeGrip();
                                        sizegrip.Visible = false;
-                                       this.Controls.Add(sizegrip);
+                                       this.Controls.AddImplicit (sizegrip);
+
+                                       ResumeLayout ();
                                }
                        }
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2005-09-27 21:19:48 UTC (rev 50892)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2005-09-27 21:20:59 UTC (rev 50893)
@@ -113,9 +113,11 @@
                        vscroll.Enabled = false;
                        vscroll.Visible = false;
 
-                       this.Controls.Add(hscroll);
-                       this.Controls.Add(vscroll);
-
+                       SuspendLayout ();
+                       this.Controls.AddImplicit (hscroll);
+                       this.Controls.AddImplicit (vscroll);
+                       ResumeLayout ();
+                       
                        //SetStyle(ControlStyles.ResizeRedraw, true);
                        SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                        SetStyle(ControlStyles.UserPaint, true);

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2005-09-27 21:19:48 UTC (rev 50892)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2005-09-27 21:20:59 UTC (rev 50893)
@@ -671,8 +671,10 @@
                        vbar.ValueChanged += new EventHandler 
(VScrollBarValueChanged);
                        hbar.ValueChanged += new EventHandler 
(HScrollBarValueChanged);
 
-                       Controls.Add (vbar);
-                       Controls.Add (hbar);
+                       SuspendLayout ();
+                       Controls.AddImplicit (vbar);
+                       Controls.AddImplicit (hbar);
+                       ResumeLayout ();
                }
 
                protected override void OnHandleDestroyed (EventArgs e) {
@@ -981,7 +983,7 @@
                                edit_text_box.BorderStyle = 
BorderStyle.FixedSingle;
                                edit_text_box.KeyUp += new KeyEventHandler 
(EditTextBoxKeyDown);
                                edit_text_box.Leave += new EventHandler 
(EditTextBoxLeave);
-                               Controls.Add (edit_text_box);
+                               Controls.AddImplicit (edit_text_box);
                        }
 
                        edit_text_box.Bounds = node.Bounds;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to