2006-08-12 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Sat, 12 Aug 2006 19:08:31 +0000 (19:08 -0000)
committerChris Toshok <toshok@novell.com>
Sat, 12 Aug 2006 19:08:31 +0000 (19:08 -0000)
* ToolBarButton.cs: redraw the entire button if the theme tells us
to.

* Theme.cs: add ToolBarInvalidateEntireButton.

* ThemeWin32Classic.cs: we don't need to redraw the entire toolbar
buttons, just the border.

* ThemeNice.cs: redraw the entire toolbar button since we need to
draw the highlight image.

* ThemeClearlooks.cs: the rounded corners of toolbar buttons mean
we need to redraw the entire button (not just the border).

svn path=/trunk/mcs/; revision=63671

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeClearlooks.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeNice.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs

index fad83a3ebd9e7cc8940027cff2a1f68b938f59b6..33acd0c8223d2dda3f66936e605acfa6f9fcf128 100644 (file)
@@ -1,3 +1,19 @@
+2006-08-12  Chris Toshok  <toshok@ximian.com>
+
+       * ToolBarButton.cs: redraw the entire button if the theme tells us
+       to.
+
+       * Theme.cs: add ToolBarInvalidateEntireButton.
+
+       * ThemeWin32Classic.cs: we don't need to redraw the entire toolbar
+       buttons, just the border.
+
+       * ThemeNice.cs: redraw the entire toolbar button since we need to
+       draw the highlight image.
+
+       * ThemeClearlooks.cs: the rounded corners of toolbar buttons mean
+       we need to redraw the entire button (not just the border).
+
 2006-08-11  Peter Dennis Bartok  <pbartok@novell.com>
 
        * TextBoxBase.cs (CalculateScrollbars): Set the proper thumb size
index 82617862d0c90f858ac24bc9ecc6a1dcb08350d9..a57bd47421cbc5011f5f20c22b62e7479bf95149 100644 (file)
@@ -849,6 +849,7 @@ namespace System.Windows.Forms
                public abstract int ToolBarDropDownArrowWidth { get; }   // width for the dropdown arrow on the ToolBarButton
                public abstract int ToolBarDropDownArrowHeight { get; }  // height for the dropdown arrow on the ToolBarButton
                public abstract Size ToolBarDefaultSize{get;}
+               public abstract bool ToolBarInvalidateEntireButton { get; }
                #endregion      // ToolBar
 
                #region ToolTip
index 1c146f4a27c0ecf750a2c8379b8b2cadd7dc1d9f..f9a4f0334dbb01f7303da297f88a7dcaa02f7b30 100644 (file)
@@ -1788,6 +1788,12 @@ namespace System.Windows.Forms {
                        lgbr.Dispose( );
                }
                
+               #region ToolBar
+               public override bool ToolBarInvalidateEntireButton {
+                       get { return true; }
+               }
+               #endregion // ToolBar
+
                #region GroupBox
                public override void DrawGroupBox( Graphics dc,  Rectangle area, GroupBox box ) {
                        StringFormat    text_format;
index 9abbd8d9c1fc1353220d9642a204ac8978097dcc..e08aa7e6403856fec407b9ef8368697d7f6c66e5 100644 (file)
@@ -963,6 +963,10 @@ namespace System.Windows.Forms
                }
                
                #region ToolBar
+               public override bool ToolBarInvalidateEntireButton {
+                       get { return true; }
+               }
+
                public  override void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control) 
                {
                        StringFormat format = new StringFormat ();
@@ -1097,6 +1101,7 @@ namespace System.Windows.Forms
                        else
                                CPDrawStringDisabled (dc, button.Text, control.Font, ColorControlLight, button.TextRectangle, format);
                }
+
                #endregion      // ToolBar
                
 //             public override void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides) {
index 2892db57d6b2ca5e4e5693a73ba29e87220f218b..f0bdaecc570b822021251fd68afff7d5b368e7ad 100644 (file)
@@ -4009,6 +4009,11 @@ namespace System.Windows.Forms
                                return new Size (100, 42);
                        }
                }
+
+               public override bool ToolBarInvalidateEntireButton {
+                       get { return false; }
+               }
+
                #endregion      // ToolBar
 
                #region ToolTip
index 2bbbb25276a17a99d7a7df2c74cc2dc53612d1b6..ffbb23e84fc63d66900c254dab2085083eeea630 100644 (file)
@@ -374,14 +374,23 @@ namespace System.Windows.Forms
 
                internal void InvalidateBorder ()
                {
-                       if (Rectangle == Rectangle.Empty)
-                               return;
+                       if (ThemeEngine.Current.ToolBarInvalidateEntireButton) {
+                               Invalidate ();
+                       }
+                       else {
+                               if (Rectangle == Rectangle.Empty)
+                                       return;
 
-                       /* invalidate the four sides of our border */
-                       Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y - 2, Rectangle.Width + 4, 4));
-                       Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y - 2, 4, Rectangle.Height + 4));
-                       Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y + Rectangle.Height - 2, Rectangle.Width + 4, 4));
-                       Parent.Invalidate (new Rectangle (Rectangle.X + Rectangle.Width - 2, Rectangle.Y - 2, 4, Rectangle.Height + 4));
+                               /* invalidate the four sides of our border */
+                               Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y - 2,
+                                                                 Rectangle.Width + 4, 4));
+                               Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y - 2,
+                                                                 4, Rectangle.Height + 4));
+                               Parent.Invalidate (new Rectangle (Rectangle.X - 2, Rectangle.Y + Rectangle.Height - 2,
+                                                                 Rectangle.Width + 4, 4));
+                               Parent.Invalidate (new Rectangle (Rectangle.X + Rectangle.Width - 2, Rectangle.Y - 2,
+                                                                 4, Rectangle.Height + 4));
+                       }
                }
 
                void Invalidate ()