From dcd79bff8c7c2bccd883dc014de19a1acd2d7dff Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Sat, 18 Aug 2007 06:23:02 +0000 Subject: [PATCH] Implement GetCountPerPage, and fix a bug where we don't check for the state mask before altering selection state. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/listctrl_mac.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 5a1a1f0bc8..8bc2439167 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1076,6 +1076,10 @@ int wxListCtrl::GetCountPerPage() const if (m_dbImpl) { + UInt16 height = 1; + m_dbImpl->GetDefaultRowHeight( &height ); + if (height > 0) + return GetClientSize().y / height; } return 1; @@ -3097,7 +3101,7 @@ void wxMacDataBrowserListCtrlControl::UpdateState(wxMacDataItem* dataItem, wxLis bool isSelectedState = (listItem->GetState() == wxLIST_STATE_SELECTED); // toggle the selection state if wxListInfo state and actual state don't match. - if ( isSelected != isSelectedState ) + if ( listItem->GetMask() & wxLIST_MASK_STATE && isSelected != isSelectedState ) { DataBrowserSetOption options = kDataBrowserItemsAdd; if (!isSelectedState) -- 2.45.2