Merge pull request #1802 from RaiKoHoff/DevNewFeatures

Modern style message box icons
This commit is contained in:
Rainer Kottenhoff 2019-11-22 01:36:06 +01:00 committed by GitHub
commit 8345265be1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 17 deletions

View File

@ -1 +1 @@
2683
2684

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.19.1121.2683"
version="5.19.1122.2684"
type="win32"
/>
<description>Notepad3 BETA</description>

View File

@ -226,27 +226,24 @@ static INT_PTR CALLBACK _InfoBoxLngDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
LPINFOBOXLNG const lpMsgBox = (LPINFOBOXLNG)lParam;
int const cx = GetSystemMetrics(SM_CXSMICON);
int const cy = GetSystemMetrics(SM_CYSMICON);
UINT const fuLoad = LR_DEFAULTCOLOR | LR_SHARED;
switch (lpMsgBox->uType & MB_ICONMASK)
{
case MB_ICONQUESTION:
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_QUES), IMAGE_ICON, cx, cy, fuLoad), 0);
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgQuest, 0);
break;
case MB_ICONWARNING: // = MB_ICONEXCLAMATION
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_WARNING), IMAGE_ICON, cx, cy, fuLoad), 0);
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgWarn, 0);
break;
case MB_ICONERROR: // = MB_ICONSTOP, MB_ICONHAND
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_ERROR), IMAGE_ICON, cx, cy, fuLoad), 0);
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgError, 0);
break;
case MB_USERICON:
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIcon48, 0);
break;
case MB_ICONINFORMATION: // = MB_ICONASTERISK
default:
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadImage(NULL, MAKEINTRESOURCE(OIC_INFORMATION), IMAGE_ICON, cx, cy, fuLoad), 0);
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)Globals.hIconMsgInfo, 0);
break;
}

View File

@ -875,17 +875,41 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
s_hRichEdit = LoadLibrary(L"MSFTEDIT.DLL"); // Use "RichEdit50W" for control in common_res.h
}
int const cxs = GetSystemMetrics(SM_CXSMICON);
int const cys = GetSystemMetrics(SM_CYSMICON);
int const cxl = GetSystemMetrics(SM_CXICON);
int const cyl = GetSystemMetrics(SM_CYICON);
//UINT const fuLoad = LR_DEFAULTCOLOR | LR_SHARED;
if (!Globals.hDlgIcon) {
Globals.hDlgIcon = LoadImage(hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED);
LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDR_MAINWND), cxs, cys, &(Globals.hDlgIcon));
}
if (!Globals.hIcon48) {
Globals.hIcon48 = LoadImage(hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON, 48, 48, LR_DEFAULTCOLOR | LR_SHARED);
LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDR_MAINWND), cxl, cxl, &(Globals.hIcon48));
}
if (!Globals.hIcon128) {
LoadIconWithScaleDown(hInstance, MAKEINTRESOURCE(IDR_MAINWND), 128, 128, &(Globals.hIcon128));
}
if (!Globals.hIcon128) {
Globals.hIcon128 = LoadImage(hInstance, MAKEINTRESOURCE(IDR_MAINWND), IMAGE_ICON, 128, 128, LR_DEFAULTCOLOR | LR_SHARED);
if (!Globals.hIconMsgInfo) {
LoadIconWithScaleDown(NULL, IDI_INFORMATION, cxl, cyl, &(Globals.hIconMsgInfo));
}
if (!Globals.hIconMsgWarn) {
LoadIconWithScaleDown(NULL, IDI_WARNING, cxl, cyl, &(Globals.hIconMsgWarn));
}
if (!Globals.hIconMsgError) {
LoadIconWithScaleDown(NULL, IDI_ERROR, cxl, cyl, &(Globals.hIconMsgError));
}
if (!Globals.hIconMsgQuest) {
LoadIconWithScaleDown(NULL, IDI_QUESTION, cxl, cyl, &(Globals.hIconMsgQuest));
}
if (!Globals.hIconMsgShield) {
LoadIconWithScaleDown(NULL, IDI_SHIELD, cxl, cyl, &(Globals.hIconMsgShield));
}
if (!Globals.hIconMsgWinLogo) {
LoadIconWithScaleDown(NULL, IDI_SHIELD, cxl, cyl, &(Globals.hIconMsgWinLogo));
}
// Command Line Help Dialog
@ -9992,6 +10016,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy, bool bP
GetLngString(IDS_MUI_UNTITLED, tch, COUNTOF(tch));
}
switch (MessageBoxLng(Globals.hwndMain, MB_YESNOCANCEL | MB_ICONWARNING, IDS_MUI_ASK_SAVE, tch))
{
case IDCANCEL:

View File

@ -300,6 +300,12 @@ typedef struct _globals_t
HICON hDlgIcon;
HICON hIcon48;
HICON hIcon128;
HICON hIconMsgInfo;
HICON hIconMsgWarn;
HICON hIconMsgError;
HICON hIconMsgQuest;
HICON hIconMsgShield;
HICON hIconMsgWinLogo;
HWND hwndDlgFindReplace;
HWND hwndDlgCustomizeSchemes;
int iDefaultCharSet;

View File

@ -8,8 +8,8 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 19
#define VERSION_REV 1121
#define VERSION_BUILD 2683
#define VERSION_REV 1122
#define VERSION_BUILD 2684
#define SCINTILLA_VER 421
#define ONIGURUMA_REGEX_VER 6.9.4
#define UCHARDET_VER 2018.09.27