protected virtual void DrawButtons(Graphics g, Rectangle bounds, ServerListItem shardListItem) { int startY = 10; for (int i = 0; i < shardListItem.Buttons.Count; i++) { ServerListItemButton button = shardListItem.Buttons[i]; Rectangle buttonBounds = button.GetBounds(bounds.Location, bounds.Size); buttonBounds.Y += startY; Color textColor; bool mouseDown = button.IsMouseDown; bool mouseOver = button.IsMouseOver; if (mouseDown && mouseOver) { textColor = DefaultTextColorMouseOverSelected; } else if (mouseDown || shardListItem.IsSelected) { textColor = DefaultTextColorSelected; } else if (mouseOver) { textColor = DefaultTextColorMouseOver; } else { textColor = DefaultTextColor; } g.DrawImage(mouseOver ? Properties.Resources.ArrowSelected : Properties.Resources.Arrow, new Rectangle( new Point(bounds.Width - button.LocationFromRight.X - 5, bounds.Y + startY + 3), new Size(5, 7))); Font font = new Font("Verdana", 10, FontStyle.Regular, GraphicsUnit.Pixel); TextFormatFlags flags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.Internal | TextFormatFlags.WordBreak | TextFormatFlags.WordEllipsis | TextFormatFlags.GlyphOverhangPadding; TextRenderer.DrawText(g, button.Text, font, buttonBounds, textColor, flags); startY += 15; } }
public ShardListItemButtonClickedEventArgs(ServerListItem item, ServerListItemButton button) { this.item = item; this.button = button; }