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
This commit is contained in:
Václav Slavík
2002-12-08 13:23:03 +00:00
parent e77d4369de
commit 69a8b5b457

View File

@@ -2397,21 +2397,35 @@ 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;
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;
#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 && !wxUSE_COMCTL32_SAFELY && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )