Avoiding user anguish

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
pieterc
Posts: 2
Joined: Thu Dec 02, 2010 2:04 am

Avoiding user anguish

Post by pieterc »

I tried to use the method described in "Central Control for Large Application" but I guess my knowledge is a bit on the low side.

Can you give me a small example on how to use the following inside my code and how to call it

type
TsiInterceptStringChange = procedure(const AObject: TObject; const PInfo: PPropInfo; var APropValue: string);

Thanks
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

In your code you should define a procedure with the similar parameters as TsiInterceptStringChange.
Next you assign this procedure to siInterceptStringChange global variable defined in siComp.pas unit.
Then TsiLang will call this procedure EACH time it tries to return a translation for any string.
So the sample code could be something like this:

Code: Select all

procedure MysiInterceptStringChange(const AObject: TObject; const PInfo:
    PPropInfo; var APropValue: string);
begin
  APropValue := APropValue + '---';
end;

siComp.siInterceptStringChange := MysiInterceptStringChange;
Best regards,
Igor Siticov.
pieterc
Posts: 2
Joined: Thu Dec 02, 2010 2:04 am

Post by pieterc »

Hi,

Thanks very much for your prompt reply. It is exactly what I have been struggling to do.
Post Reply