LCL-Win32: Don't move a calling form with OldStyleDialog dialogs. Issue #37821, patch from Jamie Philbrook.

git-svn-id: trunk@63929 -
This commit is contained in:
juha 2020-09-27 22:14:53 +00:00
parent eda286fd37
commit e2ee2d39ed

View File

@ -482,7 +482,7 @@ var
OpenFileName: Windows.POPENFILENAME; OpenFileName: Windows.POPENFILENAME;
DlgRec: POpenFileDialogRec; DlgRec: POpenFileDialogRec;
CanClose: Boolean; CanClose: Boolean;
{
procedure Reposition(ADialogWnd: Handle); procedure Reposition(ADialogWnd: Handle);
var var
Left, Top: Integer; Left, Top: Integer;
@ -490,7 +490,6 @@ var
begin begin
// Btw, setting width and height of dialog doesnot reposition child controls :( // Btw, setting width and height of dialog doesnot reposition child controls :(
// So no way to set another height and width at least here // So no way to set another height and width at least here
if (GetParent(ADialogWnd) = Win32WidgetSet.AppHandle) then if (GetParent(ADialogWnd) = Win32WidgetSet.AppHandle) then
begin begin
if Screen.ActiveCustomForm <> nil then if Screen.ActiveCustomForm <> nil then
@ -508,7 +507,7 @@ var
Top := (ABounds.Bottom - DialogRect.Bottom + DialogRect.Top) div 2; Top := (ABounds.Bottom - DialogRect.Bottom + DialogRect.Top) div 2;
SetWindowPos(ADialogWnd, HWND_TOP, Left, Top, 0, 0, SWP_NOSIZE); SetWindowPos(ADialogWnd, HWND_TOP, Left, Top, 0, 0, SWP_NOSIZE);
end; end;
}
procedure ExtractDataFromNotify; procedure ExtractDataFromNotify;
begin begin
OpenFileName := OpenFileNotify^.lpOFN; OpenFileName := OpenFileNotify^.lpOFN;
@ -523,7 +522,7 @@ begin
begin begin
// Windows asks us to initialize dialog. At this moment controls are not // Windows asks us to initialize dialog. At this moment controls are not
// arranged and this is that moment when we should set bounds of our dialog // arranged and this is that moment when we should set bounds of our dialog
Reposition(GetParent(Wnd)); //Reposition(GetParent(Wnd)); this causes active form to move out of position with old dialogs JP
end end
else else
if uMsg = WM_NOTIFY then if uMsg = WM_NOTIFY then