]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Enable variadic macros for VC9 and later.
[wxWidgets.git] / src / msw / treectrl.cpp
index f67589c3f7cf53e1b0c6ad843fcb98dd44777d47..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;
 
@@ -3645,7 +3647,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
         case NM_RCLICK:
             {
                 TV_HITTESTINFO tvhti;
-                ::GetCursorPos(&tvhti.pt);
+                wxGetCursorPosMSW(&tvhti.pt);
                 ::ScreenToClient(GetHwnd(), &tvhti.pt);
                 if ( TreeView_HitTest(GetHwnd(), &tvhti) )
                 {