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:
@@ -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;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user