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
This commit is contained in:
Robin Dunn
2003-06-12 18:53:42 +00:00
parent fbb447e2c4
commit e5125b7488
2 changed files with 11 additions and 4 deletions

View File

@@ -314,7 +314,7 @@ void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars()
if (scrolledWindow) if (scrolledWindow)
{ {
wxRect itemRect; wxRect itemRect;
if (GetBoundingRect(GetRootItem(), itemRect)) if (GetBoundingRect(GetFirstVisibleItem(), itemRect))
{ {
// Actually, the real height seems to be 1 less than reported // Actually, the real height seems to be 1 less than reported
// (e.g. 16 instead of 16) // (e.g. 16 instead of 16)

View File

@@ -1914,6 +1914,13 @@ bool wxTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
bool textOnly) const bool textOnly) const
{ {
RECT rc; RECT rc;
// Virtual root items have no bounding rectangle
if ( IS_VIRTUAL_ROOT(item) )
{
return FALSE;
}
if ( TreeView_GetItemRect(GetHwnd(), HITEM(item), if ( TreeView_GetItemRect(GetHwnd(), HITEM(item),
&rc, textOnly) ) &rc, textOnly) )
{ {
@@ -2413,7 +2420,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
} }
break; 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 // TVN_SELCHANGEDW in Unicode mode under Win98. Therefore
// we have to handle both messages: // we have to handle both messages:
case TVN_SELCHANGEDA: case TVN_SELCHANGEDA:
@@ -2428,7 +2435,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
eventType = wxEVT_COMMAND_TREE_SEL_CHANGING; eventType = wxEVT_COMMAND_TREE_SEL_CHANGING;
//else: already set above //else: already set above
if (hdr->code == TVN_SELCHANGINGW || if (hdr->code == TVN_SELCHANGINGW ||
hdr->code == TVN_SELCHANGEDW) hdr->code == TVN_SELCHANGEDW)
{ {
NM_TREEVIEWW* tv = (NM_TREEVIEWW *)lParam; NM_TREEVIEWW* tv = (NM_TREEVIEWW *)lParam;
@@ -2631,7 +2638,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
HWND hText = TreeView_GetEditControl(GetHwnd()); HWND hText = TreeView_GetEditControl(GetHwnd());
if(hText != NULL) 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 // pointer from a previous edit (because the user
// didn't modify the label before dismissing the control, // didn't modify the label before dismissing the control,
// and TVN_ENDLABELEDIT was not sent), so delete it // and TVN_ENDLABELEDIT was not sent), so delete it