View Issue Details

IDProjectCategoryView StatusLast Update
0018918Packages-public2011-08-20 22:30
ReporterAvishai Assigned ToJesus Reyes  
Status closedResolutionfixed 
Product Version0.9.31 (SVN) 
Fixed in Version0.9.31 (SVN) 
Summary0018918: TStringGrid is unusable when BiDiMode set to bdRightToLeft
DescriptionMovement between cells is erratic. Contents of cells jump to different cells. Text of cells sometimes look as though it is rotated somewhat.
Tagsbidi, TStringGrid
Fixed in Revision31456
Attached Files


related to 0019303 acknowledged Lazarus BiDi meta issue 


Vincent Snijders

2011-03-30 22:49

manager   ~0046981

Can you give an example application, that shows this issue?


2011-03-31 08:39

reporter   ~0046995

Drop a TStringGrid on a new blank Form and add this code.

procedure TForm1.FormCreate(Sender: TObject);
  with StringGrid1 do begin
    BiDiMode:= bdRightToLeft;
    AutoAdvance:= aaLeftDown;
    StringGrid1.Options:= StringGrid1.Options+[goAlwaysShowEditor,goEditing,goTabs];

Jesus Reyes

2011-06-29 03:16

developer   ~0049490

There have been some fixes related to bidmode in grids, please test r31448 or later.


2011-06-29 06:58

reporter   ~0049493

Thank you for taking a look at this :) Not having a StringGrid made it almost imposable for RightToLeft programs. I have only looked at StringGrid so far and it is MUCH improved :) I notice that the Horizonal scrollbar works backward in BiDiMode and when I do Horizontal scroll, the graphics brake up. I will continue to look at it and DBGrid. Again, Thank you very much for your work :)


2011-07-02 07:48

reporter   ~0049566

First I would like to thank you for working on the StringGrids and making them usable in RightToLeft mode. I know it is not an easy thing to do :)

When TStringGrid.BiDiMode:= bdRightToLeft:

1. The cell editor does not display a caret in the last (Left) column. It also does not show selected text in the last column.

2. In the last column the PickList does not work.

3. In any column, setting DropDownRows does not work for PickLists.

4. The Horizontal ScrollBar works backward.

5. TDBGrid does not have BiDiMode and ParentBiDiMode properties published but if the ParentBiDiMode is set to bdRightToLeft, it works in RightToLeft mode. This is true for all controls on the "Data Controls" tab. It seems that publishing these properties for all "Data Controls" is all that is needed.

Jesus Reyes

2011-07-04 08:23

developer   ~0049635

for 1 and 2 please check r31548, for 3 check if a std combobox supports DropDownRows and it's not related to bidi mode (I guess), for 4 it remain to be discussed how this should work for all TWincontrols on the different widgets, at least for gtk2 I have seen code that inverts the thumbbar and handle the position, but I have no tested yet, will do next together with 5.


2011-07-04 11:58

reporter   ~0049642

Wow!!! You guys are AWESOME :) As for "4. The Horizontal ScrollBar works backward.", on Hebrew Windows installations the ScrollBar is mirrored when in Hebrew mode on nearly all applications. It's the most intuitive way. Not mirroring it is confusing.

It looks like "DropDownRows" should be "DropDownCount".

I wish I had the skills to help. I know that RightToLeft seems strange to LeftToRight people and many of them are not familiar with how things normally work. I submitted several patches to fix BiDiMode in Controls but so far most of the patches haven't made it to either the Daily Snapshots or SVN. I guess it takes a while. If I can be of help or you just want an opinion on BiDi you can ask me any time.

Jesus Reyes

2011-07-28 21:46

developer   ~0050241

Last edited: 2011-07-28 21:46

scrollbars have been fixed which was the last issue about stringgrid and LTR (I think), I tested windows and gtk2, please try it and close this issue if it's ok.


2011-07-29 09:01

reporter   ~0050254

Last edited: 2011-07-29 13:15

I just installed the latest "Daily Snapshot"
Verson #: 0.9.31
Date: 2011-07-27
FPC Version: 2.4.4
SVN Revision: 31673

Everything seems to be working perfectly with one exception. If I navigate using Arrow keys, Return and Tab everything is fine. But when I used the Horizontal scrollbar it causes some very unexpected results.

1. The scrollbar still seems to be LeftToRight
2. If I use the scrollbar to move to the Left-most cell and then use UP/DOWN Arrow keys, the Cell Editor is not in the correct location. It is positioned about half a cellwidth to the left. As soon as I move to the right, everything returns to normal.

Jesus Reyes

2011-07-29 23:58

developer   ~0050274

Last edited: 2011-07-29 23:59

scrollbar issues were fixed in r31818, so you need to wait a little longer so a snapshot with this revision or newer is available.


2011-07-30 09:41

reporter   ~0050279

OK, thanks. I will be patient :) I'm very impressed with your work. I know it was not easy. Thank you.


2011-07-30 11:24

reporter   ~0050281

OK, I have r31818 now. There still seems to be a problem when using the horizontal scrollbar when the grid is bdRightToLeft and AutoAdvance is aaLeftDown. When I scroll to the left-most cell, select it and then use Shift-Tab to move to the cell to the right, the Cell-Editor is misplaced by about half a cell-width.


2011-07-31 14:34

reporter   ~0050305

I noticed that in r31456, regardless of BiDiMode, if you set TStringGrid.Flat to true, the vertical scrollbar disappears.

