Use the new wxDisplay(wxWindow*) ctor to simplify the code

Make the code simpler and, in a couple of places where the fall back to
the primary display in case wxDisplay::GetFromWindow() returned -1 was
missing, also more correct.
This commit is contained in:
Vadim Zeitlin
2018-11-01 00:06:34 +01:00
parent f57cb6c1d9
commit 4ad9cde380
7 changed files with 10 additions and 30 deletions

View File

@@ -162,10 +162,7 @@ wxMessageDialog::HookFunction(int code, WXWPARAM wParam, WXLPARAM lParam)
void wxMessageDialog::ReplaceStaticWithEdit()
{
// check if the message box fits the display
int nDisplay = wxDisplay::GetFromWindow(this);
if ( nDisplay == wxNOT_FOUND )
nDisplay = 0;
const wxRect rectDisplay = wxDisplay(nDisplay).GetClientArea();
const wxRect rectDisplay = wxDisplay(this).GetClientArea();
if ( rectDisplay.Contains(GetRect()) )
{