X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ff632ce661365d18fba19cc17a1100fcca39bde..3af5821cf964398265547e23341e50cb6f55c081:/src/common/gbsizer.cpp diff --git a/src/common/gbsizer.cpp b/src/common/gbsizer.cpp index 83753c51e1..85653bc76d 100644 --- a/src/common/gbsizer.cpp +++ b/src/common/gbsizer.cpp @@ -406,6 +406,24 @@ wxGBSizerItem* wxGridBagSizer::FindItemAtPosition(const wxGBPosition& pos) +wxGBSizerItem* wxGridBagSizer::FindItemAtPoint(const wxPoint& pt) +{ + wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); + while (node) + { + wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); + wxRect rect(item->GetPosition(), item->GetSize()); + rect.Inflate(m_hgap, m_vgap); + if ( rect.Inside(pt) ) + return item; + node = node->GetNext(); + } + return NULL; +} + + + + wxGBSizerItem* wxGridBagSizer::FindItemWithData(const wxObject* userData) { wxSizerItemList::compatibility_iterator node = m_children.GetFirst();