]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Added intermediate state (m_showOnIdle) indicating that
[wxWidgets.git] / src / msw / treectrl.cpp
index 69c09c7d545947c46710d1b0c637b3b29488b901..4aa5c5ec8f3894b7441539d745c013103d8d4e59 100644 (file)
@@ -293,7 +293,7 @@ class wxTreeItemParam
 {
 public:
     wxTreeItemParam()
-        : m_item(NULL),
+        : m_item((long int)0),
           m_data(NULL)
     {
         for ( size_t n = 0; n < WXSIZEOF(m_images); n++ )
@@ -1013,6 +1013,8 @@ void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image,
         return;
 
     data->SetImage(image, which);
+
+    RefreshItem(item);
 }
 
 wxTreeItemParam *wxTreeCtrl::GetItemParam(const wxTreeItemId& item) const
@@ -1983,6 +1985,20 @@ void wxTreeCtrl::SortChildren(const wxTreeItemId& item)
 // implementation
 // ----------------------------------------------------------------------------
 
+bool wxTreeCtrl::MSWShouldPreProcessMessage(WXMSG* msg)
+{
+    if ( msg->message == WM_KEYDOWN )
+    {
+        if ( msg->wParam == VK_RETURN )
+        {
+            // we need VK_RETURN to generate wxEVT_COMMAND_TREE_ITEM_ACTIVATED
+            return false;
+        }
+    }
+
+    return wxTreeCtrlBase::MSWShouldPreProcessMessage(msg);
+}
+
 bool wxTreeCtrl::MSWCommand(WXUINT cmd, WXWORD id)
 {
     if ( cmd == EN_UPDATE )