Ignore:
Timestamp:
5/2/2009 11:33:14 AM (5 years ago)
Author:
lowjoel
Message:

-Separated the ToolBar? drop-down menus from the toolbar itself - I didn't want to use the same renderer because the renderer will have to implement menu item rendering too which is what UxThemeMenuRenderer? does. But that only works on Vista+
-Fixed all the overloads for menus in UpdateControlTheme?. Menus/toolbars all use the same interface now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/ToolBar.cs

    r968 r970  
    4242        } 
    4343 
    44         private class EraserToolStripRenderer : UxThemeMenuRenderer 
     44        private class EraserToolStripRenderer : ToolStripRenderer 
    4545        { 
    4646            protected override void Initialize(ToolStrip toolStrip) 
     
    5050            } 
    5151 
     52            protected override void InitializeItem(ToolStripItem item) 
     53            { 
     54                base.InitializeItem(item); 
     55            } 
     56 
    5257            protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) 
    5358            { 
    54                 if (e.ToolStrip == owner) 
    55                     //Draw the parent background image. This is not portable in that it will render 
    56                     //this code unreusable, but for the lack of anything better this will have to suffice! 
    57                     e.Graphics.DrawImage(Properties.Resources.BackgroundGradient, 
    58                         new Point(-owner.Left, -owner.Top)); 
    59                 else 
    60                     base.OnRenderToolStripBackground(e); 
    61             } 
    62  
    63             protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) 
    64             { 
    65                 if (e.ToolStrip != owner) 
    66                     base.OnRenderMenuItemBackground(e); 
     59                //Draw the parent background image. This is not portable in that it will render 
     60                //this code unreusable, but for the lack of anything better this will have to suffice! 
     61                e.Graphics.DrawImage(Properties.Resources.BackgroundGradient, 
     62                    new Point(-owner.Left, -owner.Top)); 
    6763            } 
    6864 
    6965            protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) 
    7066            { 
    71                 if (e.ToolStrip != owner) 
    72                 { 
    73                     base.OnRenderItemText(e); 
    74                     return; 
    75                 } 
    76  
    7767                Graphics g = e.Graphics; 
    7868 
     
    111101            private readonly Color TextColour = Color.White; 
    112102 
     103            /// <summary> 
     104            /// The toolstrip using this renderer. 
     105            /// </summary> 
    113106            private ToolStrip owner; 
    114107        } 
Note: See TracChangeset for help on using the changeset viewer.