X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9eddec696f06d65a80e7339b2fae14fcb55f8383..24aab8e81a8627802e4111d9c99a50ece8d0026e:/src/generic/listbkg.cpp?ds=sidebyside diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index d3b9771817..67059a7197 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -161,6 +161,45 @@ void wxListbook::OnSize(wxSizeEvent& event) wxBookCtrlBase::OnSize(event); } +int wxListbook::HitTest(const wxPoint& pt, long *flags) const +{ + int pagePos = wxNOT_FOUND; + + if ( flags ) + *flags = wxBK_HITTEST_NOWHERE; + + // convert from listbook control coordinates to list control coordinates + const wxListView * const list = GetListView(); + const wxPoint listPt = list->ScreenToClient(ClientToScreen(pt)); + + // is the point inside list control? + if ( wxRect(list->GetSize()).Inside(listPt) ) + { + int flagsList; + pagePos = list->HitTest(listPt, flagsList); + + if ( flags ) + { + if ( pagePos != wxNOT_FOUND ) + *flags = 0; + + if ( flagsList & (wxLIST_HITTEST_ONITEMICON | + wxLIST_HITTEST_ONITEMSTATEICON ) ) + *flags |= wxBK_HITTEST_ONICON; + + if ( flagsList & wxLIST_HITTEST_ONITEMLABEL ) + *flags |= wxBK_HITTEST_ONLABEL; + } + } + else // not over list control at all + { + if ( flags && GetPageRect().Inside(pt) ) + *flags |= wxBK_HITTEST_ONPAGE; + } + + return pagePos; +} + wxSize wxListbook::CalcSizeFromPage(const wxSize& sizePage) const { // we need to add the size of the list control and the border between