Author: jordi
Date: 2005-04-28 11:28:32 -0400 (Thu, 28 Apr 2005)
New Revision: 43727

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/MenuAPI.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs
Log:
        * Combobox: 
                - Adjust control's height for non-simple comboboxes (bug fix)
                - Remove dead code
        * MenuAPI.cs: remove unused var
        * ScrollBar.cs: remove unsed var
                 
        * ListBox.cs: unselect items when clearing

2005-04-28  Jordi Mas i Hernandez <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-28 14:35:20 UTC (rev 43726)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-28 15:28:32 UTC (rev 43727)
@@ -1,5 +1,15 @@
 2005-04-28  Jordi Mas i Hernandez <[EMAIL PROTECTED]>
 
+       * Combobox: 
+               - Adjust control's height for non-simple comboboxes (bug fix)
+               - Remove dead code
+       * MenuAPI.cs: remove unused var
+       * ScrollBar.cs: remove unsed var
+                
+       * ListBox.cs: unselect items when clearing
+
+2005-04-28  Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
        * ListControl.cs: honors OnPositionChanged and default Selected Item
        * ListBox.cs: unselect items when clearing
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2005-04-28 14:35:20 UTC (rev 43726)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2005-04-28 15:28:32 UTC (rev 43727)
@@ -61,7 +61,7 @@
                private ComboListBox listbox_ctrl;              
                private TextBox textbox_ctrl;
                private bool process_textchanged_event;
-               private bool has_focus;
+               private bool has_focus;         
 
                internal class ComboBoxInfo
                {
@@ -71,7 +71,7 @@
                        internal Rectangle button_rect;
                        internal bool show_button;              /* Is the 
DropDown button shown? */
                        internal ButtonState button_status;     /* Drop button 
status */
-                       internal Size listbox_size;
+                       internal int original_height;           /* Control's 
height is recalculated for not Simple Styles */
                        internal Rectangle listbox_area;        /* ListBox area 
in Simple combox, not used in the rest */
                        internal bool droppeddown;              /* Is the 
associated ListBox dropped down? */
 
@@ -81,6 +81,7 @@
                                show_button = false;
                                item_height = 0;
                                droppeddown = false;
+                               original_height = -1;
                        }
                }
 
@@ -231,7 +232,11 @@
                                dropdown_style = value;                         
        
                                
                                if (dropdown_style == ComboBoxStyle.Simple) {
-                                       CBoxInfo.show_button = false;           
                        
+                                       CBoxInfo.show_button = false;
+                                       
+                                       if (combobox_info.original_height != -1)
+                                               Height = 
combobox_info.original_height;
+                                       
                                        CreateComboListBox ();
 
                                        if (IsHandleCreated == true) {
@@ -765,7 +770,8 @@
 
                protected override void OnResize (EventArgs e)
                {
-                       base.OnResize (e);                      
+                       base.OnResize (e);
+                       AdjustHeightForDropDown ();
                        CalcTextArea ();                        
                }
 
@@ -877,8 +883,25 @@
                #endregion Public Methods
 
                #region Private Methods
-               private void textbox_ctrl_KeyPress(object sender, 
KeyPressEventArgs e) {
-                       OnKeyPress(e);
+               
+               private void AdjustHeightForDropDown ()
+               {
+                       if (dropdown_style == ComboBoxStyle.Simple) 
+                               return;
+                               
+                       int new_height = combobox_info.item_height + 
ThemeEngine.Current.DrawComboBoxEditDecorationTop () +
+                               
ThemeEngine.Current.DrawComboBoxEditDecorationBottom () + 2;
+                               
+                       if (Height == new_height)
+                               return;         
+                               
+                       combobox_info.original_height = Height;
+                       Height = new_height;
+               }
+
+               private void textbox_ctrl_KeyPress(object sender, 
KeyPressEventArgs e) 
+               {
+                       OnKeyPress (e);
                }
                
                // Calcs the text area size
@@ -1405,13 +1428,7 @@
                                }
                        }
 
-                       #region Private Methods
-
-                       protected override void CreateHandle ()
-                       {                       
-                               base.CreateHandle ();                           
-                       }
-
+                       #region Private Methods                 
                        // Calcs the listbox area
                        internal void CalcListBoxArea ()
                        {                               

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2005-04-28 14:35:20 UTC (rev 43726)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2005-04-28 15:28:32 UTC (rev 43727)
@@ -210,8 +210,7 @@
                // The Point object contains screen coordinates
                static public bool TrackPopupMenu (IntPtr hTopMenu, IntPtr 
hMenu, Point pnt, bool bMenubar, Control Wnd)
                {
-                       TRACKER tracker = new TRACKER ();                       
-                       MENU top_menu = GetMenuFromID (hTopMenu);
+                       TRACKER tracker = new TRACKER ();                       
                        
                        MENU menu = null;
 
                        if (hMenu == IntPtr.Zero)       // No submenus to track

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs     
2005-04-28 14:35:20 UTC (rev 43726)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs     
2005-04-28 15:28:32 UTC (rev 43727)
@@ -1075,8 +1075,7 @@
                }                               
                
                private void UpdatePos (int newPos, bool update_thumbpos)
-               {
-                       int old = position;
+               {                       
                        int pos;
 
                        if (newPos < minimum)

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

Reply via email to