diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-09-23 17:25:22 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-09-23 17:25:22 +0100 |
| commit | 350e749bb9eab16efe753f9b8fd703b52a97f808 (patch) | |
| tree | 9c90ec1a8148d66d9ff8605710a992e5e14a6b7e /Histacom2.Engine/UI/ClassicStartMenuItem.cs | |
| parent | 84ef033af262343febc3f84471233e18bc6b502e (diff) | |
| parent | 1ee3e00f8f0ee879fce4edf7d1ba9889335bc826 (diff) | |
| download | histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.gz histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.bz2 histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.zip | |
Merge branch 'master' of https://github.com/Histacom2-Devs/Histacom2
Diffstat (limited to 'Histacom2.Engine/UI/ClassicStartMenuItem.cs')
| -rw-r--r-- | Histacom2.Engine/UI/ClassicStartMenuItem.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Histacom2.Engine/UI/ClassicStartMenuItem.cs b/Histacom2.Engine/UI/ClassicStartMenuItem.cs new file mode 100644 index 0000000..49aecd9 --- /dev/null +++ b/Histacom2.Engine/UI/ClassicStartMenuItem.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.UI +{ + public class ClassicStartMenuItem : ToolStripMenuItem + { + public ClassicStartMenuItem() + { + + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + if (SaveSystem.currentTheme != null) e.Graphics.Clear(SaveSystem.currentTheme.threeDObjectsColor); + else e.Graphics.Clear(BackColor); + if (Selected) + { + if (SaveSystem.currentTheme != null) e.Graphics.Clear(SaveSystem.currentTheme.selectedBackColor); + else e.Graphics.Clear(Color.Navy); + } + + e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; + + StringFormat sf = new StringFormat(); + sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; + + e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); + if (!Selected) { + e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), Brushes.Black, 38, 11, sf); + + if (DropDownItems.Count > 0) + { + e.Graphics.DrawPolygon(Pens.Black, new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); + e.Graphics.FillPolygon(Brushes.Black, new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); + } + } else + { + if (SaveSystem.currentTheme != null) + { + e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), new SolidBrush(SaveSystem.currentTheme.selectedTextColor), 38, 11, sf); + if (DropDownItems.Count > 0) + { + e.Graphics.DrawPolygon(new Pen(SaveSystem.currentTheme.selectedTextColor), new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); + e.Graphics.FillPolygon(new SolidBrush(SaveSystem.currentTheme.selectedTextColor), new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); + } + } + } + } + } +} |
