]> git.saurik.com Git - wxWidgets.git/commitdiff
Do not run focus detection when handling events from editor control (mostly because...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 10 Jul 2010 15:40:33 +0000 (15:40 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 10 Jul 2010 15:40:33 +0000 (15:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/propgrid.cpp

index 5b65f982c678407674b040761762553179075a45..e61b261d983d8abe1af56e4760aac6e275e87538 100644 (file)
@@ -5844,6 +5844,13 @@ bool wxPropertyGrid::IsEditorFocused() const
 // Called by focus event handlers. newFocused is the window that becomes focused.
 void wxPropertyGrid::HandleFocusChange( wxWindow* newFocused )
 {
 // Called by focus event handlers. newFocused is the window that becomes focused.
 void wxPropertyGrid::HandleFocusChange( wxWindow* newFocused )
 {
+    //
+    // Never allow focus to be changed when handling editor event.
+    // Especially because they may be displaing a dialog which
+    // could cause all kinds of weird (native) focus changes.
+    if ( HasInternalFlag(wxPG_FL_IN_HANDLECUSTOMEDITOREVENT) )
+        return;
+
     unsigned int oldFlags = m_iFlags;
     bool wasEditorFocused = false;
     wxWindow* wndEditor = m_wndEditor;
     unsigned int oldFlags = m_iFlags;
     bool wasEditorFocused = false;
     wxWindow* wndEditor = m_wndEditor;