Fix Document Map regression under Windows 7

Fix #8335, close #8336
This commit is contained in:
Udo Hoffmann 2020-05-28 18:57:10 +02:00 committed by Don HO
parent b73721f0b4
commit f821f73110
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 16 additions and 4 deletions

View File

@ -302,7 +302,8 @@ void DocumentMap::doMove()
{
RECT rc;
::GetClientRect (_hwndScintilla, & rc);
::MapWindowPoints (_hwndScintilla, _pMapView->getHParent(), reinterpret_cast<POINT*>(& rc), 2);
bool isChild = (::GetWindowLongPtr (_vzDlg.getHSelf(), GWL_STYLE) & WS_CHILD) != 0;
::MapWindowPoints (_hwndScintilla, isChild ? _pMapView->getHParent() : HWND_DESKTOP, reinterpret_cast<POINT*>(& rc), 2);
::MoveWindow(_vzDlg.getHSelf(), rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), TRUE);
}
@ -478,7 +479,10 @@ void ViewZoneDlg::drawPreviewZone(DRAWITEMSTRUCT *pdis)
void ViewZoneDlg::doDialog()
{
if (!isCreated())
create(IDD_VIEWZONE);
{
bool win10 = (NppParameters::getInstance()).getWinVersion() >= WV_WIN10;
create(win10 ? IDD_VIEWZONE : IDD_VIEWZONE_CLASSIC);
}
display();
};

View File

@ -41,5 +41,12 @@ IDD_VIEWZONE DIALOGEX 26, 41, 200, 200
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
CONTROL "",IDC_VIEWZONECANVAS,"Static",SS_OWNERDRAW,0,0,50,14
CONTROL "",IDC_VIEWZONECANVAS,"Static",SS_OWNERDRAW,0,0,50,14
END
IDD_VIEWZONE_CLASSIC DIALOGEX 0, 0, 0, 0
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
CONTROL "",IDC_VIEWZONECANVAS,"Static",SS_OWNERDRAW,0,0,50,14
END

View File

@ -28,5 +28,6 @@
#pragma once
#define IDD_DOCUMENTMAP 3300
#define IDD_VIEWZONE 3320
#define IDD_VIEWZONE_CLASSIC 3320
#define IDD_VIEWZONE 3321
#define IDC_VIEWZONECANVAS (IDD_VIEWZONE + 1)