mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #2422 from RaiKoHoff/Dev_ScintillaOrig
Fix DPI scaling for Scintilla surface component
This commit is contained in:
commit
5dce5d3562
@ -1 +1 @@
|
||||
612
|
||||
613
|
||||
|
||||
@ -132,8 +132,8 @@ INT_PTR CALLBACK SetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hDlg);
|
||||
return true;
|
||||
UpdateWindowLayoutForDPI(hDlg, (RECT*)lParam, NULL);
|
||||
return !0;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
@ -150,7 +150,7 @@ INT_PTR CALLBACK SetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
}
|
||||
InvalidateRect(hDlg, NULL, TRUE);
|
||||
}
|
||||
return true;
|
||||
return !0;
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
@ -223,10 +223,9 @@ INT_PTR CALLBACK SetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// helper for setting password when reading a file
|
||||
// the complication in this version is that the incoming text is unicode. We deal
|
||||
@ -254,11 +253,11 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
// Don't use: SetFocus( GetDlgItem( hDlg, IDC_PWD_EDIT3 ) );
|
||||
SetDialogFocus(hDlg, GetDlgItem(hDlg, IDC_PWD_EDIT3));
|
||||
}
|
||||
return true;
|
||||
return !0;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hDlg);
|
||||
return true;
|
||||
UpdateWindowLayoutForDPI(hDlg, (RECT*)lParam, NULL);
|
||||
return !0;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
@ -273,8 +272,9 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
SendDlgItemMessage(hDlg, IDC_PWD_EDIT3, EM_SETPASSWORDCHAR, (WPARAM)wDot, 0);
|
||||
}
|
||||
InvalidateRect(hDlg, NULL, TRUE);
|
||||
return true;
|
||||
}
|
||||
return !0;
|
||||
|
||||
case IDOK:
|
||||
{
|
||||
bool const useMas = IsButtonChecked(hDlg, IDC_PWD_CHECK3);
|
||||
@ -295,8 +295,7 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
}
|
||||
EndDialog(hDlg, IDOK);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
return !0;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, IDCANCEL);
|
||||
@ -304,7 +303,7 @@ INT_PTR CALLBACK GetKeysDlgProc(HWND hDlg, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.20.612.1"
|
||||
version="5.20.613.1"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 BETA</description>
|
||||
|
||||
@ -669,7 +669,7 @@ void SurfaceGDI::Init(WindowID wid) noexcept {
|
||||
hdc = ::CreateCompatibleDC({});
|
||||
hdcOwned = true;
|
||||
::SetTextAlign(hdc, TA_BASELINE);
|
||||
logPixelsY = DpiForWindow(wid);
|
||||
logPixelsY = DpiYForWindow(wid);
|
||||
}
|
||||
|
||||
void SurfaceGDI::Init(SurfaceID sid, WindowID wid, bool printing) noexcept {
|
||||
@ -677,7 +677,7 @@ void SurfaceGDI::Init(SurfaceID sid, WindowID wid, bool printing) noexcept {
|
||||
hdc = static_cast<HDC>(sid);
|
||||
::SetTextAlign(hdc, TA_BASELINE);
|
||||
//const bool printing = (::GetDeviceCaps(hdc, TECHNOLOGY) != DT_RASDISPLAY);
|
||||
logPixelsY = printing ? ::GetDeviceCaps(hdc, LOGPIXELSY) : DpiForWindow(wid);
|
||||
logPixelsY = printing ? ::GetDeviceCaps(hdc, LOGPIXELSY) : DpiYForWindow(wid);
|
||||
}
|
||||
|
||||
void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID wid) noexcept {
|
||||
@ -692,7 +692,7 @@ void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID w
|
||||
::SetTextAlign(hdc, TA_BASELINE);
|
||||
SetUnicodeMode(psurfOther->unicodeMode);
|
||||
//~SetDBCSMode(psurfOther->codePage);
|
||||
logPixelsY = DpiForWindow(wid);
|
||||
logPixelsY = DpiYForWindow(wid);
|
||||
}
|
||||
|
||||
void SurfaceGDI::PenColour(ColourDesired fore) noexcept {
|
||||
@ -1343,19 +1343,19 @@ HRESULT SurfaceD2D::FlushDrawing() const noexcept {
|
||||
|
||||
void SurfaceD2D::Init(WindowID wid) noexcept {
|
||||
Release();
|
||||
logPixelsY = DpiForWindow(wid);
|
||||
logPixelsY = DpiYForWindow(wid);
|
||||
}
|
||||
|
||||
void SurfaceD2D::Init(SurfaceID sid, WindowID wid, bool /*printing*/) noexcept {
|
||||
Release();
|
||||
// printing always using GDI
|
||||
logPixelsY = DpiForWindow(wid);
|
||||
logPixelsY = DpiYForWindow(wid);
|
||||
pRenderTarget = static_cast<ID2D1RenderTarget *>(sid);
|
||||
}
|
||||
|
||||
void SurfaceD2D::InitPixMap(int width, int height, Surface *surface_, WindowID wid) noexcept {
|
||||
Release();
|
||||
logPixelsY = DpiForWindow(wid);
|
||||
logPixelsY = DpiYForWindow(wid);
|
||||
SurfaceD2D *psurfOther = down_cast<SurfaceD2D *>(surface_);
|
||||
// Should only ever be called with a SurfaceD2D, not a SurfaceGDI
|
||||
PLATFORM_ASSERT(psurfOther);
|
||||
|
||||
@ -132,10 +132,8 @@ inline void ReleaseUnknown(T *&ppUnknown) noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
inline UINT DpiForWindow(WindowID wid) noexcept {
|
||||
//~return GetWindowDPI(HwndFromWindowID(wid)).y;
|
||||
// retrieving the logPixelsY per window may double the Font Size calculation
|
||||
return USER_DEFAULT_SCREEN_DPI; // DPI_AWARENESS set by manifest
|
||||
inline UINT DpiYForWindow(WindowID wid) noexcept {
|
||||
return GetWindowDPI(HwndFromWindowID(wid)).y;
|
||||
}
|
||||
|
||||
HCURSOR LoadReverseArrowCursor(DPI_T dpi) noexcept;
|
||||
|
||||
114
src/Dialogs.c
114
src/Dialogs.c
@ -259,7 +259,7 @@ static INT_PTR CALLBACK _InfoBoxLngDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -460,7 +460,7 @@ static INT_PTR CALLBACK CmdLineHelpProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_COMMAND:
|
||||
@ -712,11 +712,16 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
return !0;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
{
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
|
||||
DPI_T dpi;
|
||||
dpi.x = LOWORD(wParam);
|
||||
dpi.y = HIWORD(wParam);
|
||||
|
||||
DPI_T const dpi = Scintilla_GetCurrentDPI(hwnd);
|
||||
SendDlgItemMessage(hwnd, IDC_RICHEDITABOUT, EM_SETZOOM, (WPARAM)dpi.y, (LPARAM)USER_DEFAULT_SCREEN_DPI);
|
||||
|
||||
//~~// get current richedit box format
|
||||
@ -896,9 +901,9 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
EndDialog(hwnd, IDOK);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
return !0;
|
||||
}
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -926,7 +931,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -1108,7 +1113,7 @@ static INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -1306,7 +1311,7 @@ static INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -1471,7 +1476,7 @@ static INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
break;
|
||||
|
||||
|
||||
@ -1718,7 +1723,7 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2073,7 +2078,7 @@ static INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_COMMAND:
|
||||
@ -2154,7 +2159,7 @@ static INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, L
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2257,7 +2262,7 @@ static INT_PTR CALLBACK WordWrapSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2360,7 +2365,7 @@ static INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2479,7 +2484,7 @@ static INT_PTR CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2612,7 +2617,7 @@ static INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wP
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2759,7 +2764,7 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -2954,7 +2959,7 @@ static INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wP
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -4297,6 +4302,33 @@ int Toolbar_SetButtons(HANDLE hwnd, int cmdBase, LPCWSTR lpszButtons, LPCTBBUTTO
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// GetCurrentPPI()
|
||||
// (font size) points per inch
|
||||
//
|
||||
DPI_T GetCurrentPPI(HWND hwnd) {
|
||||
HDC const hDC = GetDC(hwnd);
|
||||
DPI_T ppi;
|
||||
ppi.x = max_u(GetDeviceCaps(hDC, LOGPIXELSX), USER_DEFAULT_SCREEN_DPI);
|
||||
ppi.y = max_u(GetDeviceCaps(hDC, LOGPIXELSY), USER_DEFAULT_SCREEN_DPI);
|
||||
ReleaseDC(hwnd, hDC);
|
||||
return ppi;
|
||||
}
|
||||
|
||||
/*
|
||||
if (!bSucceed) {
|
||||
NONCLIENTMETRICS ncm;
|
||||
ncm.cbSize = sizeof(NONCLIENTMETRICS);
|
||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),&ncm,0);
|
||||
if (ncm.lfMessageFont.lfHeight < 0)
|
||||
ncm.lfMessageFont.lfHeight = -ncm.lfMessageFont.lfHeight;
|
||||
*wSize = (WORD)MulDiv(ncm.lfMessageFont.lfHeight,72,iLogPixelsY);
|
||||
if (*wSize == 0)
|
||||
*wSize = 8;
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Themed Dialogs
|
||||
@ -4496,42 +4528,20 @@ void SetUACIcon(const HMENU hMenu, const UINT nItem)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// GetCurrentPPI()
|
||||
// (font size) points per inch
|
||||
//
|
||||
DPI_T GetCurrentPPI(HWND hwnd) {
|
||||
HDC const hDC = GetDC(hwnd);
|
||||
DPI_T ppi;
|
||||
ppi.x = max_u(GetDeviceCaps(hDC, LOGPIXELSX), USER_DEFAULT_SCREEN_DPI);
|
||||
ppi.y = max_u(GetDeviceCaps(hDC, LOGPIXELSY), USER_DEFAULT_SCREEN_DPI);
|
||||
ReleaseDC(hwnd, hDC);
|
||||
return ppi;
|
||||
}
|
||||
|
||||
/*
|
||||
if (!bSucceed) {
|
||||
NONCLIENTMETRICS ncm;
|
||||
ncm.cbSize = sizeof(NONCLIENTMETRICS);
|
||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),&ncm,0);
|
||||
if (ncm.lfMessageFont.lfHeight < 0)
|
||||
ncm.lfMessageFont.lfHeight = -ncm.lfMessageFont.lfHeight;
|
||||
*wSize = (WORD)MulDiv(ncm.lfMessageFont.lfHeight,72,iLogPixelsY);
|
||||
if (*wSize == 0)
|
||||
*wSize = 8;
|
||||
}*/
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// UpdateWindowLayoutForDPI()
|
||||
//
|
||||
void UpdateWindowLayoutForDPI(HWND hWnd)
|
||||
void UpdateWindowLayoutForDPI(HWND hWnd, RECT* pRC, DPI_T* pDPI)
|
||||
{
|
||||
DPI_T const wndDPI = Scintilla_GetCurrentDPI(hWnd);
|
||||
UINT const uWndFlags = SWP_NOZORDER | SWP_NOACTIVATE; //~ | SWP_NOMOVE | SWP_NOSIZE | SWP_NOREPOSITION | SWP_FRAMECHANGED
|
||||
if (pRC) {
|
||||
SetWindowPos(hWnd, NULL, pRC->left, pRC->top, (pRC->right - pRC->left), (pRC->bottom - pRC->top), uWndFlags);
|
||||
//~InvalidateRect(hWnd, NULL, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
DPI_T const wndDPI = pDPI ? *pDPI : Scintilla_GetCurrentDPI(hWnd);
|
||||
|
||||
RECT rc;
|
||||
GetWindowRect(hWnd, &rc);
|
||||
@ -4543,9 +4553,7 @@ void UpdateWindowLayoutForDPI(HWND hWnd)
|
||||
int dpiScaledWidth = MulDiv(width, wndDPI.x, USER_DEFAULT_SCREEN_DPI);
|
||||
int dpiScaledHeight = MulDiv(height, wndDPI.y, USER_DEFAULT_SCREEN_DPI);
|
||||
|
||||
SetWindowPos(hWnd, NULL, dpiScaledX, dpiScaledY, dpiScaledWidth, dpiScaledHeight,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOREPOSITION | SWP_FRAMECHANGED);
|
||||
|
||||
SetWindowPos(hWnd, NULL, dpiScaledX, dpiScaledY, dpiScaledWidth, dpiScaledHeight, uWndFlags);
|
||||
//~InvalidateRect(hWnd, NULL, TRUE);
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +140,9 @@ inline int ScaleFractionalFontSize(HWND hwnd, float fSize) {
|
||||
|
||||
HBITMAP ConvertIconToBitmap(const HICON hIcon, const int cx, const int cy);
|
||||
void SetUACIcon(const HMENU hMenu, const UINT nItem);
|
||||
void UpdateWindowLayoutForDPI(HWND hWnd);
|
||||
void UpdateWindowLayoutForDPI(HWND hWnd, RECT* pRC, DPI_T* pDPI);
|
||||
//#define HandleDpiChangedMessage(hW, wP,lP) { DPI_T dpi; dpi.x = LOWORD(wP); dpi.y = HIWORD(wP); \
|
||||
// UpdateWindowLayoutForDPI(hW, (RECT*)lP, pRC, DPI_T* pDPI); }
|
||||
HBITMAP ResizeImageForCurrentDPI(HWND hwnd, HBITMAP hbmp);
|
||||
LRESULT SendWMSize(HWND hwnd, RECT* rc);
|
||||
|
||||
|
||||
16
src/Edit.c
16
src/Edit.c
@ -5850,7 +5850,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd,UINT umsg,WPARAM wParam
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return !0; // further processing
|
||||
|
||||
|
||||
@ -6614,7 +6614,7 @@ HWND EditFindReplaceDlg(HWND hwnd,LPCEDITFINDREPLACE lpefr,bool bReplace)
|
||||
(LPARAM) lpefr);
|
||||
|
||||
if (hDlg != INVALID_HANDLE_VALUE) {
|
||||
UpdateWindowLayoutForDPI(hDlg);
|
||||
UpdateWindowLayoutForDPI(hDlg, NULL, NULL);
|
||||
ShowWindow(hDlg, SW_SHOW);
|
||||
}
|
||||
CoUninitialize();
|
||||
@ -7912,7 +7912,7 @@ static INT_PTR CALLBACK EditLinenumDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPA
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
|
||||
@ -8057,7 +8057,7 @@ static INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_DESTROY:
|
||||
@ -8235,7 +8235,7 @@ static INT_PTR CALLBACK EditAlignDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_COMMAND:
|
||||
@ -8319,7 +8319,7 @@ static INT_PTR CALLBACK EditEncloseSelectionDlgProc(HWND hwnd,UINT umsg,WPARAM w
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_COMMAND:
|
||||
@ -8406,7 +8406,7 @@ static INT_PTR CALLBACK EditInsertTagDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,L
|
||||
return false;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_COMMAND:
|
||||
@ -8596,7 +8596,7 @@ static INT_PTR CALLBACK EditSortDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
return true;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return true;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
@ -1275,7 +1275,7 @@ HWND InitInstance(HINSTANCE hInstance,LPCWSTR pszCmdLine,int nCmdShow)
|
||||
if ((Settings.AlwaysOnTop || s_flagAlwaysOnTop == 2) && s_flagAlwaysOnTop != 1) {
|
||||
SetWindowPos(Globals.hwndMain, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
//~UpdateWindowLayoutForDPI(Globals.hwndMain);
|
||||
//~UpdateWindowLayoutForDPI(Globals.hwndMain, NULL, NULL);
|
||||
|
||||
SET_NP3_DLG_ICON_SMALL(Globals.hwndMain);
|
||||
SET_NP3_DLG_ICON_BIG(Globals.hwndMain);
|
||||
@ -2560,18 +2560,15 @@ LRESULT MsgEndSession(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
//
|
||||
LRESULT MsgDPIChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNUSED(lParam);
|
||||
|
||||
DPI_T dpi;
|
||||
dpi.x = LOWORD(wParam);
|
||||
dpi.y = HIWORD(wParam);
|
||||
|
||||
const RECT* const rc = (RECT*)lParam;
|
||||
//DPI_T dpi;
|
||||
//dpi.x = LOWORD(wParam);
|
||||
//dpi.y = HIWORD(wParam);
|
||||
UNUSED(wParam);
|
||||
//const RECT* const rc = (RECT*)lParam;
|
||||
|
||||
DocPos const pos = SciCall_GetCurrentPos();
|
||||
|
||||
//~UpdateWindowLayoutForDPI(hwnd);
|
||||
SetWindowPos(hwnd, NULL, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
|
||||
SendMessage(Globals.hwndEdit, WM_DPICHANGED, wParam, lParam);
|
||||
|
||||
@ -6623,6 +6620,8 @@ void HandleDWellStartEnd(const DocPos position, const UINT uid)
|
||||
//
|
||||
bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operation)
|
||||
{
|
||||
if (position < 0) { return false; }
|
||||
|
||||
//~PostMessage(Globals.hwndEdit, WM_LBUTTONUP, MK_LBUTTON, 0);
|
||||
CancelCallTip();
|
||||
|
||||
@ -6633,6 +6632,8 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio
|
||||
DocPos const lastPos = SciCall_IndicatorEnd(INDIC_NP3_HYPERLINK, position);
|
||||
DocPos const length = min_p(lastPos - firstPos, INTERNET_MAX_URL_LENGTH);
|
||||
|
||||
if (length < 4) { return false; }
|
||||
|
||||
const char* pszText = (const char*)SciCall_GetRangePointer(firstPos, length);
|
||||
|
||||
WCHAR szTextW[INTERNET_MAX_URL_LENGTH + 1];
|
||||
|
||||
@ -503,7 +503,7 @@ extern "C" UINT_PTR CALLBACK PageSetupHook(HWND hwnd, UINT uiMsg, WPARAM wParam,
|
||||
break;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
28
src/Styles.c
28
src/Styles.c
@ -3687,11 +3687,11 @@ void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle, bool bInitDefault
|
||||
}
|
||||
_SetCurrentFontSize(fBaseFontSize);
|
||||
}
|
||||
SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, iStyle, (LPARAM)ScaleFractionalFontSize(hwnd, fBaseFontSize));
|
||||
SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, iStyle, float2int(fBaseFontSize * SC_FONT_SIZE_MULTIPLIER));
|
||||
}
|
||||
else if (bInitDefault) {
|
||||
_SetBaseFontSize(fBaseFontSize);
|
||||
SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, STYLE_DEFAULT, (LPARAM)ScaleFractionalFontSize(hwnd, fBaseFontSize));
|
||||
SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, STYLE_DEFAULT, float2int(fBaseFontSize * SC_FONT_SIZE_MULTIPLIER));
|
||||
}
|
||||
|
||||
// Character Set
|
||||
@ -4146,8 +4146,10 @@ INT_PTR CALLBACK Style_CustomizeSchemesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam
|
||||
return false;
|
||||
|
||||
case WM_SIZE:
|
||||
return !0;
|
||||
|
||||
case WM_DPICHANGED:
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return !0;
|
||||
|
||||
#if 0
|
||||
@ -4671,7 +4673,7 @@ HWND Style_CustomizeSchemesDlg(HWND hwnd)
|
||||
Style_CustomizeSchemesDlgProc,
|
||||
(LPARAM)NULL);
|
||||
if (hDlg != INVALID_HANDLE_VALUE) {
|
||||
UpdateWindowLayoutForDPI(hDlg);
|
||||
UpdateWindowLayoutForDPI(hDlg, NULL, NULL);
|
||||
ShowWindow(hDlg, SW_SHOW);
|
||||
}
|
||||
return hDlg;
|
||||
@ -4754,35 +4756,29 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR
|
||||
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
ResizeDlg_Destroy(hwnd, &s_cxStyleSelectDlg, &s_cyStyleSelectDlg);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case WM_DPICHANGED:
|
||||
{
|
||||
UpdateWindowLayoutForDPI(hwnd);
|
||||
}
|
||||
UpdateWindowLayoutForDPI(hwnd, (RECT*)lParam, NULL);
|
||||
return !0;
|
||||
|
||||
|
||||
case WM_SIZE:
|
||||
{
|
||||
ResizeDlg_Size(hwnd, lParam, &cxClient, &cyClient);
|
||||
|
||||
HDWP hdwp;
|
||||
hdwp = BeginDeferWindowPos(6);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDOK, cxClient, cyClient, SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDCANCEL, cxClient, cyClient, SWP_NOSIZE);
|
||||
HDWP hdwp = BeginDeferWindowPos(6);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDC_RESIZEGRIP, cxClient, cyClient, SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDC_STYLELIST, 0, cyClient, SWP_NOMOVE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDC_DEFAULTSCHEME, cxClient, cyClient, SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDC_AUTOSELECT, cxClient, cyClient, SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDC_RESIZEGRIP, cxClient, cyClient, SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDOK, cxClient, cyClient, SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp, hwnd, IDCANCEL, cxClient, cyClient, SWP_NOSIZE);
|
||||
EndDeferWindowPos(hdwp);
|
||||
|
||||
ListView_SetColumnWidth(GetDlgItem(hwnd, IDC_STYLELIST), 0, LVSCW_AUTOSIZE_USEHEADER);
|
||||
}
|
||||
}
|
||||
return !0;
|
||||
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#define SAPPNAME "Notepad3"
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 20
|
||||
#define VERSION_REV 612
|
||||
#define VERSION_REV 613
|
||||
#define VERSION_BUILD 1
|
||||
#define SCINTILLA_VER 443
|
||||
#define ONIGURUMA_REGEX_VER 6.9.5
|
||||
|
||||
Loading…
Reference in New Issue
Block a user