protected virtual void customIcon(Graphics graphics) { Brush pthGrBrush = Brushes.Black; Pen pen = Pens.Black; RectangleF EllipseFill = new RectangleF(AbsoluteX - 2, AbsoluteY - 2, 24, 24); GraphicsPath path = new GraphicsPath(); path.AddEllipse(EllipseFill); Brush TextColor = Brushes.Black; switch (this.CurrentState) { case ItemState.Free: pthGrBrush = new SolidBrush(ColorDefinition.GetColorToFillState()); break; case ItemState.Hover: pthGrBrush = new SolidBrush(ColorDefinition.GetColorWhenHover()); TextColor = Brushes.White; break; case ItemState.Selected: pthGrBrush = new SolidBrush(ColorDefinition.GetColorWhenSelected()); break; default: break; } // switch graphics.FillEllipse(pthGrBrush, EllipseFill); graphics.DrawEllipse(pen, EllipseFill); if (initialState) { EllipseFill = new RectangleF(AbsoluteX + 1, AbsoluteY + 1, 18, 18); graphics.DrawEllipse(Pens.Black, EllipseFill); } }
public override void DrawToGraphics(Graphics graphics) { Brush pthGrBrush = Brushes.Black; Pen pen = Pens.Black; RectangleF EllipseFill = new RectangleF(AbsoluteX - 2, AbsoluteY - 2, 24, 24); GraphicsPath path = new GraphicsPath(); path.AddEllipse(EllipseFill); Brush TextColor = Brushes.Black; switch (this.CurrentState) { case ItemState.Free: pthGrBrush = new SolidBrush(ColorDefinition.GetColorToFillState()); break; case ItemState.Hover: pthGrBrush = new SolidBrush(ColorDefinition.GetColorWhenHover()); TextColor = Brushes.White; break; case ItemState.Selected: pthGrBrush = new SolidBrush(ColorDefinition.GetColorWhenSelected()); break; default: break; } // switch graphics.FillEllipse(pthGrBrush, EllipseFill); graphics.DrawEllipse(pen, EllipseFill); if (initialState) { EllipseFill = new RectangleF(AbsoluteX + 1, AbsoluteY + 1, 18, 18); graphics.DrawEllipse(Pens.Black, EllipseFill); } this.labelItems.labels.Clear(); this.labelItems.colors.Clear(); Color color = Color.Black; switch (this.CurrentState) { case ItemState.Hover: color = ColorDefinition.GetColorWhenHover(); break; case ItemState.Selected: color = ColorDefinition.GetColorWhenSelected(); break; default: break; } // switch if (this.CurrentState == ItemState.Free) { color = ColorDefinition.GetColorOfName(); } this.labelItems.labels.Add(Name); this.labelItems.colors.Add(color); this.labelItems.DrawToGraphics(graphics); base.DrawToGraphics(graphics); }