Maxim Ganetsky

2011-07-31 14:50

developer   ~0050307

Last edited: 2011-07-31 14:51

Please reopen this bug report or create a new one. Commenting in resolved bug reports is useless since there is very low chance that developer who fixed the bug will see these comments.


2011-07-31 15:08

reporter   ~0050308

Will do, and thanks for the tip. But this bug is yet to be resolved. There are still some issues with BiDiMode.

Maxim Ganetsky

2011-07-31 16:37

developer   ~0050312

Then why do you not reopen it? It is the only way to attract developer's attention.

Jesus Reyes

2011-08-01 20:40

developer   ~0050356

Last edited: 2011-08-01 20:46

in r31456? and in r31818? it works fine here (at least under linux, will test windows later).

Tested the problem with half editor issue, works here too (again under linux), please show a small screenshot of the issue.

2011-08-02 09:31


Grid Bug.JPG (29,767 bytes)   
Grid Bug.JPG (29,767 bytes)   


2011-08-02 09:43

reporter   ~0050368

Last edited: 2011-08-02 09:44

r31456. I tried to upload a screenshot showing the misplaced cell editor and it said that it was successful, but I don't see it. The misplaced cell editor issue is the same regardless of BiDiMode. I used default values for everything except:

AutoAdvance:= aaRightDown
AlternateColor:= clMoneyGreen

goEditing:= True
goTabs:= True

Assuming BiDiMode:= bdLeftToRight and 5 columns:
Use the horizontal scrollbar to position to the col. 5, select a cell in col. 5, then arrow key to move col. 4.

Ah. Now I see the screenshot. I guess it made it afterall.


2011-08-09 08:21

reporter   ~0050627

How do I close this issue?


2011-08-16 23:40

reporter   ~0050888

Thanks guys for such a terrific effort. I know it wasn't easy and I appreciate it very much :)

Issue History

Date Modified Username Field Change
2011-03-13 00:51 Avishai New Issue
2011-03-13 00:51 Avishai Widgetset => Win32/Win64
2011-03-13 01:09 Avishai Tag Attached: bidi
2011-03-13 01:11 Avishai Tag Attached: TStringGrid
2011-03-30 22:49 Vincent Snijders LazTarget => 1.2
2011-03-30 22:49 Vincent Snijders Note Added: 0046981
2011-03-30 22:49 Vincent Snijders Status new => feedback
2011-03-31 08:39 Avishai Note Added: 0046995
2011-03-31 09:17 Vincent Snijders Status feedback => acknowledged
2011-05-06 22:22 Juha Manninen Relationship added related to 0019303
2011-06-27 19:24 Jesus Reyes Status acknowledged => assigned
2011-06-27 19:24 Jesus Reyes Assigned To => Jesus Reyes
2011-06-29 03:16 Jesus Reyes Note Added: 0049490
2011-06-29 03:16 Jesus Reyes Status assigned => feedback
2011-06-29 06:58 Avishai Note Added: 0049493
2011-07-02 07:48 Avishai Note Added: 0049566
2011-07-04 08:23 Jesus Reyes Note Added: 0049635
2011-07-04 11:58 Avishai Note Added: 0049642
2011-07-28 21:46 Jesus Reyes Fixed in Revision => 31818
2011-07-28 21:46 Jesus Reyes Status feedback => resolved
2011-07-28 21:46 Jesus Reyes Fixed in Version => 0.9.31 (SVN)
2011-07-28 21:46 Jesus Reyes Resolution open => fixed
2011-07-28 21:46 Jesus Reyes Note Added: 0050241
2011-07-28 21:46 Jesus Reyes Note Edited: 0050241
2011-07-29 09:01 Avishai Note Added: 0050254
2011-07-29 13:15 Avishai Note Edited: 0050254
2011-07-29 23:58 Jesus Reyes Note Added: 0050274
2011-07-29 23:59 Jesus Reyes Note Edited: 0050274
2011-07-30 09:41 Avishai Note Added: 0050279
2011-07-30 11:24 Avishai Note Added: 0050281
2011-07-31 14:34 Avishai Note Added: 0050305
2011-07-31 14:50 Maxim Ganetsky Note Added: 0050307
2011-07-31 14:51 Maxim Ganetsky Note Edited: 0050307
2011-07-31 15:08 Avishai Note Added: 0050308
2011-07-31 16:37 Maxim Ganetsky Status resolved => assigned
2011-07-31 16:37 Maxim Ganetsky Resolution fixed => reopened
2011-07-31 16:37 Maxim Ganetsky Note Added: 0050312
2011-08-01 20:40 Jesus Reyes Note Added: 0050356
2011-08-01 20:40 Jesus Reyes Status assigned => feedback
2011-08-01 20:46 Jesus Reyes Note Edited: 0050356
2011-08-02 09:31 Avishai File Added: Grid Bug.JPG
2011-08-02 09:43 Avishai Note Added: 0050368
2011-08-02 09:44 Avishai Note Edited: 0050368
2011-08-09 08:21 Avishai Note Added: 0050627
2011-08-16 20:25 Jesus Reyes Fixed in Revision 31818 => 31456
2011-08-16 20:25 Jesus Reyes Status feedback => resolved
2011-08-16 20:25 Jesus Reyes Resolution reopened => fixed
2011-08-16 23:40 Avishai Note Added: 0050888
2011-08-20 22:30 Avishai Status resolved => closed