Doesn't work right functions TextRect in StringGrid.
Original Reporter info from Mantis: avd
-
Reporter name: Aleksandr
Original Reporter info from Mantis: avd
- Reporter name: Aleksandr
Description:
Sorry for my English, I'm using translator.
Doesn't work right functions TextRect in StringGrid.
The picture shows the result of running in Delphi and Lazarus.
I apologize if I was mistaken. I'm not a professional.
Steps to reproduce:
StringGrid1.DefaultDrawing := false;
StringGrid1.DefaultRowHeight := 20;
// =======================
procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState);
const
dColor: integer = $050505;
var
TopText: integer;
begin
if (ACol = 0) and (ARow = 0) then
begin
TopText := aRect.Top + 2;
StringGrid1.Canvas.Brush.Color := $E8F1F4;
StringGrid1.Canvas.FillRect(aRect);
StringGrid1.Canvas.TextOut(aRect.Left + 2, TopText, StringGrid1.Cells[ACol, ARow]);
StringGrid1.Canvas.Brush.Color := StringGrid1.Canvas.Brush.Color - dColor;
aRect.Top := aRect.Top + 6;
StringGrid1.Canvas.FillRect(aRect);
StringGrid1.Canvas.TextRect(aRect, aRect.Left + 2, TopText, StringGrid1.Cells[ACol, ARow]);
StringGrid1.Canvas.Brush.Color := StringGrid1.Canvas.Brush.Color - dColor;
aRect.Top := aRect.Top + 2;
StringGrid1.Canvas.FillRect(aRect);
StringGrid1.Canvas.TextRect(aRect, aRect.Left + 2, TopText, StringGrid1.Cells[ACol, ARow]);
StringGrid1.Canvas.Brush.Color := StringGrid1.Canvas.Brush.Color - dColor;
aRect.Top := aRect.Top + 2;
StringGrid1.Canvas.FillRect(aRect);
StringGrid1.Canvas.TextRect(aRect, aRect.Left + 2, TopText, StringGrid1.Cells[ACol, ARow]);
StringGrid1.Canvas.Brush.Color := StringGrid1.Canvas.Brush.Color - dColor;
aRect.Top := aRect.Top + 2;
StringGrid1.Canvas.FillRect(aRect);
StringGrid1.Canvas.TextRect(aRect, aRect.Left + 2, TopText, StringGrid1.Cells[ACol, ARow]);
StringGrid1.Canvas.Brush.Color := StringGrid1.Canvas.Brush.Color - dColor;
aRect.Top := aRect.Top + 2;
StringGrid1.Canvas.FillRect(aRect);
StringGrid1.Canvas.TextRect(aRect, aRect.Left + 2, TopText, StringGrid1.Cells[ACol, ARow]);
end;
end;
Mantis conversion info:
- Mantis ID: 27363
- OS: Windows
- OS Build: XP
- Build: SVN 46529
- Platform: 32
- Version: 1.2.6
- Fixed in version: 1.5 (SVN)
- Target version: 1.4