CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGMessageDlg Translation

by assapan » 09 Dec 2015 18:35

Hi,
As variables IWCGMsgDlgTitles and IWCGMsgButtonCaptions in IWCGJQMessageDlg are global i face the problem of different sessions with different languages at the same time.

I had no time to deeply thing on how it would be the best so i modify the source to meet my own requirement which can be different to other users.

So i quickly modified the source to add

in types
Code: Select all
  TIWCGMsgDialogGetButtonText = TFunc<TMsgDlgBtn, string>;
  TIWCGMsgDialogGetTitle = TFunc<TMsgDlgType, string>;


In interface
Code: Select all
var
  OnMsgDlgGetButtonText: TIWCGMsgDialogGetButtonText;
  OnMsgDlgGetTitle: TIWCGMsgDialogGetTitle;


In TIWCGJQMsgDialog.SetTitle
Code: Select all
    if Assigned(OnMsgDlgGetTitle) then
      JQDialogOptions.Title := OnMsgDlgGetTitle(DlgType)
    else
      JQDialogOptions.Title := IWCGMsgDlgTitles[DlgType];


in TIWCGJQMsgDialog.CreateButtons;
Code: Select all
      if Assigned(OnMsgDlgGetButtonText) then
        Button.Text := OnMsgDlgGetButtonText(DlgBtn)
      else
        Button.Text := IWCGMsgButtonCaptions[DlgBtn];


Could you please think about a more general modification :)
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

Return to IWCGJQMessageDlg

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.