From e5125b7488bc98fc1b50e9674b26737f05d1a9ef Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 12 Jun 2003 18:53:42 +0000 Subject: [PATCH] Patch #753465 a fix for Bug#750363. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/gizmos/splittree.cpp | 2 +- src/msw/treectrl.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/contrib/src/gizmos/splittree.cpp b/contrib/src/gizmos/splittree.cpp index 71cf0e6268..971a140080 100644 --- a/contrib/src/gizmos/splittree.cpp +++ b/contrib/src/gizmos/splittree.cpp @@ -314,7 +314,7 @@ void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars() if (scrolledWindow) { wxRect itemRect; - if (GetBoundingRect(GetRootItem(), itemRect)) + if (GetBoundingRect(GetFirstVisibleItem(), itemRect)) { // Actually, the real height seems to be 1 less than reported // (e.g. 16 instead of 16) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 0dd87375b8..f0b8b6fc06 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1914,6 +1914,13 @@ bool wxTreeCtrl::GetBoundingRect(const wxTreeItemId& item, bool textOnly) const { RECT rc; + + // Virtual root items have no bounding rectangle + if ( IS_VIRTUAL_ROOT(item) ) + { + return FALSE; + } + if ( TreeView_GetItemRect(GetHwnd(), HITEM(item), &rc, textOnly) ) { @@ -2413,7 +2420,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } break; - // NB: MSLU is broken and sends TVN_SELCHANGEDA instead of + // 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: @@ -2428,7 +2435,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) eventType = wxEVT_COMMAND_TREE_SEL_CHANGING; //else: already set above - if (hdr->code == TVN_SELCHANGINGW || + if (hdr->code == TVN_SELCHANGINGW || hdr->code == TVN_SELCHANGEDW) { NM_TREEVIEWW* tv = (NM_TREEVIEWW *)lParam; @@ -2631,7 +2638,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) HWND hText = TreeView_GetEditControl(GetHwnd()); if(hText != NULL) { - // MBN: if m_textCtrl already has an HWND, it is a stale + // MBN: if m_textCtrl already has an HWND, it is a stale // pointer from a previous edit (because the user // didn't modify the label before dismissing the control, // and TVN_ENDLABELEDIT was not sent), so delete it