X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9543d01ca16af6171735db4fc78e2dc7f9d4065c..fae7120624035224841ccf6a563f72e1fc37f64a:/src/generic/vlbox.cpp diff --git a/src/generic/vlbox.cpp b/src/generic/vlbox.cpp index f94031bca5..df4a9bbfb0 100644 --- a/src/generic/vlbox.cpp +++ b/src/generic/vlbox.cpp @@ -325,6 +325,31 @@ void wxVListBox::RefreshSelected() } } +wxRect wxVListBox::GetItemRect(size_t n) const +{ + wxRect itemrect; + + // check that this item is visible + const size_t lineMax = GetVisibleEnd(); + if ( n >= lineMax ) + return itemrect; + size_t line = GetVisibleBegin(); + if ( n < line ) + return itemrect; + + while ( line <= n ) + { + itemrect.y += itemrect.height; + itemrect.height = OnGetRowHeight(line); + + line++; + } + + itemrect.width = GetClientSize().x; + + return itemrect; +} + // ---------------------------------------------------------------------------- // wxVListBox appearance parameters // ----------------------------------------------------------------------------