Author: everaldo
Date: 2007-01-02 02:51:44 -0500 (Tue, 02 Jan 2007)
New Revision: 70336

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuGlyph.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2007-01-02  Everaldo Canuto  <[EMAIL PROTECTED]>

        * ThemeWin32Classic.cs:
        - Fix popup menu size adding one pixel on the top.
        - Down menu item border from two to one to mimic Win32.
        - Some source identation fixes. 



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-01-02 06:58:06 UTC (rev 70335)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-01-02 07:51:44 UTC (rev 70336)
@@ -1,3 +1,10 @@
+2007-01-02  Everaldo Canuto  <[EMAIL PROTECTED]>
+
+       * ThemeWin32Classic.cs:
+       - Fix popup menu size adding one pixel on the top.
+       - Down menu item border from two to one to mimic Win32.
+       - Some source identation fixes. 
+
 2007-01-01  Everaldo Canuto  <[EMAIL PROTECTED]>
 
        * ThemeWin32Classic.cs: Use float numbers to calculate size and

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuGlyph.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuGlyph.cs     
2007-01-02 06:58:06 UTC (rev 70335)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuGlyph.cs     
2007-01-02 07:51:44 UTC (rev 70336)
@@ -27,10 +27,10 @@
 
 namespace System.Windows.Forms {
        public enum MenuGlyph {
-               Arrow           = 0,
-               Min             = 0,
-               Checkmark       = 1,
-               Bullet          = 2,
-               Max             = 2
+               Arrow     = 0,
+               Min       = 0,
+               Checkmark = 1,
+               Bullet    = 2,
+               Max       = 2
        }
 }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-01-02 06:58:06 UTC (rev 70335)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-01-02 07:51:44 UTC (rev 70336)
@@ -59,8 +59,8 @@
                const int SEPARATOR_MIN_WIDTH = 20;
                const int SM_CXBORDER = 1;
                const int SM_CYBORDER = 1;              
-               const int MENU_TAB_SPACE = 8;           // Pixels added to the 
width of an item because of a tab
-               const int MENU_BAR_ITEMS_SPACE = 8;     // Space between menu 
bar items
+               const int MENU_TAB_SPACE = 8;           // Pixels added to the 
width of an item because of a tab
+               const int MENU_BAR_ITEMS_SPACE = 8;     // Space between menu 
bar items
 
                #region Principal Theme Methods
                public ThemeWin32Classic ()
@@ -2164,7 +2164,7 @@
                        menu.Height = 0;
 
                        while (start < menu.MenuItems.Count) {
-                               y = 2;
+                               y = 3;
                                max = 0;
                                for (i = start; i < menu.MenuItems.Count; i++) {
                                        MenuItem item = menu.MenuItems [i];
@@ -2196,7 +2196,7 @@
                        menu.Height += 2;
 
                        menu.Width += SM_CXBORDER;
-                       menu.Height += SM_CYBORDER;
+               menu.Height += SM_CYBORDER;
                }
                
                // Draws a menu bar in a window
@@ -2230,6 +2230,7 @@
                                bg_color = Color.White;
                        else
                                bg_color = Color.Black;
+                       
                        Bitmap  bmp = new Bitmap (size.Width, size.Height);
                        Graphics gr = Graphics.FromImage (bmp);
                        Rectangle rect = new Rectangle (Point.Empty, size);
@@ -2237,6 +2238,7 @@
                        CPDrawMenuGlyph (gr, rect, glyph, color);
                        bmp.MakeTransparent (bg_color);
                        gr.Dispose ();
+                       
                        return bmp;
                }
 
@@ -2271,8 +2273,8 @@
                        if (item.BarBreak) { /* Draw vertical break bar*/
                                Rectangle rect = e.Bounds;
                                rect.Y++;
-                               rect.Width = 3;
-                               rect.Height = item.MenuHeight - 6;
+                               rect.Width = 3;
+                               rect.Height = item.MenuHeight - 6;
 
                                e.Graphics.DrawLine (SystemPens.ControlDark,
                                        rect.X, rect.Y , rect.X, rect.Y + 
rect.Height);
@@ -2299,11 +2301,8 @@
                        }
 
                        /* Draw background */
-                       Rectangle rect_back = e.Bounds;
-                       rect_back.X++;
-                       rect_back.Width -=2;
                        if (!item.MenuBar)
-                               e.Graphics.FillRectangle (brush_back, 
rect_back);
+                               e.Graphics.FillRectangle (brush_back, e.Bounds);
                        
                        if (item.Enabled) {
                                e.Graphics.DrawString (item.Text, e.Font,
@@ -2328,7 +2327,7 @@
                                                border_style = 
Border3DStyle.SunkenOuter;
                                        
                                        if (border_style != 
Border3DStyle.Adjust)
-                                               CPDrawBorder3D(e.Graphics, 
rect_back, border_style,  Border3DSide.Left | Border3DSide.Right | 
Border3DSide.Top | Border3DSide.Bottom, ColorMenu);
+                                               CPDrawBorder3D(e.Graphics, 
e.Bounds, border_style,  Border3DSide.Left | Border3DSide.Right | 
Border3DSide.Top | Border3DSide.Bottom, ColorMenu);
                                }
                        } else {
                                if ((item.Status & DrawItemState.Selected) != 
DrawItemState.Selected) {

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

Reply via email to