public virtual void Draw(Surfaces.SurfaceBase surface, Rectangle area, object item, ControlStates itemState) { if (item is Color || item is Tuple <Color, Color, string> ) { string value = new string(' ', area.Width - 2); Cell cellLook = GetStateAppearance(itemState).Clone(); if (item is Color color) { cellLook.Background = color; surface.Print(area.Left + 1, area.Top, value, cellLook); } else { cellLook.Foreground = ((Tuple <Color, Color, string>)item).Item2; cellLook.Background = ((Tuple <Color, Color, string>)item).Item1; value = ((Tuple <Color, Color, string>)item).Item3.Align(HorizontalAlignment.Left, area.Width - 2); surface.Print(area.Left + 1, area.Top, value, cellLook); } surface.Print(area.Left, area.Top, " ", cellLook); surface.Print(area.Left + area.Width - 1, area.Top, " ", cellLook); if (itemState.HasFlag(ControlStates.Clicked)) { surface.SetGlyph(area.Left, area.Top, 16); surface.SetGlyph(area.Left + area.Width - 1, area.Top, 17); } } else { base.Draw(surface, area, item, itemState); } }