commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r10148 - trunk/gnue-forms/src/uidrivers/wx/widgets


From: reinhard
Subject: [gnue] r10148 - trunk/gnue-forms/src/uidrivers/wx/widgets
Date: Thu, 28 Jan 2010 04:08:47 -0600 (CST)

Author: reinhard
Date: 2010-01-28 04:08:47 -0600 (Thu, 28 Jan 2010)
New Revision: 10148

Modified:
   trunk/gnue-forms/src/uidrivers/wx/widgets/form.py
Log:
Fix for focus not returning to the right control after a message box was shown
under Windows.


Modified: trunk/gnue-forms/src/uidrivers/wx/widgets/form.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx/widgets/form.py   2010-01-24 11:13:28 UTC 
(rev 10147)
+++ trunk/gnue-forms/src/uidrivers/wx/widgets/form.py   2010-01-28 10:08:47 UTC 
(rev 10148)
@@ -465,6 +465,8 @@
             the No-button was pressed or None if the Cancel-button was pressed.
         """
 
+        focus = wx.Window.FindFocus()
+
         mbRec  = _MBOX_KIND.get(kind.lower())
         flags  = mbRec['type'] | mbRec['buttons']
         if cancel:
@@ -477,6 +479,13 @@
         finally:
             dialog.Destroy()
 
+        # FIXME: Under Windows, the focus returns to the Frame instead of the
+        # actual widget after the MessageDialog has been closed. I wasn't able
+        # to reproduce this outside GNUe, and I have no idea why this happens.
+        # Anyway, we reset the focus to where it was before just to play safe.
+        if wx.Platform == '__WXMSW__':
+            focus.SetFocus()
+
         return _RESPONSE[result]
 
     # -------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]