Clone
ixen <ixen@copyhandler.com>
committed
on 03 Dec 06
FS reorganization - next phase (advances [#303]).
LoggerImprovements + 5 more
ch/AboutDlg.cpp (deleted)
1   /************************************************************************
2           Copy Handler 1.x - program for copying data in Microsoft Windows
3                                                    systems.
4           Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl)
5  
6           This program is free software; you can redistribute it and/or modify
7           it under the terms of the GNU General Public License as published by
8           the Free Software Foundation; either version 2 of the License, or
9           (at your option) any later version.
10  
11           This program is distributed in the hope that it will be useful,
12           but WITHOUT ANY WARRANTY; without even the implied warranty of
13           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14           GNU General Public License for more details.
15  
16           You should have received a copy of the GNU General Public License
17           along with this program; if not, write to the Free Software
18           Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19   *************************************************************************/
20  
21   #include "stdafx.h"
22   #include "Copy Handler.h"
23   #include "resource.h"
24   #include "AboutDlg.h"
25   #include "StaticEx.h"
26  
27   #ifdef _DEBUG
28   #define new DEBUG_NEW
29   #endif
30  
31   bool CAboutDlg::m_bLock=false;
32  
33   CAboutDlg::CAboutDlg() : CHLanguageDialog(CAboutDlg::IDD, NULL, &m_bLock)
34   {
35           //{{AFX_DATA_INIT(CAboutDlg)
36           //}}AFX_DATA_INIT
37           RegisterStaticExControl(AfxGetInstanceHandle());
38   }
39  
40   CAboutDlg::~CAboutDlg()
41   {
42   }
43  
44   BEGIN_MESSAGE_MAP(CAboutDlg, CHLanguageDialog)
45           //{{AFX_MSG_MAP(CAboutDlg)
46           //}}AFX_MSG_MAP
47   END_MESSAGE_MAP()
48  
49   void CAboutDlg::UpdateProgramVersion()
50   {
51           CWnd* pCtl=(CWnd*)GetDlgItem(IDC_PROGRAM_STATICEX);
52           CWnd* pCtl2=(CWnd*)GetDlgItem(IDC_FULLVERSION_STATICEX);
53           if (!pCtl || !pCtl2)
54                   return;
55           else
56           {
57                   TCHAR szFull[256];
58                   _stprintf(szFull, GetResManager()->LoadString(IDS_ABOUTVERSION_STRING), GetApp()->GetAppVersion());
59  
60                   pCtl->SetWindowText(GetApp()->GetAppNameVer());
61                   pCtl2->SetWindowText(szFull);
62           }
63   }
64  
65   void CAboutDlg::UpdateThanks()
66   {
67           CEdit* pEdit=(CEdit*)GetDlgItem(IDC_THANX_EDIT);
68           if (pEdit == NULL)
69                   return;
70  
71           // get the info about current translations
72           TCHAR szData[1024];
73           GetConfig()->GetStringValue(PP_PLANGDIR, szData, 1024);
74           GetApp()->ExpandPath(szData);
75           vector<CLangData> vData;
76           GetResManager()->Scan(szData, &vData);
77  
78           // format the info
79           TCHAR szTI[8192];
80           szTI[0]=_T('\0');
81           for (vector<CLangData>::iterator it=vData.begin();it!=vData.end();it++)
82           {
83                   _stprintf(szData, _T("%s\t\t%s [%s%lu, %s%s]\r\n"), it->GetAuthor(), it->GetLangName(), GetResManager()->LoadString(IDS_LANGCODE_STRING), it->GetLangCode(), GetResManager()->LoadString(IDS_LANGVER_STRING), it->GetVersion());
84                   _tcscat(szTI, szData);
85           }
86  
87           TCHAR szText[16384];
88           _sntprintf(szText, 16384, GetResManager()->LoadString(IDR_THANKS_TEXT), szTI);
89           szText[16383]=0;
90           pEdit->SetWindowText(szText);
91   }
92  
93   BOOL CAboutDlg::OnInitDialog()
94   {
95           CHLanguageDialog::OnInitDialog();
96  
97           UpdateProgramVersion();
98           UpdateThanks();
99  
100           return TRUE;
101   }
102  
103   void CAboutDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/)
104   {
105           UpdateProgramVersion();
106           UpdateThanks();
107   }
108  
109   BOOL CAboutDlg::OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip)
110   {
111           switch(uiID)
112           {
113           case IDC_HOMEPAGELINK_STATIC:
114           case IDC_HOMEPAGELINK2_STATIC:
115           case IDC_CONTACT1LINK_STATIC:
116           case IDC_CONTACT2LINK_STATIC:
117           case IDC_CONTACT3LINK_STATIC:
118           case IDC_GENFORUMPAGELINK_STATIC:
119           case IDC_GENFORUMSUBSCRIBELINK_STATIC:
120           case IDC_GENFORUMUNSUBSCRIBELINK_STATIC:
121           case IDC_GENFORUMSENDLINK_STATIC:
122           case IDC_DEVFORUMPAGELINK_STATIC:
123           case IDC_DEVFORUMSUBSCRIBELINK_STATIC:
124           case IDC_DEVFORUMUNSUBSCRIBELINK_STATIC:
125           case IDC_DEVFORUMSENDLINK_STATIC:
126                   {
127                           HWND hWnd=::GetDlgItem(this->m_hWnd, uiID);
128                           if (!hWnd)
129                                   return FALSE;
130                           ::SendMessage(hWnd, SEM_GETLINK, (WPARAM)79, (LPARAM)pTip->szText);
131                           pTip->szText[79]=_T('\0');
132                           return TRUE;
133                   }
134           default:
135                   return FALSE;
136           }
137   }