Ejemplo n.º 1
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            // base.OnRenderSeparator(e);
            if (!e.Item.IsOnDropDown)
            {
                int top = 9;
                int left = e.Item.Width / 2; left--;
                int height = e.Item.Height - top  * 2;
                RectangleF separator = new RectangleF(left, top, 0.5f, height);

                using (LinearGradientBrush b = new LinearGradientBrush(
                    separator.Location,
                    new Point(Convert.ToInt32(separator.Left), Convert.ToInt32(separator.Bottom)),
                    Color.Red, Color.Black))
                {
                    ColorBlend blend = new ColorBlend();
                    blend.Colors = new Color[] { ToolStripColorTable.ToolStripSplitButtonTop, ToolStripColorTable.ToolStripSplitButtonMiddle, ToolStripColorTable.ToolStripSplitButtonMiddle, ToolStripColorTable.ToolStripSplitButtonBottom };
                    blend.Positions = new float[] { 0.0f, 0.22f, 0.78f, 1.0f };

                    b.InterpolationColors = blend;

                    e.Graphics.FillRectangle(b, separator);
                }
            }
        }
Ejemplo n.º 2
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     Rectangle rect = e.Item.ContentRectangle;
     using (Pen pen = new Pen(SEPARATOR_COLOR))
     {
         e.Graphics.DrawLine(pen, -1, rect.Y, rect.Right + 2, rect.Y);
     }
 }
Ejemplo n.º 3
0
		protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
		{
			int height = e.Item.Height;
			int width = e.Item.Width;

			e.Graphics.FillRectangle(SystemBrushes.Desktop, 0, 0, width, height);
			e.Graphics.DrawLine(Pens.Gray, 4, height / 2, width - 4, height / 2);
		}
Ejemplo n.º 4
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            Point pt1 = new Point(32, 3);
            Point pt2 = new Point(e.Item.Width, 3);
            e.Graphics.DrawLine(new Pen(separator), pt1, pt2);

            base.OnRenderSeparator(e);
        }
Ejemplo n.º 5
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            Rectangle rect = new Rectangle(32, 3, e.Item.Width - 32, 1);
            Rectangle rect2 = new Rectangle(32, 4, e.Item.Width - 32, 1);
            e.Graphics.FillRectangle(new SolidBrush(bgColor2), rect);
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0x5f, itemColor)), rect2);

            base.OnRenderSeparator(e);
        }
Ejemplo n.º 6
0
 protected override void OnRenderSeparator(System.Windows.Forms.ToolStripSeparatorRenderEventArgs e)
 {
     if (currentRenderer != null)
     {
         currentRenderer.DrawSeparator(e);
         return;
     }
     base.OnRenderSeparator(e);
 }
        /* --------------------------------------------------------------------- */
        /// OnRenderSeparator
        /* --------------------------------------------------------------------- */
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            //base.OnRenderSeparator(e);

            var separator = e.Item as ToolStripSeparator;
            if (separator != null) {
                var pen = new Pen(Color.Black);
                e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, 1, separator.Height));
            }
        }
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            Rectangle r = e.Item.ContentRectangle;
            Color color = Color.MidnightBlue;//Color.FromArgb(255, Color.MidnightBlue);
            int x = r.X;
            int y1 = r.Y + 2;
            int y2 = r.Bottom;
            e.Graphics.DrawLine(new Pen(Color.MidnightBlue, 1), x, y1, x, y2);
            e.Graphics.DrawLine(new Pen(Color.FromArgb(150, Color.Gray), 1), x + 1, y1 + 1, x + 1, y2 + 1);

        }
Ejemplo n.º 9
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            e.Graphics.Clear(e.Item.BackColor);
            RectangleF rect = e.Graphics.ClipBounds;
            PointF center = rect.Center();

            if (e.Vertical)
                e.Graphics.DrawLine(new Pen(e.Item.ForeColor), center.X, rect.Top + 2, center.X, rect.Bottom - 2);
            else
                e.Graphics.DrawLine(new Pen(e.Item.ForeColor), rect.Left, center.Y, rect.Right, center.Y);
        }
Ejemplo n.º 10
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            using (Pen linePen = new Pen(Color.FromArgb(131, 146, 165)))
              {
            linePen.DashPattern = new float[] { 1f, 1f };

            Point lineStart = new Point(e.Item.Bounds.Width / 2, e.ToolStrip.Margin.Top);
            Point lineEnd = new Point(e.Item.Bounds.Width / 2, e.Item.Bounds.Height - e.ToolStrip.Margin.Bottom);
            e.Graphics.DrawLine(linePen, lineStart, lineEnd);
              }
        }
Ejemplo n.º 11
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            var g = e.Graphics;

            var rect = new Rectangle(1, 3, e.Item.Width, 1);

            using (var b = new SolidBrush(Colors.LightBorder))
            {
                g.FillRectangle(b, rect);
            }
        }
