| |
30 |
30 |
bool CAboutDlg::m_bLock=false; |
| |
31 |
31 |
|
| |
32 |
32 |
CAboutDlg::CAboutDlg() :ictranslate::CLanguageDialog(CAboutDlg::IDD, NULL, &m_bLock) |
| |
33 |
33 |
{ |
| |
34 |
34 |
|
| |
35 |
35 |
|
| |
36 |
36 |
RegisterStaticExControl(AfxGetInstanceHandle()); |
| |
37 |
37 |
} |
| |
38 |
38 |
|
| |
39 |
39 |
CAboutDlg::~CAboutDlg() |
| |
40 |
40 |
{ |
| |
41 |
41 |
} |
| |
42 |
42 |
|
| |
43 |
43 |
BEGIN_MESSAGE_MAP(CAboutDlg,ictranslate::CLanguageDialog) |
| |
44 |
44 |
|
| |
45 |
45 |
|
| |
46 |
46 |
END_MESSAGE_MAP() |
| |
47 |
47 |
|
| |
48 |
48 |
void CAboutDlg::UpdateProgramVersion() |
| |
49 |
49 |
{ |
| |
50 |
|
CWnd* pCtl=(CWnd*)GetDlgItem(IDC_PROGRAM_STATICEX); |
| |
51 |
|
CWnd* pCtl2=(CWnd*)GetDlgItem(IDC_FULLVERSION_STATICEX); |
| |
|
50 |
CWnd* pCtl = GetDlgItem(IDC_PROGRAM_STATICEX); |
| |
|
51 |
CWnd* pCtl2 = GetDlgItem(IDC_FULLVERSION_STATICEX); |
| |
52 |
52 |
CWnd* pWndCopyright = GetDlgItem(IDC_COPYRIGHT_STATIC); |
| |
53 |
|
if (!pCtl || !pCtl2 || !pWndCopyright) |
| |
|
53 |
CWnd* pctlSite = GetDlgItem(IDC_HOMEPAGELINK_STATIC); |
| |
|
54 |
CWnd* pctlLanguage = GetDlgItem(IDC_LANGUAGE_STATIC); |
| |
|
55 |
CWnd* pctlContact = GetDlgItem(IDC_CONTACT1LINK_STATIC); |
| |
|
56 |
|
| |
|
57 |
if (!pCtl || !pCtl2 || !pWndCopyright || !pctlSite || !pctlLanguage || !pctlContact) |
| |
54 |
58 |
return; |
| |
55 |
|
else |
| |
56 |
|
{ |
| |
57 |
|
CString strText = GetResManager()->LoadString(IDS_ABOUTVERSION_STRING); |
| |
58 |
|
strText += GetApp()->GetAppVersion(); |
| |
59 |
59 |
|
| |
|
60 |
|
| |
60 |
61 |
pCtl->SetWindowText(GetApp()->GetAppNameVer()); |
| |
|
62 |
|
| |
|
63 |
|
| |
|
64 |
CString strText; |
| |
|
65 |
strText.Format(_T("%s: %ld.%ld.%ld.%ld"), GetResManager()->LoadString(IDS_ABOUTVERSION_STRING), |
| |
|
66 |
PRODUCT_VERSION1, PRODUCT_VERSION2, PRODUCT_VERSION3, PRODUCT_VERSION4); |
| |
61 |
67 |
pCtl2->SetWindowText(strText); |
| |
|
68 |
|
| |
62 |
69 |
pWndCopyright->SetWindowText(_T(COPYRIGHT_INFO)); |
| |
|
70 |
|
| |
|
71 |
|
| |
|
72 |
pctlSite->SetWindowText(_T(PRODUCT_SITE) _T("|") _T(PRODUCT_SITE)); |
| |
|
73 |
pctlContact->SetWindowText(_T(CONTACT_INFO) _T("|mailto:") _T(CONTACT_INFO)); |
| |
|
74 |
|
| |
|
75 |
|
| |
|
76 |
ictranslate::CResourceManager* pResManager = GetResManager(); |
| |
|
77 |
if(pResManager) |
| |
|
78 |
{ |
| |
|
79 |
const ictranslate::CLangData* pLangData = pResManager->GetLanguageData(); |
| |
|
80 |
if(pLangData) |
| |
|
81 |
{ |
| |
|
82 |
ictranslate::CFormat fmt(pResManager->LoadString(IDS_ABOUT_LANGUAGE_STRING)); |
| |
|
83 |
fmt.SetParam(_t("%langname"), pLangData->GetLangName()); |
| |
|
84 |
fmt.SetParam(_t("%authors"), pLangData->GetAuthor()); |
| |
|
85 |
|
| |
|
86 |
pctlLanguage->SetWindowText(fmt); |
| |
63 |
87 |
} |
| |
64 |
88 |
} |
| |
|
89 |
} |
| |
65 |
90 |
|
| |
66 |
91 |
BOOL CAboutDlg::OnInitDialog() |
| |
67 |
92 |
{ |
| |
68 |
93 |
CLanguageDialog::OnInitDialog(); |
| |
69 |
94 |
|
| |
70 |
95 |
UpdateProgramVersion(); |
| |
71 |
96 |
|
| |
72 |
97 |
return TRUE; |
| |
73 |
98 |
} |
| |
74 |
99 |
|
| |
75 |
100 |
void CAboutDlg::OnLanguageChanged() |
| |
76 |
101 |
{ |
| |
77 |
102 |
UpdateProgramVersion(); |
| |
78 |
103 |
} |
| |
79 |
104 |
|
| |
80 |
105 |
BOOL CAboutDlg::OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip) |
| |
81 |
106 |
{ |
| |
82 |
107 |
switch(uiID) |
| |
83 |
108 |
{ |
| |
84 |
109 |
case IDC_HOMEPAGELINK_STATIC: |