Implement GetCountPerPage, and fix a bug where we don't check for the state mask

before altering selection state. (Port to 2.8 branch)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2007-08-18 06:23:58 +00:00
parent eb5b9c7fe5
commit 814495f08b

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;
@@ -3120,7 +3124,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)