Access to a dedicated Caption of TsiLang

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Thomas J.
Posts: 129
Joined: Fri Jan 06, 2006 8:09 am

Access to a dedicated Caption of TsiLang

Post by Thomas J. »

How can I access a dedicated caption of TsiLang component?
Caption property is type of TStrings and I need one dedicated String out of the Caption property.
For example I want to change the caption of the TForm in depend of record selection like "Contract 2007/003493" and the original caption is "Contract".

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

Post by isiticov »

Code: Select all

procedure ReplaceStringValue(const AStrings: TStrings; Value, AName: Tstring; ALang: Integer);  
But I would recommend for such cases use OnChangeLanguage event and set caption in code using GetTextOrDefault() method.
Best regards,
Igor Siticov.
Thomas J.
Posts: 129
Joined: Fri Jan 06, 2006 8:09 am

Post by Thomas J. »

No I think you dind't understand me correct.

The origin caption is "Contract" for the form and if no dataset is show in the form is this caption "Contract" correct.

Now the user create a contract and the system generate a no. like 2007-11-11-1 so the caption has to change to "Contract 2007-11-11-1"

If the user creates a second contract the caption has to be "Contract" + " " + no --> e.g. "Contract 2007-11-11-2"
But for this I have to get the original caption wich is "Contract"

right now I store the caption in the OnCreate event in a member variable and use it if the user select or create a new record.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Then I would recommend to store caption Contract in Strings section and set form's caption using GetTextOrDefault. Lately you just combine it with necessary contract no.
Best regards,
Igor Siticov.
Thomas J.
Posts: 129
Joined: Fri Jan 06, 2006 8:09 am

Post by Thomas J. »

Yes that's one solution, but I cannot acces a dedicated string from property Caption?
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Code: Select all

GetStringValue(const AStrings: TStrings; AName: string; ALang: nteger): string;
Please note: once you change caption of the form and switch language TsiLang will automatically remember changed caption for the language that was active!
Best regards,
Igor Siticov.
Post Reply