Ejemplo n.º 12
0
        protected override void OnRenderSeparator(System.Windows.Forms.ToolStripSeparatorRenderEventArgs e)
        {
            base.OnRenderSeparator(e);
            int PT1 = 28;
            int PT2 = System.Convert.ToInt32(e.Item.Width);
            int Y   = 3;

            using (Pen P1 = new Pen(this.ColorTable.Separator))
            {
                e.Graphics.DrawLine(P1, PT1, Y, PT2, Y);
            }
        }
Ejemplo n.º 13
0
            protected override void OnRenderSeparator(System.Windows.Forms.ToolStripSeparatorRenderEventArgs e)
            {
                base.OnRenderSeparator(e);

                var DarkLine  = new SolidBrush(ColorImageMarginLine);
                var WhiteLine = new SolidBrush(Color.White);
                var rect      = new Rectangle(32, 3, e.Item.Width - 32, 1);
                var rect2     = new Rectangle(32, 4, e.Item.Width - 32, 1);

                e.Graphics.FillRectangle(DarkLine, rect);
                e.Graphics.FillRectangle(WhiteLine, rect2);
            }
Ejemplo n.º 14
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if (renderer is ToolStripSystemRenderer)
     {
         if (e.ToolStrip is ToolStripDropDownMenu) renderer.DrawSeparator(e);
         else
         {
             Pen pen = new Pen(SystemColors.InactiveBorder);
             Int32 middle = e.Item.ContentRectangle.Left + e.Item.ContentRectangle.Width / 2;
             e.Graphics.DrawLine(pen, middle, e.Item.ContentRectangle.Top + 1, middle, e.Item.ContentRectangle.Bottom - 2);
             pen.Dispose();
         }
     }
     else renderer.DrawSeparator(e);
 }
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            Rectangle r = new Rectangle(new Point(3, 8), e.Item.Size);

            if (e.Item is ToolStripSeparator)
            {
                r.Width = 1;
                r.Height -= 14;
                //竖线
                e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(209, 209, 209)), r);
            }
            else
            {
                base.OnRenderSeparator(e);
            }
        }
Ejemplo n.º 16
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            if (e.Item is ToolStripSeparator)
            {
                if (!e.Vertical)
                {
                    ToolStripDropDownMenu parent = e.Item.GetCurrentParent() as ToolStripDropDownMenu;
                    if (parent != null)
                    {
                        renderer.DrawSeparator(e);
                        return;
                    }
                }
            }

            base.OnRenderSeparator(e);
        }
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            Rectangle r = new Rectangle(1, 0, e.Item.Bounds.Width - 3, e.Item.Bounds.Height);
            r.X += m_sideBorder + m_sideBorder / 2;
            r.Width -= 2 * m_sideBorder;
            Color color = Color.MidnightBlue;//Color.FromArgb(255, Color.MidnightBlue);            
            LinearGradientBrush brush1 = new LinearGradientBrush(r, Color.Transparent, color , LinearGradientMode.Horizontal);
            LinearGradientBrush brush2 = new LinearGradientBrush(r, color, Color.Transparent, LinearGradientMode.Horizontal);
            //Pen pen = new Pen(brush, 1);
            int x1 = r.X + 1;
            int y = r.Y + r.Height / 2;
            int x2 = r.X + r.Width / 2;
            int x3 = r.Right - m_sideBorder;
            e.Graphics.DrawLine(new Pen(brush1, 1), x1, y, x2, y);
            e.Graphics.DrawLine(new Pen(brush2, 1), x2 + 1, y, x3, y);

            //e.Graphics.DrawLine(pen, new Point(r.X, r.Y + r.Height / 2), new Point(r.Right - 5, r.Y + r.Height / 2));            
        }
