Page 1 of 1

Speed problem with many strings in the Translation editor

Posted: Thu Jun 29, 2006 8:38 am
by BenjyKid
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

Posted: Thu Jun 29, 2006 8:59 am
by isiticov
Could you please send us at support at sicomponents dot com this unit with TsiLang? We will try to fix this ASAP.

Posted: Thu Jun 29, 2006 1:56 pm
by isiticov
Thank you for sending files. It is really strange but it works fast and without any problem on our side. May be this is some hardware graphic card or so problem?

Posted: Wed Jul 19, 2006 11:07 am
by BenjyKid
I've finally found the time to do some more research. In siTransEditor.pas take a look at TsiTransEditFrm.AdjustRowHeight(ARow: Integer); (line 1529).

Code: Select all

    MaxH := DefaultRowHeight; // 17

    //[...] this changes MaxH to 18

    if RowHeights[ARow] <> MaxH then RowHeights[ARow] := MaxH;
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.

Posted: Wed Jul 19, 2006 12:25 pm
by isiticov
In our release sources DefaultRowGeight is set to 18 in DFM. Did you change this manually?

Posted: Wed Jul 19, 2006 1:05 pm
by BenjyKid
You're correct. In the dfm it is set to 18. But that value basically is ignored because of line 1219 in the source:

Code: Select all

  Grid1.DefaultRowHeight := Canvas.TextHeight('H') + 4;
This evaluates to 17 on my PC. Commenting out that line appears to solve the problem.

Posted: Thu Jul 20, 2006 4:17 am
by isiticov
Thank you for details. We've updated this code and hope ti will work fine for you in next version. It is needed for large fonts support.