Speed problem with many strings in the Translation editor

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
BenjyKid
Posts: 18
Joined: Wed Apr 05, 2006 4:08 pm

Speed problem with many strings in the Translation editor

Post 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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Could you please send us at support at sicomponents dot com this unit with TsiLang? We will try to fix this ASAP.
Best regards,
Igor Siticov.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post 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?
Best regards,
Igor Siticov.
BenjyKid
Posts: 18
Joined: Wed Apr 05, 2006 4:08 pm

Post 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.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

In our release sources DefaultRowGeight is set to 18 in DFM. Did you change this manually?
Best regards,
Igor Siticov.
BenjyKid
Posts: 18
Joined: Wed Apr 05, 2006 4:08 pm

Post 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.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post 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.
Best regards,
Igor Siticov.
Post Reply