Use DPI Aware wxGetSystemMetrics

If no wxWindow is known, use wxTheApp->GetTopWindow().
Also use a wxWindow for all wxSystemSettings::GetMetric calls.
This commit is contained in:
Maarten Bent
2018-07-22 14:16:51 +02:00
parent 04b99d54bd
commit f74d756ca5
37 changed files with 106 additions and 87 deletions

View File

@@ -193,8 +193,8 @@ void wxMessageDialog::ReplaceStaticWithEdit()
// some space above and below it
const int hText = (7*rectDisplay.height)/8 -
(
2*::GetSystemMetrics(SM_CYFIXEDFRAME) +
::GetSystemMetrics(SM_CYCAPTION) +
2*wxGetSystemMetrics(SM_CYFIXEDFRAME, this) +
wxGetSystemMetrics(SM_CYCAPTION, this) +
5*GetCharHeight() // buttons + margins
);
const int dh = (rc.bottom - rc.top) - hText; // vertical space we save
@@ -207,8 +207,8 @@ void wxMessageDialog::ReplaceStaticWithEdit()
// NB: you would have thought that 2*SM_CXEDGE would be enough but it
// isn't, somehow, and the text control breaks lines differently from
// the static one so fudge by adding some extra space
const int dw = ::GetSystemMetrics(SM_CXVSCROLL) +
4*::GetSystemMetrics(SM_CXEDGE);
const int dw = wxGetSystemMetrics(SM_CXVSCROLL, this) +
4*wxGetSystemMetrics(SM_CXEDGE, this);
rc.right += dw;