From 313901f3e5b6c2b91ba7040e5fe2ac67b0ffa9cb Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 1 Jun 2003 21:01:18 +0000 Subject: [PATCH] Fix for bug [ 744199 ] wxBringWindowToTop, child window z-order A child window should only have it's z-order raised, not the parent window brought to the front. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/innotop.txt | 2 +- include/wx/msw/dialog.h | 2 ++ src/msw/dialog.cpp | 5 +++++ src/msw/window.cpp | 8 +++----- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/distrib/msw/innotop.txt b/distrib/msw/innotop.txt index 62a0965cc6..52c672da3d 100644 --- a/distrib/msw/innotop.txt +++ b/distrib/msw/innotop.txt @@ -30,7 +30,7 @@ AlwaysCreateUninstallIcon=1 UninstallIconName=Uninstall wxWindows 2.5.0 Uninstallable=1 - DefaultDirName=c:\wxWindows_2.5.0 + DefaultDirName=c:\wxWindows-2.5.0 DefaultGroupName=wxWindows 2.5.0 LicenseFile=C:\wx24\wxWindows\docs\licence.txt InfoBeforeFile=C:\wx24\wxWindows\docs\readme.txt diff --git a/include/wx/msw/dialog.h b/include/wx/msw/dialog.h index 297e5be530..c14daec8d2 100644 --- a/include/wx/msw/dialog.h +++ b/include/wx/msw/dialog.h @@ -78,6 +78,8 @@ public: // override some base class virtuals virtual bool Show(bool show = TRUE); + virtual void Raise(); + // event handlers void OnCharHook(wxKeyEvent& event); void OnCloseWindow(wxCloseEvent& event); diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index c18d222798..44b80d4354 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -339,6 +339,11 @@ bool wxDialog::Show(bool show) return TRUE; } +void wxDialog::Raise() +{ + ::SetForegroundWindow(GetHwnd()); +} + // a special version for Show(TRUE) for modal dialogs which returns return code int wxDialog::ShowModal() { diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 21240160c3..54c791ddad 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -217,15 +217,13 @@ static inline void wxBringWindowToTop(HWND hwnd) // activate (set focus to) specified window ::SetFocus(hwnd); +#endif // raise top level parent to top of z order - ::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); -#else // !__WXMICROWIN__ - if ( !::BringWindowToTop(hwnd) ) + if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)) { - wxLogLastError(_T("BringWindowToTop")); + wxLogLastError(_T("SetWindowPos")); } -#endif // __WXMICROWIN__/!__WXMICROWIN__ } // --------------------------------------------------------------------------- -- 2.47.2