Ejemplo n.º 18
0
		protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
		{
			//base.OnRenderSeparator(e);
			if (e.Vertical)
			{
				int size = e.ToolStrip.Height * 3 / 4;
				int midX = e.Item.Width / 2;
				int midY = e.ToolStrip.Height / 2;
				e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.Black)), midX, midY - size / 2, midX, midY + size / 2);
				e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.White)), midX + 1, midY - size / 2, midX + 1, midY + size / 2);
			}
			else
			{
				int size = e.ToolStrip.Width * 3 / 4;
				int midX = e.Item.Width / 2;
				int midY = e.ToolStrip.Width / 2;
				e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.Black)), midX - size / 2, midY, midX + size / 2, midY);
				e.Graphics.DrawLine(new Pen(Color.FromArgb(64, Color.White)), midX - size / 2, midY + 1, midX + size / 2, midY + 1);
			}
		}
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if ((e.ToolStrip is ContextMenuStrip) ||
     (e.ToolStrip is ToolStripDropDownMenu))
     {
         using (Pen lightPen = new Pen(Color.FromArgb(208, 234, 247)), darkPen = new Pen(Color.FromArgb(219, 238, 252)))
         {
             DrawSeparator(e.Graphics, e.Vertical, new Rectangle(0, 0, e.Item.Width - 5, 3), lightPen, darkPen, 31, (e.ToolStrip.RightToLeft == RightToLeft.Yes));
         }
     }
     else if (e.ToolStrip is System.Windows.Forms.StatusStrip)
     {
         using (Pen lightPen = new Pen(ColorTable.SeparatorLight), darkPen = new Pen(ColorTable.SeparatorDark))
         {
             DrawSeparator(e.Graphics, e.Vertical, e.Item.Bounds, lightPen, darkPen, 0, false);
         }
     }
     else
     {
         base.OnRenderSeparator(e);
     }
 }
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     e.Graphics.FillRectangle(new SolidBrush(QLFUI.IniHelper.BackColor), new Rectangle(0, 0, e.Item.Width, e.Item.Height));
     if ((e.ToolStrip is ContextMenuStrip) ||
     (e.ToolStrip is ToolStripDropDownMenu))
     {
         using (Pen lightPen = new Pen(QLFUI.IniHelper.DeepColor), darkPen = new Pen(QLFUI.IniHelper.DeepColor))
         {
             DrawSeparator(e.Graphics, e.Vertical, new Rectangle(0, 0, e.Item.Width - 5, 3), lightPen, darkPen, 0, (e.ToolStrip.RightToLeft == RightToLeft.Yes));
         }
     }
     else if (e.ToolStrip is System.Windows.Forms.StatusStrip)
     {
         using (Pen lightPen = new Pen(ColorTable.SeparatorLight), darkPen = new Pen(ColorTable.SeparatorDark))
         {
             DrawSeparator(e.Graphics, e.Vertical, e.Item.Bounds, lightPen, darkPen, 0, false);
         }
     }
     else
     {
         base.OnRenderSeparator(e);
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 ///     Raises the RenderSeparator event.
 /// </summary>
 /// <param name="e"> An ToolStripSeparatorRenderEventArgs containing the event data. </param>
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     if ((e.ToolStrip is ContextMenuStrip) ||
         (e.ToolStrip is ToolStripDropDownMenu))
     {
         // Create the light and dark line pens
         using (Pen lightPen = new Pen(_separatorMenuLight),
                    darkPen = new Pen(_separatorMenuDark))
         {
             this.DrawSeparator(e.Graphics, e.Vertical, e.Item.Bounds,
                                lightPen, darkPen, _separatorInset,
                                (e.ToolStrip.RightToLeft == RightToLeft.Yes));
         }
     }
     else if (e.ToolStrip is StatusStrip)
     {
         // Create the light and dark line pens
         using (Pen lightPen = new Pen(this.ColorTable.SeparatorLight),
                    darkPen = new Pen(this.ColorTable.SeparatorDark))
         {
             this.DrawSeparator(e.Graphics, e.Vertical, e.Item.Bounds,
                                lightPen, darkPen, 0, false);
         }
     }
     else
     {
         base.OnRenderSeparator(e);
     }
 }
 public void DrawSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     this.OnRenderSeparator(e);
     ToolStripSeparatorRenderEventHandler handler = this.Events[EventRenderSeparator] as ToolStripSeparatorRenderEventHandler;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Ejemplo n.º 23
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical);
 }
		protected virtual void OnRenderSeparator (ToolStripSeparatorRenderEventArgs e)
		{
			ToolStripSeparatorRenderEventHandler eh = (ToolStripSeparatorRenderEventHandler)Events [RenderSeparatorEvent];
			if (eh != null)
				eh (this, e);
		}
        /// <summary>
        /// 画分割线,包括dropdown
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            ToolStrip toolStrip = e.ToolStrip;
            Rectangle rect = e.Item.ContentRectangle;
            Graphics g = e.Graphics;

            Color baseColor = Color.FromArgb(255, 255, 255);
            RenderSeparatorLine(g, rect, baseColor, Color.Red, Color.Snow, e.Vertical);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Raises the RenderSeparator event. 
        /// </summary>
        /// <param name="e">An ToolStripSeparatorRenderEventArgs containing the event data.</param>
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
			if (ColorTable.UseSystemColors == false)
			{
				e.Item.ForeColor = ColorTable.RaftingContainerGradientBegin;
			}
            base.OnRenderSeparator(e);
        }
		public void DrawSeparator (ToolStripSeparatorRenderEventArgs e)
		{ this.OnRenderSeparator (e); }
