dbgrid: fixed cell grid might draw over vertical grid lines (issue #8318)

grid: added small margin at the right side of cell so text near the grid line looks better

git-svn-id: trunk@10628 -
This commit is contained in:
jesus 2007-02-12 19:27:56 +00:00
parent 332746fa0f
commit d947dfbb55
2 changed files with 6 additions and 2 deletions

View File

@ -2398,7 +2398,9 @@ end;
procedure TCustomDBGrid.DrawCell(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState);
begin
inherited DrawCell(aCol, aRow, aRect, aState);
PrepareCanvas(aCol, aRow, aState);
if DefaultDrawing then
Canvas.FillRect(aRect);
{$ifdef dbgGridPaint}
DbgOut(' ',IntToStr(aCol));
if gdSelected in aState then DbgOut('S');
@ -2409,6 +2411,7 @@ begin
OnDrawColumnCell(Self, aRect, aCol, TColumn(ColumnFromGridColumn(aCol)), aState)
else
DefaultDrawCell(aCol, aRow, aRect, aState);
DrawCellGrid(aCol, aRow, aRect, aState);
end;
procedure TCustomDBGrid.DrawCheckboxBitmaps(aCol: Integer; aRect: TRect;

View File

@ -2983,9 +2983,10 @@ end;
procedure TCustomGrid.DrawCellText(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState; aText: String);
begin
dec(aRect.Right, 3);
case Canvas.TextStyle.Alignment of
Classes.taLeftJustify: Inc(aRect.Left, 3);
Classes.taRightJustify: Dec(aRect.Right, 3);
Classes.taRightJustify: Dec(aRect.Right, 1);
end;
case Canvas.TextStyle.Layout of
tlTop: Inc(aRect.Top, 3);