From: Václav Slavík Date: Sun, 8 Dec 2002 13:23:03 +0000 (+0000) Subject: Fixed EVT_TREE_SEL_CHANGED and _CHANGING under MSLU (patch 631815) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/69a8b5b457f10297ec4039effa3b8248503e810b Fixed EVT_TREE_SEL_CHANGED and _CHANGING under MSLU (patch 631815) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 75813b5bfb..347ed299f5 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2397,20 +2397,34 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } break; - case TVN_SELCHANGED: + // NB: MSLU is broken and sends TVN_SELCHANGEDA instead of + // TVN_SELCHANGEDW in Unicode mode under Win98. Therefore + // we have to handle both messages: + case TVN_SELCHANGEDA: + case TVN_SELCHANGEDW: eventType = wxEVT_COMMAND_TREE_SEL_CHANGED; // fall through - case TVN_SELCHANGING: + case TVN_SELCHANGINGA: + case TVN_SELCHANGINGW: { if ( eventType == wxEVT_NULL ) eventType = wxEVT_COMMAND_TREE_SEL_CHANGING; //else: already set above - NM_TREEVIEW* tv = (NM_TREEVIEW *)lParam; - - event.m_item = (WXHTREEITEM) tv->itemNew.hItem; - event.m_itemOld = (WXHTREEITEM) tv->itemOld.hItem; + if (hdr->code == TVN_SELCHANGINGW || + hdr->code == TVN_SELCHANGEDW) + { + NM_TREEVIEWW* tv = (NM_TREEVIEWW *)lParam; + event.m_item = (WXHTREEITEM) tv->itemNew.hItem; + event.m_itemOld = (WXHTREEITEM) tv->itemOld.hItem; + } + else + { + NM_TREEVIEWA* tv = (NM_TREEVIEWA *)lParam; + event.m_item = (WXHTREEITEM) tv->itemNew.hItem; + event.m_itemOld = (WXHTREEITEM) tv->itemOld.hItem; + } } break;