protected override void DrawItem(Bitmap screen, int x, int y, int width, int height, ref int index, object it, Style cStyle) { bool selected = _selIndex == index; RadioStationItem item = (RadioStationItem)it; if (selected) screen.DrawRectangle(Colors.Blue, 0, x, y, width, height, 0, 0, cStyle.ListBoxSelectedItemBack1, x, y, cStyle.ListBoxSelectedItemBack2, x, y + height, Enabled ? (ushort)256 : (ushort)128); Color textColor = item.IsConnecting ? Colors.Yellow : (item.IsPlaying ? Colors.LightGreen : (Enabled ? (selected ? cStyle.TextBoxPressedTextColor : cStyle.TextBoxEnabledTextColor) : cStyle.TextBoxDisabledTextColor)); screen.DrawText(item.Name, nameFont, textColor, x + 5, y + 2); screen.DrawText(item.Address, textFont, textColor, x + 5, y + 2 + nameFont.Height + 2); }
protected override void DrawItem(Bitmap screen, int x, int y, int width, int height, ref int index, object it, Style cStyle) { bool selected = _selIndex == index; FsItem item = (FsItem)it; if (selected) screen.DrawRectangle(Colors.Blue, 0, x, y, width, height, 0, 0, cStyle.ListBoxSelectedItemBack1, x, y, cStyle.ListBoxSelectedItemBack2, x, y + height, Enabled ? (ushort)256 : (ushort)128); Color textColor = _playing == it ? Colors.Green : (Enabled ? (selected ? cStyle.TextBoxPressedTextColor : cStyle.TextBoxEnabledTextColor) : cStyle.TextBoxDisabledTextColor); Bitmap toDraw = item.IsBack ? fsBack : (item.IsDirectory ? fsFolder : (item.IsMusicFile ? fsMusic : fsNone)); screen.DrawImage(x + 5, y + (ItemHeight - 16) / 2, toDraw, 0, 0, 16, 16); screen.DrawText(item.Name, nameFont, textColor, x + 26, y + (ItemHeight - nameFont.Height) / 2); }