]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Update the text part of combobox when changing text of selected item in wxGTK.
[wxWidgets.git] / src / msw / treectrl.cpp
index c00ead4cf3304d5d58e7015bcb168952baaecee1..37d21463a4930ee671487d1e30541bba1b02243f 100644 (file)
@@ -439,14 +439,18 @@ public:
             switch ( which )
             {
                 case wxTreeItemIcon_SelectedExpanded:
-                    image = GetImage(wxTreeItemIcon_Expanded);
+                    // We consider that expanded icon is more important than
+                    // selected so test for it first.
+                    image = m_images[wxTreeItemIcon_Expanded];
+                    if ( image == -1 )
+                        image = m_images[wxTreeItemIcon_Selected];
                     if ( image != -1 )
                         break;
                     //else: fall through
 
                 case wxTreeItemIcon_Selected:
                 case wxTreeItemIcon_Expanded:
-                    image = GetImage(wxTreeItemIcon_Normal);
+                    image = m_images[wxTreeItemIcon_Normal];
                     break;
 
                 case wxTreeItemIcon_Normal:
@@ -787,6 +791,8 @@ bool wxTreeCtrl::Create(wxWindow *parent,
 
 wxTreeCtrl::~wxTreeCtrl()
 {
+    m_isBeingDeleted = true;
+
     // delete any attributes
     if ( m_hasAnyAttr )
     {
@@ -3464,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;
 
@@ -3641,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) )
                 {