Hi,
I have a program that has about 2100 strings in the strings section of the translation editor. Now when I click on strings on the left side in the translation editor it takes very long. While translation editor is loading the strings I notice many repaints as if the translation editor adds one line then does a repaint and then adds the next item and does a another repaint and so on. Could that be optimized?
The temporary workaround is to switch to another program that is running in full screen. Then Windows won't send the paint messages and it is fast. This is also a strong indication that the slow loading comes from lots of unnecessary repaints.
Regards,
Sebastian
Speed problem with many strings in the Translation editor
I've finally found the time to do some more research. In siTransEditor.pas take a look at TsiTransEditFrm.AdjustRowHeight(ARow: Integer); (line 1529).
DefaultRowHeight is set to 17. But then MaxH will be changed to 18. This means that RowHeights[ARow] will be changed to 18 which means that it will take a lot of time if I have many rows.
I hope this will help you find the problem.
Code: Select all
MaxH := DefaultRowHeight; // 17
//[...] this changes MaxH to 18
if RowHeights[ARow] <> MaxH then RowHeights[ARow] := MaxH;
I hope this will help you find the problem.
You're correct. In the dfm it is set to 18. But that value basically is ignored because of line 1219 in the source:
This evaluates to 17 on my PC. Commenting out that line appears to solve the problem.
Code: Select all
Grid1.DefaultRowHeight := Canvas.TextHeight('H') + 4;