X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/52f13e4930add51417d27d2098a2baa76ada1a6c..c92d798f9d11d15acb4af65f7fc03187ea9eee7c:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 44c408406b..96818dd14d 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -315,10 +315,10 @@ bool wxTreeCtrl::Create(wxWindow *parent, if ( m_windowStyle & wxTR_LINES_AT_ROOT ) wstyle |= TVS_LINESATROOT; -#if !defined( __GNUWIN32__ ) && !defined( __BORLANDC__ ) && !defined(wxUSE_NORLANDER_HEADERS) +#if !defined( __GNUWIN32__ ) && !defined( __BORLANDC__ ) && !defined( __WATCOMC__ ) && !defined(wxUSE_NORLANDER_HEADERS) // we emulate the multiple selection tree controls by using checkboxes: set // up the image list we need for this if we do have multiple selections -#if !defined(__VISUALC__) || (__VISUALC__ != 1010) +#if !defined(__VISUALC__) || (__VISUALC__ > 1010) if ( m_windowStyle & wxTR_MULTIPLE ) wstyle |= TVS_CHECKBOXES; #endif @@ -723,6 +723,12 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const { // Bug in Gnu-Win32 headers, so don't use the macro TreeView_GetItemRect RECT rect; + + // this ugliness comes directly from MSDN - it *is* the correct way to pass + // the HTREEITEM with TVM_GETITEMRECT + *(WXHTREEITEM *)&rect = (WXHTREEITEM)item; + + // FALSE means get item rect for the whole item, not only text return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, (LPARAM)&rect) != 0; } @@ -1409,6 +1415,8 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) event.m_item = (WXHTREEITEM)info->item.hItem; event.m_label = info->item.pszText; + if (info->item.pszText == NULL) + return FALSE; break; }