Ejemplo n.º 28
0
 /// <include file='doc\ToolStripRenderer.uex' path='docs/doc[@for="ToolStripRenderer.DrawSeparator"]/*' />
 /// <devdoc>
 /// Draw the separator
 /// </devdoc>
 public void DrawSeparator(ToolStripSeparatorRenderEventArgs e) {
     OnRenderSeparator(e);
     ToolStripSeparatorRenderEventHandler eh = Events[EventRenderSeparator] as ToolStripSeparatorRenderEventHandler;
     if (eh != null) {
         eh(this, e);
     }
 }
Ejemplo n.º 29
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     IntPtr hDC = e.Graphics.GetHdc();
        Rectangle rect = new Rectangle(GutterWidth, 0, e.Item.Width, e.Item.Height);
        rect.Inflate(4, 0);
        NativeMethods.DrawThemeBackground(hTheme, hDC,
     (int)NativeMethods.MENUPARTS.MENU_POPUPSEPARATOR, 0, ref rect, ref rect);
        e.Graphics.ReleaseHdc();
 }
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            base.OnRenderSeparator(e);

            PaintItem(e.Graphics, e.Item.ContentRectangle,
                ColorTable.ButtonNormalEnd,
                ColorTable.ButtonNormalEnd);
        }
Ejemplo n.º 31
0
 protected virtual void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     throw null;
 }
        /// <summary>
        /// 画分割线
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRenderSeparator(
            ToolStripSeparatorRenderEventArgs e)
        {
            Rectangle rect = e.Item.ContentRectangle;

            using (Pen pen = new Pen(SeperatorLineColor1))
            {
                e.Graphics.DrawLine(pen, rect.X + this.imageBlockWidth, rect.Y, rect.Right - 2, rect.Top);
            }
            using (Pen pen = new Pen(SeperatorLineColor2))
            {
                e.Graphics.DrawLine(pen, rect.X + this.imageBlockWidth, rect.Y + 1, rect.Right - 2, rect.Top + 1);
            }
        }
Ejemplo n.º 33
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            ThemeElements.CurrentTheme.ToolStripPainter.OnRenderSeparator(e);

            base.OnRenderSeparator(e);
        }
Ejemplo n.º 34
0
 public void DrawSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     this.OnRenderSeparator(e);
 }
Ejemplo n.º 35
0
        protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
        {
            if (
                e.ToolStrip is ContextMenuStrip ||
                e.ToolStrip is ToolStripDropDownMenu
                )
            {
                // Draw it

                e.Graphics.DrawLine(new Pen(_mnuManager.SeperatorDark), _mnuManager.SeperatorInset, 3, e.Item.Width + 1, 3);
                e.Graphics.DrawLine(new Pen(_mnuManager.SeperatorLight), _mnuManager.SeperatorInset, 4, e.Item.Width + 1, 4);
            }
            else
            {
                if (e.Vertical)
                {
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorDark), 3, 5, 3, e.Item.Height - 6);
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorLight), 4, 6, 4, e.Item.Height - 6);
                }
                else
                {
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorDark), 8, 0, e.Item.Width - 6, 0);
                    e.Graphics.DrawLine(new Pen(_tsCtrlManager.SeperatorLight), 9, 1, e.Item.Width - 6, 1);
                }
            }
        }
Ejemplo n.º 36
0
 protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     Rectangle rectangle = new Rectangle(Point.Empty, e.Item.Size);
     if(e.ToolStrip.RightToLeft == RightToLeft.No) {
         rectangle.X += e.ToolStrip.Padding.Left - 10;
         rectangle.Width = e.ToolStrip.Width;
     }
     else {
         rectangle.X += 2;
         rectangle.Width = (e.ToolStrip.Width - rectangle.X) - e.ToolStrip.Padding.Right;
     }
     int y = rectangle.Height / 2;
     using(Pen pen = new Pen(clrLight)) {
         e.Graphics.DrawLine(pen, new Point(rectangle.X, y), new Point(rectangle.Width, y));
     }
     using(Pen pen2 = new Pen(clrLightLight)) {
         e.Graphics.DrawLine(pen2, new Point(rectangle.X, y + 1), new Point(rectangle.Width, y + 1));
     }
 }
Ejemplo n.º 37
0
        /// <include file='doc\ToolStripRenderer.uex' path='docs/doc[@for="ToolStripRenderer.OnRenderSeparator"]/*' />
        /// <devdoc>
        /// Draws a toolbar separator. ToolStrip users should override this function to change the 
        /// drawing of all separators.
        /// </devdoc>
        protected virtual void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) {
            if (RendererOverride != null) {
                RendererOverride.OnRenderSeparator(e);
                return;
            }

        }
Ejemplo n.º 38
0
 public void DrawSeparator(ToolStripSeparatorRenderEventArgs e)
 {
     throw null;
 }