Page 1 of 1

Avoiding user anguish

Posted: Thu Dec 02, 2010 6:56 am
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

Posted: Thu Dec 02, 2010 11:22 am
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;

Posted: Thu Dec 02, 2010 12:26 pm
by pieterc
Hi,

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