X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/09f277d6838930b81f99a60afe55d408d9b5bc54..f46ad98f0df1e1b073a484cb34a91e2e1278fdb7:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 69c09c7d54..4aa5c5ec8f 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -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 )