SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Access to a dedicated Caption of TsiLang

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Thomas J.



Joined: 06 Jan 2006
Posts: 124

PostPosted: Thu Nov 08, 2007 2:37 pm    Post subject: Access to a dedicated Caption of TsiLang Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Thu Nov 08, 2007 4:21 pm    Post subject: Reply with quote

Code:
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.
Back to top
View user's profile Send private message
Thomas J.



Joined: 06 Jan 2006
Posts: 124

PostPosted: Fri Nov 09, 2007 2:42 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Fri Nov 09, 2007 3:03 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Thomas J.



Joined: 06 Jan 2006
Posts: 124

PostPosted: Fri Nov 09, 2007 3:34 pm    Post subject: Reply with quote

Yes that's one solution, but I cannot acces a dedicated string from property Caption?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Sat Nov 10, 2007 6:20 am    Post subject: Reply with quote

Code:
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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group