Download data/DWSIM.Controls.TabStrip/Control/FATabStripMenuGlyph.cs from introvoyz041/Dwsim: direct link, hf CLI and curl.
- Browser
- Download file 2.2 kB
-
https://huggingface.co/datasets/introvoyz041/Dwsim/resolve/main/data/DWSIM.Controls.TabStrip/Control/FATabStripMenuGlyph.cs
- Command line
-
hf download hf://datasets/introvoyz041/Dwsim/data/DWSIM.Controls.TabStrip/Control/FATabStripMenuGlyph.cs
-
curl -L -o FATabStripMenuGlyph.cs https://huggingface.co/datasets/introvoyz041/Dwsim/resolve/main/data/DWSIM.Controls.TabStrip/Control/FATabStripMenuGlyph.cs
2.2 kB
| using System.Drawing; | |
| using System.Drawing.Drawing2D; | |
| using System.Windows.Forms; | |
| namespace FarsiLibrary.Win | |
| { | |
| internal class FATabStripMenuGlyph | |
| { | |
| private Rectangle glyphRect = Rectangle.Empty; | |
| private bool isMouseOver = false; | |
| private ToolStripProfessionalRenderer renderer; | |
| public bool IsMouseOver | |
| { | |
| get { return isMouseOver; } | |
| set { isMouseOver = value; } | |
| } | |
| public Rectangle Bounds | |
| { | |
| get { return glyphRect; } | |
| set { glyphRect = value; } | |
| } | |
| internal FATabStripMenuGlyph(ToolStripProfessionalRenderer renderer) | |
| { | |
| this.renderer = renderer; | |
| } | |
| public void DrawGlyph(Graphics g) | |
| { | |
| if (isMouseOver) | |
| { | |
| Color fill = renderer.ColorTable.ButtonSelectedHighlight; //Color.FromArgb(35, SystemColors.Highlight); | |
| g.FillRectangle(new SolidBrush(fill), glyphRect); | |
| Rectangle borderRect = glyphRect; | |
| borderRect.Width--; | |
| borderRect.Height--; | |
| g.DrawRectangle(SystemPens.Highlight, borderRect); | |
| } | |
| SmoothingMode bak = g.SmoothingMode; | |
| g.SmoothingMode = SmoothingMode.AntiAlias; | |
| //using (Pen pen = new Pen(Color.Black)) | |
| //{ | |
| // pen.Width = 2; | |
| // g.DrawLine(pen, new Point(glyphRect.Left + (glyphRect.Width / 3) - 2, glyphRect.Height / 2 - 1), | |
| // new Point(glyphRect.Right - (glyphRect.Width / 3), glyphRect.Height / 2 - 1)); | |
| //} | |
| var d = (int)((double)glyphRect.Width / 4); | |
| g.FillPolygon(Brushes.Black, new Point[]{ | |
| new Point(glyphRect.Left + d, glyphRect.Y + d), | |
| new Point(glyphRect.Right - d, glyphRect.Y + d), | |
| new Point(glyphRect.Left + glyphRect.Width / 2,glyphRect.Bottom - d)}); | |
| g.SmoothingMode = bak; | |
| } | |
| } | |
| } | |