X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4754ab1630290c29b97c37835d5e26155998e038..6063039441bcf82503d5623afd5bb87ae9ec8733:/src/msw/treectrl.cpp?ds=sidebyside diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 46a215d3ba..d358be2f32 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1213,6 +1213,12 @@ bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const { wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); + if ( IS_VIRTUAL_ROOT(item) ) + { + wxTreeItemIdValue cookie; + return GetFirstChild(item, cookie).IsOk(); + } + wxTreeViewItem tvItem(item, TVIF_CHILDREN); DoGetItem(&tvItem); @@ -2858,11 +2864,12 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) switch ( hdr->code ) { case NM_DBLCLK: - // we translate NM_DBLCLK into ACTIVATED event, so don't interpret - // the return code of this event handler as the return value for - // NM_DBLCLK - otherwise, double clicking the item to toggle its - // expanded status would never work - *result = false; + // we translate NM_DBLCLK into ACTIVATED event and if the user + // handled the activation of the item we shouldn't proceed with + // also using the same double click for toggling the item expanded + // state -- but OTOH do let the user to expand/collapse the item by + // double clicking on it if the activation is not handled specially + *result = processed; break; case NM_RCLICK: