Changeset 966
- Timestamp:
- 5/2/2009 8:35:52 AM (4 years ago)
- Location:
- branches/eraser6
- Files:
-
- 11 edited
-
Eraser/MainForm.Designer.cs (modified) (8 diffs)
-
Eraser/MainForm.cs (modified) (4 diffs)
-
Eraser/MainForm.resx (modified) (6 diffs)
-
Eraser/SchedulerPanel.cs (modified) (1 diff)
-
Eraser/SettingsPanel.cs (modified) (1 diff)
-
Eraser/Strings.NL.resx (modified) (1 diff)
-
Eraser/Strings.en.resx (modified) (1 diff)
-
Eraser/Strings.resx (modified) (1 diff)
-
Eraser/TaskPropertiesForm.cs (modified) (1 diff)
-
Eraser/ToolBar.cs (modified) (2 diffs)
-
Util/UxThemeAPI.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/MainForm.Designer.cs
r963 r966 53 53 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 54 54 this.contentPanel = new System.Windows.Forms.Panel(); 55 this.toolbarScheduleMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 56 this.newTaskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 57 this.toolbarHelpMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 58 this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 59 this.aboutEraserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 55 this.tbSchedule = new System.Windows.Forms.ToolStripMenuItem(); 60 56 this.notificationIcon = new System.Windows.Forms.NotifyIcon(this.components); 61 57 this.notificationMenu = new System.Windows.Forms.ContextMenuStrip(this.components); … … 65 61 this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 66 62 this.notificationIconTimer = new System.Windows.Forms.Timer(this.components); 67 this.toolbarScheduleMenu.SuspendLayout(); 68 this.toolbarHelpMenu.SuspendLayout(); 63 this.ToolBar = new Eraser.ToolBar(); 64 this.tbScheduleDropDown = new System.Windows.Forms.ToolStripMenuItem(); 65 this.newTaskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 66 this.tbSettings = new System.Windows.Forms.ToolStripMenuItem(); 67 this.tbHelp = new System.Windows.Forms.ToolStripMenuItem(); 68 this.tbHelpDropDown = new System.Windows.Forms.ToolStripMenuItem(); 69 this.checkForUpdatesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); 70 this.aboutEraserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 71 this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 69 72 this.notificationMenu.SuspendLayout(); 73 this.ToolBar.SuspendLayout(); 70 74 this.SuspendLayout(); 71 75 // … … 76 80 this.contentPanel.Name = "contentPanel"; 77 81 // 78 // toolbarScheduleMenu 79 // 80 this.toolbarScheduleMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 81 this.newTaskToolStripMenuItem}); 82 this.toolbarScheduleMenu.Name = "toolbarScheduleMenu"; 83 resources.ApplyResources(this.toolbarScheduleMenu, "toolbarScheduleMenu"); 84 // 85 // newTaskToolStripMenuItem 86 // 87 this.newTaskToolStripMenuItem.Name = "newTaskToolStripMenuItem"; 88 resources.ApplyResources(this.newTaskToolStripMenuItem, "newTaskToolStripMenuItem"); 89 this.newTaskToolStripMenuItem.Click += new System.EventHandler(this.newTaskToolStripMenuItem_Click); 90 // 91 // toolbarHelpMenu 92 // 93 this.toolbarHelpMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 94 this.checkForUpdatesToolStripMenuItem, 95 this.aboutEraserToolStripMenuItem}); 96 this.toolbarHelpMenu.Name = "toolbarHelpMenu"; 97 resources.ApplyResources(this.toolbarHelpMenu, "toolbarHelpMenu"); 98 // 99 // checkForUpdatesToolStripMenuItem 100 // 101 this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; 102 resources.ApplyResources(this.checkForUpdatesToolStripMenuItem, "checkForUpdatesToolStripMenuItem"); 103 this.checkForUpdatesToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatesToolStripMenuItem_Click); 104 // 105 // aboutEraserToolStripMenuItem 106 // 107 this.aboutEraserToolStripMenuItem.Name = "aboutEraserToolStripMenuItem"; 108 resources.ApplyResources(this.aboutEraserToolStripMenuItem, "aboutEraserToolStripMenuItem"); 109 this.aboutEraserToolStripMenuItem.Click += new System.EventHandler(this.aboutEraserToolStripMenuItem_Click); 82 // tbSchedule 83 // 84 this.tbSchedule.Image = global::Eraser.Properties.Resources.ToolbarSchedule; 85 this.tbSchedule.Name = "tbSchedule"; 86 this.tbSchedule.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); 87 resources.ApplyResources(this.tbSchedule, "tbSchedule"); 88 this.tbSchedule.Click += new System.EventHandler(this.tbSchedule_Click); 110 89 // 111 90 // notificationIcon … … 153 132 this.notificationIconTimer.Tick += new System.EventHandler(this.notificationIconTimer_Tick); 154 133 // 134 // ToolBar 135 // 136 this.ToolBar.AllowItemReorder = true; 137 resources.ApplyResources(this.ToolBar, "ToolBar"); 138 this.ToolBar.ImageScalingSize = new System.Drawing.Size(24, 24); 139 this.ToolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 140 this.tbSchedule, 141 this.tbScheduleDropDown, 142 this.tbSettings, 143 this.tbHelp, 144 this.tbHelpDropDown}); 145 this.ToolBar.Name = "ToolBar"; 146 // 147 // tbScheduleDropDown 148 // 149 this.tbScheduleDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 150 this.tbScheduleDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 151 this.newTaskToolStripMenuItem}); 152 this.tbScheduleDropDown.Image = global::Eraser.Properties.Resources.ToolbarArrow; 153 resources.ApplyResources(this.tbScheduleDropDown, "tbScheduleDropDown"); 154 this.tbScheduleDropDown.Name = "tbScheduleDropDown"; 155 this.tbScheduleDropDown.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0); 156 // 157 // newTaskToolStripMenuItem 158 // 159 this.newTaskToolStripMenuItem.Name = "newTaskToolStripMenuItem"; 160 resources.ApplyResources(this.newTaskToolStripMenuItem, "newTaskToolStripMenuItem"); 161 // 162 // tbSettings 163 // 164 this.tbSettings.Image = global::Eraser.Properties.Resources.ToolbarSettings; 165 this.tbSettings.Name = "tbSettings"; 166 resources.ApplyResources(this.tbSettings, "tbSettings"); 167 this.tbSettings.Click += new System.EventHandler(this.tbSettings_Click); 168 // 169 // tbHelp 170 // 171 this.tbHelp.Image = global::Eraser.Properties.Resources.ToolbarHelp; 172 this.tbHelp.Name = "tbHelp"; 173 this.tbHelp.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); 174 resources.ApplyResources(this.tbHelp, "tbHelp"); 175 // 176 // tbHelpDropDown 177 // 178 this.tbHelpDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; 179 this.tbHelpDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 180 this.checkForUpdatesToolStripMenuItem1, 181 this.aboutEraserToolStripMenuItem}); 182 this.tbHelpDropDown.Image = global::Eraser.Properties.Resources.ToolbarArrow; 183 resources.ApplyResources(this.tbHelpDropDown, "tbHelpDropDown"); 184 this.tbHelpDropDown.Name = "tbHelpDropDown"; 185 this.tbHelpDropDown.Padding = new System.Windows.Forms.Padding(2, 0, 4, 0); 186 // 187 // checkForUpdatesToolStripMenuItem1 188 // 189 this.checkForUpdatesToolStripMenuItem1.Name = "checkForUpdatesToolStripMenuItem1"; 190 resources.ApplyResources(this.checkForUpdatesToolStripMenuItem1, "checkForUpdatesToolStripMenuItem1"); 191 // 192 // aboutEraserToolStripMenuItem 193 // 194 this.aboutEraserToolStripMenuItem.Name = "aboutEraserToolStripMenuItem"; 195 resources.ApplyResources(this.aboutEraserToolStripMenuItem, "aboutEraserToolStripMenuItem"); 196 // 197 // checkForUpdatesToolStripMenuItem 198 // 199 this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; 200 resources.ApplyResources(this.checkForUpdatesToolStripMenuItem, "checkForUpdatesToolStripMenuItem"); 201 this.checkForUpdatesToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatesToolStripMenuItem_Click); 202 // 155 203 // MainForm 156 204 // … … 159 207 this.BackColor = System.Drawing.SystemColors.Control; 160 208 this.Controls.Add(this.contentPanel); 209 this.Controls.Add(this.ToolBar); 161 210 this.DoubleBuffered = true; 211 this.MainMenuStrip = this.ToolBar; 162 212 this.Name = "MainForm"; 163 213 this.Paint += new System.Windows.Forms.PaintEventHandler(this.MainForm_Paint); … … 165 215 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); 166 216 this.Resize += new System.EventHandler(this.MainForm_Resize); 167 this.toolbarScheduleMenu.ResumeLayout(false);168 this.toolbarHelpMenu.ResumeLayout(false);169 217 this.notificationMenu.ResumeLayout(false); 218 this.ToolBar.ResumeLayout(false); 219 this.ToolBar.PerformLayout(); 170 220 this.ResumeLayout(false); 171 221 … … 175 225 176 226 private System.Windows.Forms.Panel contentPanel; 177 private System.Windows.Forms.ContextMenuStrip toolbarScheduleMenu;178 private System.Windows.Forms.ContextMenuStrip toolbarHelpMenu;179 private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem;180 private System.Windows.Forms.ToolStripMenuItem aboutEraserToolStripMenuItem;181 private System.Windows.Forms.ToolStripMenuItem newTaskToolStripMenuItem;182 227 private System.Windows.Forms.NotifyIcon notificationIcon; 183 228 private System.Windows.Forms.Timer notificationIconTimer; … … 187 232 private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; 188 233 private System.Windows.Forms.ToolStripMenuItem hideWhenMinimisedToolStripMenuItem; 189 234 private ToolBar ToolBar; 235 private System.Windows.Forms.ToolStripMenuItem tbSchedule; 236 private System.Windows.Forms.ToolStripMenuItem tbSettings; 237 private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem; 238 private System.Windows.Forms.ToolStripMenuItem tbHelp; 239 private System.Windows.Forms.ToolStripMenuItem tbScheduleDropDown; 240 private System.Windows.Forms.ToolStripMenuItem tbHelpDropDown; 241 private System.Windows.Forms.ToolStripMenuItem newTaskToolStripMenuItem; 242 private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem1; 243 private System.Windows.Forms.ToolStripMenuItem aboutEraserToolStripMenuItem; 190 244 } 191 245 } -
branches/eraser6/Eraser/MainForm.cs
r962 r966 36 36 public partial class MainForm : Form 37 37 { 38 private ToolBar ToolBar = new ToolBar();39 38 private BasePanel CurrPage; 40 39 private SchedulerPanel SchedulerPage = new SchedulerPanel(); … … 44 43 { 45 44 InitializeComponent(); 46 UxThemeAPI.UpdateControlTheme(toolbarScheduleMenu);47 UxThemeAPI.UpdateControlTheme(toolbarHelpMenu);48 45 UxThemeAPI.UpdateControlTheme(notificationMenu); 49 46 SettingsPage.CreateControl(); … … 56 53 //Check the notification area context menu's minimise to tray item. 57 54 hideWhenMinimisedToolStripMenuItem.Checked = EraserSettings.Get().HideWhenMinimised; 58 59 //Create the toolbar control60 ToolBar.Name = "toolBar";61 ToolBar.Location = new Point(14, 27);62 ToolBar.Size = new Size(500, 26);63 ToolBar.TabIndex = 1;64 Controls.Add(ToolBar);65 66 ToolBarItem tbSchedule = new ToolBarItem();67 tbSchedule.Bitmap = Properties.Resources.ToolbarSchedule;68 tbSchedule.Text = S._("Erase Schedule");69 tbSchedule.Menu = toolbarScheduleMenu;70 tbSchedule.ToolBarItemClicked += delegate(object sender, EventArgs args)71 {72 ChangePage(MainFormPage.Scheduler);73 };74 ToolBar.Items.Add(tbSchedule);75 76 ToolBarItem tbSettings = new ToolBarItem();77 tbSettings.Bitmap = Properties.Resources.ToolbarSettings;78 tbSettings.Text = S._("Settings");79 tbSettings.ToolBarItemClicked += delegate(object sender, EventArgs args)80 {81 ChangePage(MainFormPage.Settings);82 };83 ToolBar.Items.Add(tbSettings);84 85 ToolBarItem tbHelp = new ToolBarItem();86 tbHelp.Bitmap = Properties.Resources.ToolbarHelp;87 tbHelp.Text = S._("Help");88 tbHelp.Menu = toolbarHelpMenu;89 ToolBar.Items.Add(tbHelp);90 55 91 56 //Set the docking style for each of the pages … … 227 192 Visible = false; 228 193 } 194 } 195 196 private void tbSchedule_Click(object sender, EventArgs e) 197 { 198 ChangePage(MainFormPage.Scheduler); 199 } 200 201 private void tbSettings_Click(object sender, EventArgs e) 202 { 203 ChangePage(MainFormPage.Settings); 229 204 } 230 205 -
branches/eraser6/Eraser/MainForm.resx
r963 r966 146 146 </data> 147 147 <data name=">>contentPanel.ZOrder" xml:space="preserve"> 148 <value>3</value> 149 </data> 150 <metadata name="toolbarScheduleMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 151 <value>17, 17</value> 152 </metadata> 153 <data name="newTaskToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 154 <value>125, 22</value> 155 </data> 156 <data name="newTaskToolStripMenuItem.Text" xml:space="preserve"> 157 <value>New Task</value> 158 </data> 159 <data name="toolbarScheduleMenu.Size" type="System.Drawing.Size, System.Drawing"> 160 <value>126, 26</value> 161 </data> 162 <data name=">>toolbarScheduleMenu.Name" xml:space="preserve"> 163 <value>toolbarScheduleMenu</value> 164 </data> 165 <data name=">>toolbarScheduleMenu.Type" xml:space="preserve"> 166 <value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 167 </data> 168 <metadata name="toolbarHelpMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 169 <value>189, 17</value> 170 </metadata> 171 <data name="checkForUpdatesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 172 <value>171, 22</value> 173 </data> 174 <data name="checkForUpdatesToolStripMenuItem.Text" xml:space="preserve"> 175 <value>Check for Updates</value> 176 </data> 177 <data name="aboutEraserToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 178 <value>171, 22</value> 179 </data> 180 <data name="aboutEraserToolStripMenuItem.Text" xml:space="preserve"> 181 <value>About Eraser</value> 182 </data> 183 <data name="toolbarHelpMenu.Size" type="System.Drawing.Size, System.Drawing"> 184 <value>172, 48</value> 185 </data> 186 <data name=">>toolbarHelpMenu.Name" xml:space="preserve"> 187 <value>toolbarHelpMenu</value> 188 </data> 189 <data name=">>toolbarHelpMenu.Type" xml:space="preserve"> 190 <value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 148 <value>1</value> 149 </data> 150 <data name="tbSchedule.Size" type="System.Drawing.Size, System.Drawing"> 151 <value>117, 28</value> 152 </data> 153 <data name="tbSchedule.Text" xml:space="preserve"> 154 <value>Erase Schedule</value> 191 155 </data> 192 156 <metadata name="notificationIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 193 <value> 337, 17</value>157 <value>110, 17</value> 194 158 </metadata> 195 159 <metadata name="notificationMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 196 <value> 640, 17</value>160 <value>413, 17</value> 197 161 </metadata> 198 162 <data name="openEraserToolStripMenuItem.Font" type="System.Drawing.Font, System.Drawing"> … … 221 185 </data> 222 186 <data name="notificationMenu.Size" type="System.Drawing.Size, System.Drawing"> 223 <value>193, 98</value>187 <value>193, 76</value> 224 188 </data> 225 189 <data name=">>notificationMenu.Name" xml:space="preserve"> … … 1796 1760 </data> 1797 1761 <metadata name="notificationIconTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 1798 <value> 473, 17</value>1762 <value>246, 17</value> 1799 1763 </metadata> 1764 <metadata name="ToolBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 1765 <value>17, 17</value> 1766 </metadata> 1767 <data name="ToolBar.AutoSize" type="System.Boolean, mscorlib"> 1768 <value>False</value> 1769 </data> 1770 <data name="ToolBar.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> 1771 <value>None</value> 1772 </data> 1773 <data name="newTaskToolStripMenuItem.ShortcutKeys" type="System.Windows.Forms.Keys, System.Windows.Forms"> 1774 <value>Ctrl+N</value> 1775 </data> 1776 <data name="newTaskToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1777 <value>168, 22</value> 1778 </data> 1779 <data name="newTaskToolStripMenuItem.Text" xml:space="preserve"> 1780 <value>New Task</value> 1781 </data> 1782 <data name="tbScheduleDropDown.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing"> 1783 <value>BottomCenter</value> 1784 </data> 1785 <data name="tbScheduleDropDown.ImageScaling" type="System.Windows.Forms.ToolStripItemImageScaling, System.Windows.Forms"> 1786 <value>None</value> 1787 </data> 1788 <data name="tbScheduleDropDown.Size" type="System.Drawing.Size, System.Drawing"> 1789 <value>20, 28</value> 1790 </data> 1791 <data name="tbScheduleDropDown.Text" xml:space="preserve"> 1792 <value>Erase Schedule</value> 1793 </data> 1794 <data name="tbSettings.Size" type="System.Drawing.Size, System.Drawing"> 1795 <value>85, 28</value> 1796 </data> 1797 <data name="tbSettings.Text" xml:space="preserve"> 1798 <value>Settings</value> 1799 </data> 1800 <data name="tbHelp.Size" type="System.Drawing.Size, System.Drawing"> 1801 <value>64, 28</value> 1802 </data> 1803 <data name="tbHelp.Text" xml:space="preserve"> 1804 <value>Help</value> 1805 </data> 1806 <data name="checkForUpdatesToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing"> 1807 <value>171, 22</value> 1808 </data> 1809 <data name="checkForUpdatesToolStripMenuItem1.Text" xml:space="preserve"> 1810 <value>Check for Updates</value> 1811 </data> 1812 <data name="aboutEraserToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1813 <value>171, 22</value> 1814 </data> 1815 <data name="aboutEraserToolStripMenuItem.Text" xml:space="preserve"> 1816 <value>About Eraser</value> 1817 </data> 1818 <data name="tbHelpDropDown.ImageScaling" type="System.Windows.Forms.ToolStripItemImageScaling, System.Windows.Forms"> 1819 <value>None</value> 1820 </data> 1821 <data name="tbHelpDropDown.Size" type="System.Drawing.Size, System.Drawing"> 1822 <value>22, 28</value> 1823 </data> 1824 <data name="tbHelpDropDown.Text" xml:space="preserve"> 1825 <value>Help</value> 1826 </data> 1827 <data name="ToolBar.Location" type="System.Drawing.Point, System.Drawing"> 1828 <value>14, 26</value> 1829 </data> 1830 <data name="ToolBar.Size" type="System.Drawing.Size, System.Drawing"> 1831 <value>500, 32</value> 1832 </data> 1833 <data name="ToolBar.TabIndex" type="System.Int32, mscorlib"> 1834 <value>1</value> 1835 </data> 1836 <data name="ToolBar.Text" xml:space="preserve"> 1837 <value>ToolBar</value> 1838 </data> 1839 <data name=">>ToolBar.Name" xml:space="preserve"> 1840 <value>ToolBar</value> 1841 </data> 1842 <data name=">>ToolBar.Type" xml:space="preserve"> 1843 <value>Eraser.ToolBar, Eraser, Version=6.0.4.875, Culture=neutral, PublicKeyToken=311f5aaf640c645d</value> 1844 </data> 1845 <data name=">>ToolBar.Parent" xml:space="preserve"> 1846 <value>$this</value> 1847 </data> 1848 <data name=">>ToolBar.ZOrder" xml:space="preserve"> 1849 <value>2</value> 1850 </data> 1851 <data name="checkForUpdatesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 1852 <value>171, 22</value> 1853 </data> 1854 <data name="checkForUpdatesToolStripMenuItem.Text" xml:space="preserve"> 1855 <value>Check for Updates</value> 1856 </data> 1800 1857 <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 1801 1858 <value>True</value> … … 3376 3433 <value>Eraser</value> 3377 3434 </data> 3435 <data name=">>tbSchedule.Name" xml:space="preserve"> 3436 <value>tbSchedule</value> 3437 </data> 3438 <data name=">>tbSchedule.Type" xml:space="preserve"> 3439 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3440 </data> 3441 <data name=">>notificationIcon.Name" xml:space="preserve"> 3442 <value>notificationIcon</value> 3443 </data> 3444 <data name=">>notificationIcon.Type" xml:space="preserve"> 3445 <value>System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3446 </data> 3447 <data name=">>openEraserToolStripMenuItem.Name" xml:space="preserve"> 3448 <value>openEraserToolStripMenuItem</value> 3449 </data> 3450 <data name=">>openEraserToolStripMenuItem.Type" xml:space="preserve"> 3451 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3452 </data> 3453 <data name=">>toolStripMenuItem1.Name" xml:space="preserve"> 3454 <value>toolStripMenuItem1</value> 3455 </data> 3456 <data name=">>toolStripMenuItem1.Type" xml:space="preserve"> 3457 <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3458 </data> 3459 <data name=">>hideWhenMinimisedToolStripMenuItem.Name" xml:space="preserve"> 3460 <value>hideWhenMinimisedToolStripMenuItem</value> 3461 </data> 3462 <data name=">>hideWhenMinimisedToolStripMenuItem.Type" xml:space="preserve"> 3463 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3464 </data> 3465 <data name=">>exitToolStripMenuItem.Name" xml:space="preserve"> 3466 <value>exitToolStripMenuItem</value> 3467 </data> 3468 <data name=">>exitToolStripMenuItem.Type" xml:space="preserve"> 3469 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3470 </data> 3471 <data name=">>notificationIconTimer.Name" xml:space="preserve"> 3472 <value>notificationIconTimer</value> 3473 </data> 3474 <data name=">>notificationIconTimer.Type" xml:space="preserve"> 3475 <value>System.Windows.Forms.Timer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3476 </data> 3477 <data name=">>tbScheduleDropDown.Name" xml:space="preserve"> 3478 <value>tbScheduleDropDown</value> 3479 </data> 3480 <data name=">>tbScheduleDropDown.Type" xml:space="preserve"> 3481 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3482 </data> 3378 3483 <data name=">>newTaskToolStripMenuItem.Name" xml:space="preserve"> 3379 3484 <value>newTaskToolStripMenuItem</value> … … 3382 3487 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3383 3488 </data> 3489 <data name=">>tbSettings.Name" xml:space="preserve"> 3490 <value>tbSettings</value> 3491 </data> 3492 <data name=">>tbSettings.Type" xml:space="preserve"> 3493 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3494 </data> 3495 <data name=">>tbHelp.Name" xml:space="preserve"> 3496 <value>tbHelp</value> 3497 </data> 3498 <data name=">>tbHelp.Type" xml:space="preserve"> 3499 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3500 </data> 3501 <data name=">>tbHelpDropDown.Name" xml:space="preserve"> 3502 <value>tbHelpDropDown</value> 3503 </data> 3504 <data name=">>tbHelpDropDown.Type" xml:space="preserve"> 3505 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3506 </data> 3507 <data name=">>checkForUpdatesToolStripMenuItem1.Name" xml:space="preserve"> 3508 <value>checkForUpdatesToolStripMenuItem1</value> 3509 </data> 3510 <data name=">>checkForUpdatesToolStripMenuItem1.Type" xml:space="preserve"> 3511 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3512 </data> 3513 <data name=">>aboutEraserToolStripMenuItem.Name" xml:space="preserve"> 3514 <value>aboutEraserToolStripMenuItem</value> 3515 </data> 3516 <data name=">>aboutEraserToolStripMenuItem.Type" xml:space="preserve"> 3517 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3518 </data> 3384 3519 <data name=">>checkForUpdatesToolStripMenuItem.Name" xml:space="preserve"> 3385 3520 <value>checkForUpdatesToolStripMenuItem</value> … … 3388 3523 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 3389 3524 </data> 3390 <data name=">>aboutEraserToolStripMenuItem.Name" xml:space="preserve">3391 <value>aboutEraserToolStripMenuItem</value>3392 </data>3393 <data name=">>aboutEraserToolStripMenuItem.Type" xml:space="preserve">3394 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3395 </data>3396 <data name=">>notificationIcon.Name" xml:space="preserve">3397 <value>notificationIcon</value>3398 </data>3399 <data name=">>notificationIcon.Type" xml:space="preserve">3400 <value>System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3401 </data>3402 <data name=">>openEraserToolStripMenuItem.Name" xml:space="preserve">3403 <value>openEraserToolStripMenuItem</value>3404 </data>3405 <data name=">>openEraserToolStripMenuItem.Type" xml:space="preserve">3406 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3407 </data>3408 <data name=">>toolStripMenuItem1.Name" xml:space="preserve">3409 <value>toolStripMenuItem1</value>3410 </data>3411 <data name=">>toolStripMenuItem1.Type" xml:space="preserve">3412 <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3413 </data>3414 <data name=">>hideWhenMinimisedToolStripMenuItem.Name" xml:space="preserve">3415 <value>hideWhenMinimisedToolStripMenuItem</value>3416 </data>3417 <data name=">>hideWhenMinimisedToolStripMenuItem.Type" xml:space="preserve">3418 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3419 </data>3420 <data name=">>exitToolStripMenuItem.Name" xml:space="preserve">3421 <value>exitToolStripMenuItem</value>3422 </data>3423 <data name=">>exitToolStripMenuItem.Type" xml:space="preserve">3424 <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3425 </data>3426 <data name=">>notificationIconTimer.Name" xml:space="preserve">3427 <value>notificationIconTimer</value>3428 </data>3429 <data name=">>notificationIconTimer.Type" xml:space="preserve">3430 <value>System.Windows.Forms.Timer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>3431 </data>3432 3525 <data name=">>$this.Name" xml:space="preserve"> 3433 3526 <value>MainForm</value> -
branches/eraser6/Eraser/SchedulerPanel.cs
r962 r966 42 42 InitializeComponent(); 43 43 UxThemeAPI.UpdateControlTheme(this); 44 UxThemeAPI.UpdateControlTheme(schedulerMenu);45 44 UxThemeAPI.UpdateControlTheme(schedulerDefaultMenu); 46 45 -
branches/eraser6/Eraser/SettingsPanel.cs
r962 r966 44 44 InitializeComponent(); 45 45 UxThemeAPI.UpdateControlTheme(this); 46 UxThemeAPI.UpdateControlTheme(pluginsMenu);47 46 48 47 //For new plugins, register the callback. -
branches/eraser6/Eraser/Strings.NL.resx
r909 r966 136 136 <value>(Untranslated)</value> 137 137 </data> 138 <data name="Erase Schedule" xml:space="preserve">139 <value>Planner</value>140 </data>141 <data name="Settings" xml:space="preserve">142 <value>Instellingen</value>143 </data>144 <data name="Help" xml:space="preserve">145 <value>Help</value>146 </data>147 138 <data name="Processing:" xml:space="preserve"> 148 139 <value>(Untranslated)</value> -
branches/eraser6/Eraser/Strings.en.resx
r909 r966 136 136 <value>Session: {0:F}</value> 137 137 </data> 138 <data name="Erase Schedule" xml:space="preserve">139 <value>Erase Schedule</value>140 </data>141 <data name="Settings" xml:space="preserve">142 <value>Settings</value>143 </data>144 <data name="Help" xml:space="preserve">145 <value>Help</value>146 </data>147 138 <data name="Processing:" xml:space="preserve"> 148 139 <value>Processing:</value> -
branches/eraser6/Eraser/Strings.resx
r909 r966 136 136 <value>Session: {0:F}</value> 137 137 </data> 138 <data name="Erase Schedule" xml:space="preserve">139 <value>Erase Schedule</value>140 </data>141 <data name="Settings" xml:space="preserve">142 <value>Settings</value>143 </data>144 <data name="Help" xml:space="preserve">145 <value>Help</value>146 </data>147 138 <data name="Processing:" xml:space="preserve"> 148 139 <value>Processing:</value> -
branches/eraser6/Eraser/TaskPropertiesForm.cs
r962 r966 40 40 InitializeComponent(); 41 41 UxThemeAPI.UpdateControlTheme(this); 42 UxThemeAPI.UpdateControlTheme(dataContextMenuStrip);43 42 scheduleTime.CustomFormat = DateTimeFormatInfo.CurrentInfo.ShortTimePattern; 44 43 -
branches/eraser6/Eraser/ToolBar.cs
r945 r966 29 29 using System.Runtime.InteropServices; 30 30 using System.Collections.ObjectModel; 31 using Eraser.Util; 31 32 32 33 namespace Eraser 33 34 { 34 public partial class ToolBar : Control35 public partial class ToolBar : System.Windows.Forms.MenuStrip 35 36 { 36 37 public ToolBar() … … 38 39 //Create the base component 39 40 InitializeComponent(); 40 41 //Initialize the toolbar item list 42 Items = new ToolBarItemCollection(this); 43 44 //Hook mouse move events to show the currently selected item 45 MouseMove += ToolBar_MouseMove; 46 MouseLeave += ToolBar_MouseLeave; 47 MouseClick += ToolBar_MouseClick; 41 Renderer = new EraserToolStripRenderer(); 48 42 } 49 43 50 void ToolBar_MouseMove(object sender, MouseEventArgs e)44 private class EraserToolStripRenderer : UxThemeMenuRenderer 51 45 { 52 Redraw(); 53 } 46 protected override void Initialize(ToolStrip toolStrip) 47 { 48 base.Initialize(toolStrip); 49 owner = toolStrip; 50 } 54 51 55 void ToolBar_MouseLeave(object sender, EventArgs e) 56 { 57 Redraw(); 58 } 52 protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) 53 { 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 } 59 62 60 void ToolBar_MouseClick(object sender, MouseEventArgs e) 61 { 62 //See if the click was on any item's arrow. 63 Rectangle mouse_rect = new Rectangle(e.Location, new Size(1, 1)); 64 foreach (ToolBarItem i in Items) 63 protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) 65 64 { 66 if (i.Menu != null && mouse_rect.IntersectsWith(i.MenuRect)) 65 if (e.ToolStrip != owner) 66 base.OnRenderMenuItemBackground(e); 67 } 68 69 protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) 70 { 71 if (e.ToolStrip != owner) 67 72 { 68 //Show the menu below the toolbar item. 69 Point mouse_point = PointToScreen(i.Rectangle.Location); 70 i.Menu.Show(mouse_point.X, mouse_point.Y + i.Rectangle.Height); 73 base.OnRenderItemText(e); 74 return; 71 75 } 72 else if (mouse_rect.IntersectsWith(i.Rectangle)) 76 77 Graphics g = e.Graphics; 78 79 //Draw the actual text 80 Rectangle tempRect = e.TextRectangle; 81 tempRect.Inflate(3, 0); 82 tempRect.Offset(3, 0); 83 e.TextRectangle = tempRect; 84 using (SolidBrush textBrush = new SolidBrush(TextColour)) 85 g.DrawString(e.Text, e.TextFont, textBrush, e.TextRectangle); 86 87 //If the text has got a selection, draw an underline 88 if (e.Item.Selected) 73 89 { 74 //Broadcast the item click event 75 i.OnToolbarItemClicked(this); 90 SizeF textSize = g.MeasureString(e.Text, e.TextFont); 91 using (Pen underlinePen = new Pen(TextColour)) 92 { 93 Point underlineStart = e.TextRectangle.Location; 94 underlineStart.Offset(0, Point.Truncate(textSize.ToPointF()).Y); 95 Point underlineEnd = underlineStart; 96 underlineEnd.Offset(e.TextRectangle.Width, 0); 97 98 g.DrawLine(underlinePen, underlineStart, underlineEnd); 99 } 76 100 } 77 101 } 78 }79 80 /// <summary>81 /// Draws the Tool Bar on the given graphics object.82 /// </summary>83 /// <param name="dc">Graphics object to draw on.</param>84 public void Draw(Graphics rawDC)85 {86 //Create a backing bitmap buffer to prevent flicker87 Bitmap back_bmp = new Bitmap(Width, Height);88 Graphics dc = Graphics.FromImage(back_bmp);89 102 90 //Draw the parent background image. This is not portable in that it will render 91 //this code unreusable, but for the lack of anything better this will have to suffice! 92 dc.DrawImage(Properties.Resources.BackgroundGradient, new Point(-Left, -Top)); 93 94 Point mouse_pos = PointToClient(MousePosition); 95 int x = 0; 103 /// <summary> 104 /// The margin between a drop-down arrow and the surrounding items. 105 /// </summary> 106 private const int ArrowMargin = 0; 96 107 97 foreach (ToolBarItem i in Items) 98 { 99 { 100 Point pos = i.Rectangle.Location; 101 pos.X = x; 102 pos.Y = 0; 103 i.Rectangle.Location = pos; 104 } 108 /// <summary> 109 /// The colour of the menu bar text. 110 /// </summary> 111 private readonly Color TextColour = Color.White; 105 112 106 if (i.Bitmap != null) 107 { 108 i.BitmapRect = new Rectangle(x, 0, i.Bitmap.Width, i.Bitmap.Height); 109 dc.DrawImage(i.Bitmap, i.BitmapRect); 110 111 x += i.BitmapRect.Width + 4; 112 } 113 114 //Draw the toolbar item text 115 SizeF string_size = dc.MeasureString(i.Text, Font); 116 i.TextRect = new Rectangle(x, (int)(Height - string_size.Height) / 2, 117 (int)string_size.Width, (int)string_size.Height); 118 dc.DrawString(i.Text, Font, Brushes.White, i.TextRect.Location); 119 x += i.TextRect.Width; 120 121 //If there is a menu associated draw a drop-down glyph 122 if (i.Menu != null) 123 { 124 Bitmap menu_arrow = Properties.Resources.ToolbarArrow; 125 i.MenuRect = new Rectangle(x += 6, i.TextRect.Y, 126 menu_arrow.Width, menu_arrow.Height); 127 dc.DrawImage(menu_arrow, i.MenuRect); 128 x += i.MenuRect.Width; 129 } 130 131 //Update the size of the item rectangle 132 { 133 Size size = i.Rectangle.Size; 134 size.Width = x - i.Rectangle.Location.X; 135 size.Height = Height; 136 i.Rectangle.Size = size; 137 } 138 139 //If the mouse cursor intersects with the item then draw an underline. 140 if (i.Rectangle.IntersectsWith(new Rectangle(mouse_pos, new Size(1, 1)))) 141 dc.DrawLine(Pens.White, new Point(i.TextRect.Left, i.TextRect.Bottom + 1), 142 new Point(i.TextRect.Right, i.TextRect.Bottom + 1)); 143 144 //Padding between items. 145 x += 16; 146 } 147 148 rawDC.DrawImage(back_bmp, new Point(0, 0)); 149 } 150 151 /// <summary> 152 /// Redraws the Tool Bar by creating a Graphics object. 153 /// </summary> 154 public void Redraw() 155 { 156 Draw(CreateGraphics()); 157 } 158 159 /// <summary> 160 /// Paints the control. 161 /// </summary> 162 /// <param name="pe">Paint event object.</param> 163 protected override void OnPaint(PaintEventArgs e) 164 { 165 Draw(e.Graphics); 166 167 // Calling the base class OnPaint 168 base.OnPaint(e); 169 } 170 171 /// <summary> 172 /// Stores the items in the Tool Bar. 173 /// </summary> 174 public ToolBarItemCollection Items 175 { 176 get; 177 private set; 113 private ToolStrip owner; 178 114 } 179 115 } 180 181 public class ToolBarItem182 {183 /// <summary>184 /// Tool bar item text.185 /// </summary>186 [Description("Toolbar item text")]187 public string Text188 {189 get { return text; }190 set191 {192 text = value;193 if (Window != null)194 Window.Redraw();195 }196 }197 198 /// <summary>199 /// Item bitmap.200 /// </summary>201 [Description("Item Bitmap")]202 public Bitmap Bitmap203 {204 get { return bitmap; }205 set206 {207 bitmap = value;208 if (Window != null)209 Window.Redraw();210 }211 }212 213 /// <summary>214 /// Item drop-down menu215 /// </summary>216 public ContextMenuStrip Menu217 {218 get { return menu; }219 set220 {221 menu = value;222 if (Window != null)223 Window.Redraw();224 }225 }226 227 /// <summary>228 /// Item click event handler229 /// </summary>230 public EventHandler<EventArgs> ToolBarItemClicked231 {232 get;233 set;234 }235 236 internal void OnToolbarItemClicked(object sender)237 {238 if (ToolBarItemClicked != null)239 ToolBarItemClicked(sender, new EventArgs());240 }241 242 private string text;243 private Bitmap bitmap;244 private ContextMenuStrip menu;245 246 /// <summary>247 /// The owning window of this item.248 /// </summary>249 internal ToolBar Window;250 251 /// <summary>252 /// Stores the rectangle of this item.253 /// </summary>254 internal Rectangle Rectangle;255 256 /// <summary>257 /// Stores the rectangle of the bitmap.258 /// </summary>259 internal Rectangle BitmapRect;260 261 /// <summary>262 /// Stores the rectangle of the text.263 /// </summary>264 internal Rectangle TextRect;265 266 /// <summary>267 /// Stores the rectangle of the drop-down arrow.268 /// </summary>269 internal Rectangle MenuRect;270 }271 272 public class ToolBarItemCollection : ICollection<ToolBarItem>, IList<ToolBarItem>,273 IEnumerable<ToolBarItem>274 {275 /// <summary>276 /// Constructor.277 /// </summary>278 /// <param name="win">The owning toolbar window.</param>279 internal ToolBarItemCollection(ToolBar win)280 {281 window = win;282 }283 284 #region ICollection<ToolBarItem> Members285 public void Add(ToolBarItem item)286 {287 Insert(Count, item);288 }289 290 public void Clear()291 {292 foreach (ToolBarItem item in list)293 item.Window = null;294 list.Clear();295 window.Redraw();296 }297 298 public bool Contains(ToolBarItem item)299 {300 return list.Contains(item);301 }302 303 public void CopyTo(ToolBarItem[] array, int arrayIndex)304 {305 list.CopyTo(array, arrayIndex);306 }307 308 public int Count309 {310 get { return list.Count; }311 }312 313 public bool IsReadOnly314 {315 get { return false; }316 }317 318 public bool Remove(ToolBarItem item)319 {320 int index = IndexOf(item);321 if (index < 0)322 return false;323 324 RemoveAt(index);325 return true;326 }327 #endregion328 329 #region IEnumerable<ToolBarItem> Members330 public IEnumerator<ToolBarItem> GetEnumerator()331 {332 return list.GetEnumerator();333 }334 #endregion335 336 #region IEnumerable Members337 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()338 {339 return list.GetEnumerator();340 }341 #endregion342 343 #region IList<ToolBarItem> Members344 public int IndexOf(ToolBarItem item)345 {346 return list.IndexOf(item);347 }348 349 public void Insert(int index, ToolBarItem item)350 {351 if (item.Window != null)352 throw new ArgumentException("The item being added already is owned by " +353 "another ToolBar control. Remove the item from the other control " +354 "before inserting it into this one.");355 356 item.Window = window;357 list.Insert(index, item);358 window.Redraw();359 }360 361 public void RemoveAt(int index)362 {363 ToolBarItem item = list[index];364 item.Window = null;365 list.RemoveAt(index);366 window.Redraw();367 }368 369 public ToolBarItem this[int index]370 {371 get372 {373 return list[index];374 }375 set376 {377 list[index] = value;378 if (window != null)379 window.Redraw();380 }381 }382 #endregion383 384 /// <summary>385 /// The window owning the items in this list.386 /// </summary>387 private ToolBar window;388 389 /// <summary>390 /// The list storing the toolbar items.391 /// </summary>392 private List<ToolBarItem> list = new List<ToolBarItem>();393 }394 116 } -
branches/eraser6/Util/UxThemeAPI.cs
r965 r966 41 41 else if (control is ContextMenuStrip) 42 42 UpdateControlTheme((ContextMenuStrip)control); 43 /*else if (control is MenuStrip) 44 UpdateControlTheme((MenuStrip)control); 45 46 if (control.ContextMenuStrip != null) 47 UpdateControlTheme(control.ContextMenuStrip); 48 */ 43 49 foreach (Control child in control.Controls) 44 50 UpdateControlTheme(child); … … 66 72 /// </summary> 67 73 /// <param name="lv">The List View control to set the theme on.</param> 68 public static void UpdateControlTheme(ContextMenuStrip lv)74 public static void UpdateControlTheme(ContextMenuStrip menu) 69 75 { 70 76 if (Environment.OSVersion.Version.Major >= 6) 71 lv.Renderer = new UxThemeMenuRenderer(); 77 if (!(menu.Renderer is UxThemeMenuRenderer)) 78 menu.Renderer = new UxThemeMenuRenderer(); 79 } 80 81 /// <summary> 82 /// Updates the control's theme to fit in with the latest Windows visuals. 83 /// </summary> 84 /// <param name="lv">The List View control to set the theme on.</param> 85 public static void UpdateControlTheme(MenuStrip menu) 86 { 87 foreach (ToolStripMenuItem item in menu.Items) 88 UpdateControlTheme(item); 89 } 90 91 /// <summary> 92 /// Updates the control's theme to fit in with the latest Windows visuals. 93 /// </summary> 94 /// <param name="lv">The List View control to set the theme on.</param> 95 public static void UpdateControlTheme(ToolStripMenuItem menu) 96 { 97 UpdateControlTheme(menu.DropDown); 72 98 } 73 99
Note: See TracChangeset
for help on using the changeset viewer.
