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