Create a wxDisplay directly from wxWindow

This commit is contained in:
Maarten Bent
2021-02-13 21:11:18 +01:00
parent dbcfe56ae5
commit e3491fc537
2 changed files with 2 additions and 5 deletions

View File

@@ -2285,9 +2285,6 @@ void wxComboCtrlBase::ShowPopup()
SetFocus();
int displayIdx = wxDisplay::GetFromWindow(this);
wxRect displayRect = wxDisplay(displayIdx != wxNOT_FOUND ? displayIdx : 0u).GetGeometry();
// Space above and below
int screenHeight;
wxPoint scrPos;
@@ -2296,6 +2293,7 @@ void wxComboCtrlBase::ShowPopup()
int maxHeightPopup;
wxSize ctrlSz = GetSize();
wxRect displayRect = wxDisplay(this).GetGeometry();
screenHeight = displayRect.GetHeight();
scrPos = GetScreenPosition();

View File

@@ -1716,8 +1716,7 @@ wxPoint wxPropertyGrid::GetGoodEditorDialogPosition( wxPGProperty* p,
ImprovedClientToScreen( &x, &y );
int displayIdx = wxDisplay::GetFromWindow(this);
wxRect displayRect = wxDisplay(displayIdx != wxNOT_FOUND ? displayIdx : 0u).GetGeometry();
wxRect displayRect = wxDisplay(this).GetGeometry();
x -= displayRect.GetX();
y -= displayRect.GetY();