From c10c791ba99839bd5fb5216cbf8dc8e8bd3f1fb3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Mar 2009 15:28:47 +0000 Subject: [PATCH] correct size of extra controls in pixels to dialogs units correctly (see #9679) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/filedlg.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index ae89ed5c05..c553328fb4 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -459,12 +459,11 @@ int wxFileDialog::ShowModal() lpdt->x = 0; lpdt->y = 0; - wxSize extra_size = GetExtraControlSize(); - // setting cx doesn't change the width of the dialog - lpdt->cx = extra_size.GetWidth(); - // Dividing by 2 gives expected height on WinXP and Wine. - // I don't know why (MW). - lpdt->cy = extra_size.GetHeight() / 2; + // convert the size of the extra controls to the dialog units + const wxSize extraSize = GetExtraControlSize(); + const LONG baseUnits = ::GetDialogBaseUnits(); + lpdt->cx = ::MulDiv(extraSize.x, 4, LOWORD(baseUnits)); + lpdt->cy = ::MulDiv(extraSize.y, 8, HIWORD(baseUnits)); // after the DLGTEMPLATE there are 3 additional WORDs for dialog menu, // class and title, all three set to zeros. -- 2.47.2