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
This commit is contained in:
Kevin Ollivier
2007-08-18 06:23:02 +00:00
parent 18b32eb5b5
commit dcd79bff8c

View File

@@ -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)