I looked at your patch, thanks again. I had to debug it, though, because there was a clipping rectangle in DrawAllCells which was not adapted to RTL. And the selection rectangle is not drawn correctly: drag the mouse across several cells horizontally and see that the selection does not follow the mouse correctly as it does vertically or in LTR mode - I did not yet find the bug in there.
Anyway, I uploaded the new version to trunk. When you proceed, it will save time if you would always update your svn before beginning. Just in case you don't know...
I think your previous post already answered the question above: the character-by-character painting routine is the reason why your Arabian characters are reversed. There is a single painting procedure for all text output, InternalDrawRichText in fpsvisualutils. Don't be scared, it is huge, but the main painting operation occurs in the local procedure DrawLine, and there are also some coordinate calculations below in the sections commented by "2a)..." and "2b)..." Be careful that RTL must work also with rotated text; you can create a cell with rotated text by
Grid.Cells[1,1] := 'Text';
Grid.TextRotation[1,1] := rt90DegreeClockwiseRotation;
// or rt90DegreeCounterClockwiseRotation
// or: rtStacked
After that we should look at DrawRow, another "monster", sorry, but there is another clipping rectangle which prevents painting of the cells at the left in RTL mode. Your testing code should have ShowHeaders=true, otherwise you won't see this.
It looks that seeking for that ColRowToOffset is a good idea for finding the points which have to be modified.