]> git.saurik.com Git - wxWidgets.git/commitdiff
mysterious radiobox bug finally fixed
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 20 May 1999 22:53:09 +0000 (22:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 20 May 1999 22:53:09 +0000 (22:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dialog.cpp

index ec79f72f57f21f3197ea457afbc59a475532c5f6..d1979b9a4e3639b27b3df6a6ffd326176ba6df9b 100644 (file)
@@ -310,7 +310,13 @@ bool wxDialog::Show(bool show)
   {
     if (show)
     {
   {
     if (show)
     {
-      m_hwndOldFocus = (WXHWND)::GetFocus();
+      // find the top level window which had focus before - we will restore
+      // focus to it later
+      m_hwndOldFocus = 0;
+      for ( HWND hwnd = ::GetFocus(); hwnd; hwnd = ::GetParent(hwnd) )
+      {
+        m_hwndOldFocus = (WXHWND)hwnd;
+      }
 
       if (m_modalShowing)
       {
 
       if (m_modalShowing)
       {