Fix GetNextItem for virtual wxListCtrl, and improve behavior for wxLIST_NEXT_ALL.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1567,16 +1567,19 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
|
|||||||
long count = m_dbImpl->MacGetCount() ;
|
long count = m_dbImpl->MacGetCount() ;
|
||||||
for ( long line = item + 1 ; line < count; line++ )
|
for ( long line = item + 1 ; line < count; line++ )
|
||||||
{
|
{
|
||||||
wxMacDataItem* id = m_dbImpl->GetItemFromLine(line);
|
DataBrowserItemID id = line + 1;
|
||||||
|
if ( !IsVirtual() )
|
||||||
|
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
|
||||||
|
|
||||||
if ( (state == wxLIST_STATE_DONTCARE ) )
|
if ( (state == wxLIST_STATE_DONTCARE ) )
|
||||||
return line;
|
return line;
|
||||||
|
|
||||||
if ( (state & wxLIST_STATE_SELECTED) && m_dbImpl->IsItemSelected( id ) )
|
if ( (state & wxLIST_STATE_SELECTED) && IsDataBrowserItemSelected(m_dbImpl->GetControlRef(), id ) )
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( geom == wxLIST_NEXT_ABOVE )
|
|
||||||
|
if ( geom == wxLIST_NEXT_ALL || geom == wxLIST_NEXT_ABOVE )
|
||||||
{
|
{
|
||||||
int item2 = item;
|
int item2 = item;
|
||||||
if ( item2 == -1 )
|
if ( item2 == -1 )
|
||||||
@@ -1584,12 +1587,14 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
|
|||||||
|
|
||||||
for ( long line = item2 - 1 ; line >= 0; line-- )
|
for ( long line = item2 - 1 ; line >= 0; line-- )
|
||||||
{
|
{
|
||||||
wxMacDataItem* id = m_dbImpl->GetItemFromLine(line);
|
DataBrowserItemID id = line + 1;
|
||||||
|
if ( !IsVirtual() )
|
||||||
|
id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
|
||||||
|
|
||||||
if ( (state == wxLIST_STATE_DONTCARE ) )
|
if ( (state == wxLIST_STATE_DONTCARE ) )
|
||||||
return line;
|
return line;
|
||||||
|
|
||||||
if ( (state & wxLIST_STATE_SELECTED) && m_dbImpl->IsItemSelected( id ) )
|
if ( (state & wxLIST_STATE_SELECTED) && IsDataBrowserItemSelected(m_dbImpl->GetControlRef(), id ) )
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user