public void DrawCell(IGraphics gfx, TableGadget.TableCell cell) { int x = cell.X; int y = cell.Y; int w = cell.Width; int h = cell.Height; Rect cellBox = new Rect(x, y, w, h); FillBox(gfx, cellBox, cell.DrawSelected ? GadgetSelectedPen : cell.Hover?GadgetHoverPen: GadgetBackPen); if (!cell.IsFirstInRow) { gfx.DrawLine(x - 1, y, x - 1, y + h, ShinePen); } gfx.DrawLine(x + w - 2, y, x + w - 2, y + h, ShadowPen); if (cell.Image != null) { DrawImage(gfx, cellBox.Inflated(-1, -1), cell.Image); } if (!string.IsNullOrEmpty(cell.Label)) { var textBox = cellBox; if (cell.Icon != Icons.NONE) { textBox.X += 24; textBox.Width -= 24; } DrawText(gfx, cell.Label, cell.Font, textBox, cell.DrawSelected ? SelectedTextPen : TextPen, cell.HTextAlign, cell.VTextAlign); } if (cell.Icon != Icons.NONE) { gfx.RenderIcon((int)cell.Icon, x + 4, cellBox.CenterY, cell.DrawSelected ? SelectedTextPen : TextPen, HorizontalTextAlign.Left); } }
public void DrawEmptyCell(IGraphics gfx, TableGadget.TableCell cell) { int x = cell.X; int y = cell.Y + cell.Height; int w = cell.Width; int h = cell.Table.Height - cell.Y; Rect cellBox = new Rect(x, y, w, h); FillBox(gfx, cellBox, GadgetBackPen); if (!cell.IsFirstInRow) { gfx.DrawLine(x - 1, y, x - 1, y + h, ShinePen); } gfx.DrawLine(x + w - 2, y, x + w - 2, y + h, ShadowPen); }