-
Notifications
You must be signed in to change notification settings - Fork 198
/
AboutDlg.cpp
308 lines (262 loc) · 13.7 KB
/
AboutDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
/*---------------------------------------------------------------------------*/
// Author : hiyohiyo
// Mail : [email protected]
// Web : https://crystalmark.info/
// License : MIT License
/*---------------------------------------------------------------------------*/
#include "stdafx.h"
#include "DiskInfo.h"
#include "DiskInfoDlg.h"
#include "AboutDlg.h"
IMPLEMENT_DYNCREATE(CAboutDlg, CDialog)
CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
: CDialogFx(CAboutDlg::IDD, pParent)
{
CMainDialogFx* p = (CMainDialogFx*)pParent;
m_ZoomType = p->GetZoomType();
m_FontFace = p->GetFontFace();
m_FontScale = p->GetFontScale();
m_FontRatio = p->GetFontRatio();
m_FontRender = p->GetFontRender();
m_CurrentLangPath = p->GetCurrentLangPath();
m_DefaultLangPath = p->GetDefaultLangPath();
m_ThemeDir = p->GetThemeDir();
m_CurrentTheme = p->GetCurrentTheme();
m_DefaultTheme = p->GetDefaultTheme();
m_Ini = p->GetIniPath();
#ifdef SUISHO_AOI_SUPPORT
m_BackgroundName = L"AoiAbout";
#elif MSI_MEI_SUPPORT
m_BackgroundName = L"About";
#elif KUREI_KEI_SUPPORT
m_BackgroundName = L"KureiKeiAbout";
#elif SUISHO_SHIZUKU_SUPPORT
m_BackgroundName = L"ShizukuAbout";
#else
m_BackgroundName = L"";
#endif
}
CAboutDlg::~CAboutDlg()
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogFx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LOGO, m_CtrlLogo);
DDX_Control(pDX, IDC_PROJECT_SITE_1, m_CtrlProjectSite1);
DDX_Control(pDX, IDC_PROJECT_SITE_2, m_CtrlProjectSite2);
DDX_Control(pDX, IDC_PROJECT_SITE_3, m_CtrlProjectSite3);
DDX_Control(pDX, IDC_PROJECT_SITE_4, m_CtrlProjectSite4);
DDX_Control(pDX, IDC_PROJECT_SITE_5, m_CtrlProjectSite5);
DDX_Control(pDX, IDC_SECRET_VOICE, m_CtrlSecretVoice);
DDX_Control(pDX, IDC_VERSION, m_CtrlVersion);
DDX_Control(pDX, IDC_LICENSE, m_CtrlLicense);
DDX_Control(pDX, IDC_RELEASE, m_CtrlRelease);
DDX_Control(pDX, IDC_COPYRIGHT1, m_CtrlCopyright1);
DDX_Control(pDX, IDC_COPYRIGHT2, m_CtrlCopyright2);
DDX_Control(pDX, IDC_EDITION, m_CtrlEdition);
}
BOOL CAboutDlg::OnInitDialog()
{
CDialogFx::OnInitDialog();
SetWindowTitle(i18n(L"WindowTitle", L"ABOUT"));
m_bShowWindow = TRUE;
m_CtrlVersion.SetWindowTextW(PRODUCT_NAME L" " PRODUCT_VERSION);
m_CtrlEdition.SetWindowTextW(PRODUCT_EDITION);
m_CtrlRelease.SetWindowTextW(L"Release: " PRODUCT_RELEASE);
m_CtrlCopyright1.SetWindowTextW(PRODUCT_COPYRIGHT_1);
m_CtrlCopyright2.SetWindowTextW(PRODUCT_COPYRIGHT_2);
m_CtrlLicense.SetWindowTextW(PRODUCT_LICENSE);
#ifndef SUISHO_SHIZUKU_SUPPORT
m_CtrlProjectSite1.ShowWindow(SW_HIDE);
m_CtrlProjectSite2.ShowWindow(SW_HIDE);
m_CtrlProjectSite3.ShowWindow(SW_HIDE);
m_CtrlProjectSite4.ShowWindow(SW_HIDE);
m_CtrlProjectSite5.ShowWindow(SW_HIDE);
#endif
UpdateDialogSize();
CenterWindow();
ShowWindow(SW_SHOW);
return TRUE;
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogFx)
ON_WM_ERASEBKGND()
ON_BN_CLICKED(IDC_LOGO, &CAboutDlg::OnLogo)
ON_BN_CLICKED(IDC_LICENSE, &CAboutDlg::OnLicense)
ON_BN_CLICKED(IDC_VERSION, &CAboutDlg::OnVersion)
#ifdef SUISHO_SHIZUKU_SUPPORT
ON_BN_CLICKED(IDC_SECRET_VOICE, &CAboutDlg::OnSecretVoice)
ON_BN_CLICKED(IDC_PROJECT_SITE_1, &CAboutDlg::OnProjectSite1)
ON_BN_CLICKED(IDC_PROJECT_SITE_2, &CAboutDlg::OnProjectSite2)
ON_BN_CLICKED(IDC_PROJECT_SITE_3, &CAboutDlg::OnProjectSite3)
ON_BN_CLICKED(IDC_PROJECT_SITE_4, &CAboutDlg::OnProjectSite4)
ON_BN_CLICKED(IDC_PROJECT_SITE_5, &CAboutDlg::OnProjectSite5)
#endif
END_MESSAGE_MAP()
void CAboutDlg::UpdateDialogSize()
{
CDialogFx::UpdateDialogSize();
ChangeZoomType(m_ZoomType);
SetClientSize(SIZE_X, SIZE_Y, m_ZoomRatio);
UpdateBackground(TRUE, m_bDarkMode);
#ifdef SUISHO_SHIZUKU_SUPPORT
m_CtrlProjectSite1.SetHandCursor();
m_CtrlProjectSite2.SetHandCursor();
m_CtrlProjectSite3.SetHandCursor();
m_CtrlProjectSite4.SetHandCursor();
m_CtrlProjectSite5.SetHandCursor();
m_CtrlSecretVoice.SetHandCursor();
#endif
#ifdef SUISHO_AOI_SUPPORT
m_CtrlProjectSite1.InitControl(184, 516, 148, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite2.InitControl(244, 548, 108, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite3.InitControl(232, 564, 180, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite4.InitControl(244, 584, 120, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite5.InitControl(0, 0, 0, 0, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLogo.InitControl(32, 496, 128, 144, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlSecretVoice.InitControl(364, 264, 44, 20, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#elif MSI_MEI_SUPPORT
m_CtrlProjectSite1.InitControl(24, 460, 348, 128, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite2.InitControl(168, 604, 36, 24, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite3.InitControl(332, 604, 104, 24, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite4.InitControl(20, 20, 120, 40, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite5.InitControl(464, 604, 168, 24, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLogo.InitControl(80, 64, 128, 128, m_ZoomRatio, &m_BkDC, IP(L"Logo"), 1, BS_CENTER, OwnerDrawImage, FALSE, FALSE, FALSE);
m_CtrlSecretVoice.InitControl(392, 240, 48, 40, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#elif KUREI_KEI_SUPPORT
m_CtrlProjectSite1.InitControl(340, 232, 268, 100, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite2.InitControl(386, 376, 48, 40, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite3.InitControl(492, 376, 108, 40, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite4.InitControl(386, 600, 224, 60, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite5.InitControl(0, 0, 0, 0, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite5.ShowWindow(SW_HIDE);
m_CtrlLogo.InitControl(12, 20, 128, 128, m_ZoomRatio, &m_BkDC, IP(L"Logo"), 1, BS_CENTER, OwnerDrawImage, FALSE, FALSE, FALSE);
m_CtrlSecretVoice.InitControl(132, 324, 48, 28, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#elif SUISHO_SHIZUKU_SUPPORT
m_CtrlProjectSite1.InitControl(64, 368, 140, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite2.InitControl(64, 416, 148, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite3.InitControl(64, 432, 184, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite4.InitControl(40, 460, 208, 16, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlProjectSite5.InitControl(92, 504, 432, 124, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLogo.InitControl(80, 12, 128, 128, m_ZoomRatio, &m_BkDC, IP(L"Logo"), 1, BS_CENTER, OwnerDrawImage, FALSE, FALSE, FALSE);
m_CtrlSecretVoice.InitControl(392, 280, 44, 24, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#else
m_CtrlLogo.InitControl(12, 12, 128, 128, m_ZoomRatio, &m_BkDC, IP(L"Logo"), 1, BS_CENTER, OwnerDrawImage, FALSE, FALSE, FALSE);
#endif
m_CtrlLogo.SetHandCursor();
#ifdef MSI_MEI_SUPPORT
COLORREF fontColor = RGB(255, 255, 255);
#else
COLORREF fontColor = RGB(0, 0, 0);
#endif
m_CtrlVersion.SetFontEx(m_FontFace, 22, 22, m_ZoomRatio, m_FontRatio, fontColor, FW_BOLD, m_FontRender);
m_CtrlEdition.SetFontEx(m_FontFace, 18, 18, m_ZoomRatio, m_FontRatio, fontColor, FW_BOLD, m_FontRender);
m_CtrlRelease.SetFontEx(m_FontFace, 16, 16, m_ZoomRatio, m_FontRatio, fontColor, FW_NORMAL, m_FontRender);
m_CtrlCopyright1.SetFontEx(m_FontFace, 16, 16, m_ZoomRatio, m_FontRatio, fontColor, FW_NORMAL, m_FontRender);
m_CtrlCopyright2.SetFontEx(m_FontFace, 16, 16, m_ZoomRatio, m_FontRatio, fontColor, FW_NORMAL, m_FontRender);
m_CtrlLicense.SetFontEx(m_FontFace, 16, 16, m_ZoomRatio, m_FontRatio, fontColor, FW_NORMAL, m_FontRender);
m_CtrlVersion.SetHandCursor();
m_CtrlLicense.SetHandCursor();
#ifdef SUISHO_AOI_SUPPORT
m_CtrlVersion.InitControl(0, 52, 288, 28, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlEdition.InitControl(0, 80, 288, 28, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlRelease.InitControl(0, 116, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright1.InitControl(0, 136, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright2.InitControl(0, 156, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLicense.InitControl(0, 176, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#elif MSI_MEI_SUPPORT
m_CtrlVersion.InitControl(0, 204, 288, 28, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlEdition.InitControl(0, 232, 288, 28, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlRelease.InitControl(0, 268, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright1.InitControl(0, 288, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright2.InitControl(0, 308, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLicense.InitControl(0, 0, 0, 0, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#elif KUREI_KEI_SUPPORT
m_CtrlVersion.InitControl(152, 12, 476, 28, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlEdition.InitControl(152, 40, 476, 28, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlRelease.InitControl(152, 72, 476, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright1.InitControl(152, 96, 476, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright2.InitControl(152, 116, 476, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLicense.InitControl(152, 136, 476, 20, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#elif SUISHO_SHIZUKU_SUPPORT
m_CtrlVersion.InitControl(0, 152, 288, 28, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlEdition.InitControl(0, 180, 288, 28, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlRelease.InitControl(0, 216, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright1.InitControl(0, 236, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlCopyright2.InitControl(0, 256, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
m_CtrlLicense.InitControl(0, 276, 288, 20, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, FALSE, FALSE, FALSE);
#else
m_CtrlVersion.InitControl(140, 12, 340, 28, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, m_bHighContrast, m_bDarkMode, FALSE);
m_CtrlEdition.InitControl(140, 40, 340, 28, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, m_bHighContrast, m_bDarkMode, FALSE);
m_CtrlRelease.InitControl(140, 76, 340, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, m_bHighContrast, m_bDarkMode, FALSE);
m_CtrlCopyright1.InitControl(140, 100, 340, 20, m_ZoomRatio, &m_BkDC, NULL, 0, SS_CENTER, OwnerDrawTransparent, m_bHighContrast, m_bDarkMode, FALSE);
m_CtrlLicense.InitControl(140, 120, 340, 20, m_ZoomRatio, &m_BkDC, NULL, 0, BS_CENTER, OwnerDrawTransparent, m_bHighContrast, m_bDarkMode, FALSE);
m_CtrlCopyright2.ShowWindow(SW_HIDE);
#endif
Invalidate();
}
BOOL CAboutDlg::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(&rect);
return pDC->BitBlt(0, 0, rect.Width(), rect.Height(), &m_BkDC, 0, 0, SRCCOPY);
}
void CAboutDlg::OnLogo()
{
if (GetUserDefaultLCID() == 0x0411)// Japanese
{
OpenUrl(URL_MAIN_JA);
}
else // Other Language
{
OpenUrl(URL_MAIN_EN);
}
}
void CAboutDlg::OnVersion()
{
if (GetUserDefaultLCID() == 0x0411)// Japanese
{
OpenUrl(URL_VERSION_JA);
}
else // Other Language
{
OpenUrl(URL_VERSION_EN);
}
}
void CAboutDlg::OnLicense()
{
if (GetUserDefaultLCID() == 0x0411)// Japanese
{
OpenUrl(URL_LICENSE_JA);
}
else // Other Language
{
OpenUrl(URL_LICENSE_EN);
}
}
#ifdef SUISHO_SHIZUKU_SUPPORT
void CAboutDlg::OnSecretVoice()
{
::PostMessage(m_ParentWnd->GetSafeHwnd(), MY_PLAY_ALERT_SOUND, 901, NULL);
}
void CAboutDlg::OnProjectSite1()
{
OpenUrl(URL_PROJECT_SITE_1);
}
void CAboutDlg::OnProjectSite2()
{
OpenUrl(URL_PROJECT_SITE_2);
}
void CAboutDlg::OnProjectSite3()
{
OpenUrl(URL_PROJECT_SITE_3);
}
void CAboutDlg::OnProjectSite4()
{
OpenUrl(URL_PROJECT_SITE_4);
}
void CAboutDlg::OnProjectSite5()
{
OpenUrl(URL_PROJECT_SITE_5);
}
#endif