]> git.saurik.com Git - wxWidgets.git/commitdiff
The tree only sets the focus in response to a TVN_SELCHANGINGW event if the tree...
authorJulian Smart <julian@anthemion.co.uk>
Tue, 21 Feb 2012 09:24:52 +0000 (09:24 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 21 Feb 2012 09:24:52 +0000 (09:24 +0000)
TVN_SELCHANGINGW is generated when the tree items are deleted. Without this change, if a tree control is
in a dialog being closed, the newly active window will become inactive momentarily when tree items
are deleted and you will see a flicker.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index 6cd893542d9a999e0b9a4815a971ab416293af2f..37d21463a4930ee671487d1e30541bba1b02243f 100644 (file)
@@ -791,6 +791,8 @@ bool wxTreeCtrl::Create(wxWindow *parent,
 
 wxTreeCtrl::~wxTreeCtrl()
 {
+    m_isBeingDeleted = true;
+
     // delete any attributes
     if ( m_hasAnyAttr )
     {
@@ -3468,7 +3470,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             //
             // to avoid such surprises, we force the generation of focus events
             // now, before we generate the selection change ones
-            if ( !m_changingSelection )
+            if ( !m_changingSelection && !m_isBeingDeleted )
                 SetFocus();
             break;