/// <summary> /// Draw the borders of the specified cell using DrawGradient3DBorder /// </summary> /// <param name="p_Cell"></param> /// <param name="p_CellPosition"></param> /// <param name="e">Paint arguments</param> /// <param name="p_ClientRectangle">Rectangle position where draw the current cell, relative to the current view,</param> /// <param name="p_Status"></param> protected override void DrawCell_Border(SourceGrid2.Cells.ICellVirtual p_Cell, Position p_CellPosition, PaintEventArgs e, Rectangle p_ClientRectangle, DrawCellStatus p_Status) { Color l_BackColor; if (p_Status == DrawCellStatus.Focus) { l_BackColor = FocusBackColor; } else if (p_Status == DrawCellStatus.Selected) { l_BackColor = SelectionBackColor; } else { l_BackColor = BackColor; } if (p_CellPosition == p_Cell.Grid.MouseDownPosition) { SourceLibrary.Drawing.ControlPaint.DrawGradient3DBorder(e.Graphics, p_ClientRectangle, l_BackColor, HeaderShadowColor, HeaderLightColor, HeaderShadowBorderWidth, HeaderLightBorderWidth, SourceLibrary.Drawing.Gradient3DBorderStyle.Sunken); } else { SourceLibrary.Drawing.ControlPaint.DrawGradient3DBorder(e.Graphics, p_ClientRectangle, l_BackColor, HeaderShadowColor, HeaderLightColor, HeaderShadowBorderWidth, HeaderLightBorderWidth, SourceLibrary.Drawing.Gradient3DBorderStyle.Raised); } }
/// <summary> /// Draw the image and the displaystring of the specified cell. /// </summary> /// <param name="p_Cell"></param> /// <param name="p_CellPosition"></param> /// <param name="e">Paint arguments</param> /// <param name="p_ClientRectangle">Rectangle position where draw the current cell, relative to the current view,</param> /// <param name="p_Status"></param> protected override void DrawCell_ImageAndText(SourceGrid2.Cells.ICellVirtual p_Cell, Position p_CellPosition, PaintEventArgs e, Rectangle p_ClientRectangle, DrawCellStatus p_Status) { base.DrawCell_ImageAndText(p_Cell, p_CellPosition, e, p_ClientRectangle, p_Status); if (p_Cell is ICellSortableHeader) { ICellSortableHeader l_Header = (ICellSortableHeader)p_Cell; SortStatus l_Status = l_Header.GetSortStatus(p_CellPosition); if (l_Status.Mode == GridSortMode.Ascending) { Utility.PaintImageAndText(e.Graphics, p_ClientRectangle, CommonImages.SortUp, ContentAlignment.MiddleRight, false, null, null, false, Border, Color.Black, null); } else if (l_Status.Mode == GridSortMode.Descending) { Utility.PaintImageAndText(e.Graphics, p_ClientRectangle, CommonImages.SortDown, ContentAlignment.MiddleRight, false, null, null, false, Border, Color.Black, null); } } }