mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 00:19:10 +02:00
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:
parent
332746fa0f
commit
d947dfbb55
@ -2398,7 +2398,9 @@ end;
|
|||||||
procedure TCustomDBGrid.DrawCell(aCol, aRow: Integer; aRect: TRect;
|
procedure TCustomDBGrid.DrawCell(aCol, aRow: Integer; aRect: TRect;
|
||||||
aState: TGridDrawState);
|
aState: TGridDrawState);
|
||||||
begin
|
begin
|
||||||
inherited DrawCell(aCol, aRow, aRect, aState);
|
PrepareCanvas(aCol, aRow, aState);
|
||||||
|
if DefaultDrawing then
|
||||||
|
Canvas.FillRect(aRect);
|
||||||
{$ifdef dbgGridPaint}
|
{$ifdef dbgGridPaint}
|
||||||
DbgOut(' ',IntToStr(aCol));
|
DbgOut(' ',IntToStr(aCol));
|
||||||
if gdSelected in aState then DbgOut('S');
|
if gdSelected in aState then DbgOut('S');
|
||||||
@ -2409,6 +2411,7 @@ begin
|
|||||||
OnDrawColumnCell(Self, aRect, aCol, TColumn(ColumnFromGridColumn(aCol)), aState)
|
OnDrawColumnCell(Self, aRect, aCol, TColumn(ColumnFromGridColumn(aCol)), aState)
|
||||||
else
|
else
|
||||||
DefaultDrawCell(aCol, aRow, aRect, aState);
|
DefaultDrawCell(aCol, aRow, aRect, aState);
|
||||||
|
DrawCellGrid(aCol, aRow, aRect, aState);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDBGrid.DrawCheckboxBitmaps(aCol: Integer; aRect: TRect;
|
procedure TCustomDBGrid.DrawCheckboxBitmaps(aCol: Integer; aRect: TRect;
|
||||||
|
@ -2983,9 +2983,10 @@ end;
|
|||||||
procedure TCustomGrid.DrawCellText(aCol, aRow: Integer; aRect: TRect;
|
procedure TCustomGrid.DrawCellText(aCol, aRow: Integer; aRect: TRect;
|
||||||
aState: TGridDrawState; aText: String);
|
aState: TGridDrawState; aText: String);
|
||||||
begin
|
begin
|
||||||
|
dec(aRect.Right, 3);
|
||||||
case Canvas.TextStyle.Alignment of
|
case Canvas.TextStyle.Alignment of
|
||||||
Classes.taLeftJustify: Inc(aRect.Left, 3);
|
Classes.taLeftJustify: Inc(aRect.Left, 3);
|
||||||
Classes.taRightJustify: Dec(aRect.Right, 3);
|
Classes.taRightJustify: Dec(aRect.Right, 1);
|
||||||
end;
|
end;
|
||||||
case Canvas.TextStyle.Layout of
|
case Canvas.TextStyle.Layout of
|
||||||
tlTop: Inc(aRect.Top, 3);
|
tlTop: Inc(aRect.Top, 3);
|
||||||
|
Loading…
Reference in New Issue
Block a user