Embarcadero has broken owner drawing of TStringGrid several times. To get the text positioned correctly you need version-specific X and Y offsets. Here is the case statement GExperts uses (from GX_StringGridDrawFix.pas): procedure DetermineTextOffsets(_Focused: Boolean; out _XOffset, _YOffset: Integer); begin case GetBorlandIdeVersion of ideD600..ideRSXE1U1: begin // Versions before XE2 worked fine with an offset of 2 for both, x and y _XOffset := 2; _YOffset := 2; end; ideRSXE2..ideRS103U3: begin // from XE2 onwards we need a different y offset _XOffset := 2; _YOffset := 0; end; ideRS104: begin // fix for original bug in Delphi 10.4 _XOffset := 0; _YOffset := 0; end; ideRS104P2: begin // Embarcadero managed to bungle the StringGrid redraw fix in RS 10.4 patch 2. // Now we have to check whether the grid is focused and use a different x offset in that case. if _Focused then begin _XOffset := 6; _YOffset := 2; end else begin _XOffset := 2; _YOffset := 2; end; end; ideRS104U1,…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.