X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6212a0cb7e6285f62198a9411d91bbe8dc06e60..f8a7e79913144094f2916cf20a44754841744ef9:/src/os2/dialog.cpp diff --git a/src/os2/dialog.cpp b/src/os2/dialog.cpp index 0f299aaff5..2e5ff9f96f 100644 --- a/src/os2/dialog.cpp +++ b/src/os2/dialog.cpp @@ -25,7 +25,7 @@ #include "wx/os2/private.h" #include "wx/evtloop.h" -#include "wx/ptr_scpd.h" +#include "wx/scopedptr.h" #define wxDIALOG_DEFAULT_X 300 #define wxDIALOG_DEFAULT_Y 300 @@ -166,28 +166,6 @@ bool wxDialog::IsModalShowing() const #endif // WXWIN_COMPATIBILITY_2_6 -wxWindow *wxDialog::FindSuitableParent() const -{ - // first try to use the currently active window - HWND hwndFg = ::WinQueryActiveWindow(HWND_DESKTOP); - wxWindow *parent = hwndFg ? wxFindWinFromHandle((WXHWND)hwndFg) - : NULL; - if ( !parent ) - { - // next try the main app window - parent = wxTheApp->GetTopWindow(); - } - - // finally, check if the parent we found is really suitable - if ( !parent || parent == (wxWindow *)this || !parent->IsShown() ) - { - // don't use this one - parent = NULL; - } - - return parent; -} - bool wxDialog::Show( bool bShow ) { if ( bShow == IsShown() ) @@ -258,11 +236,7 @@ int wxDialog::ShowModal() if ( !m_endModalCalled ) { // modal dialog needs a parent window, so try to find one - wxWindow *parent = GetParent(); - if ( !parent ) - { - parent = FindSuitableParent(); - } + wxWindow * const parent = GetParentForModalDialog(); // remember where the focus was wxWindow *oldFocus = m_pOldFocus;