Next part of tree state icon patches

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-06-24 12:48:01 +00:00
parent dea482c985
commit 4754ab1630
10 changed files with 899 additions and 9 deletions

View File

@@ -110,13 +110,19 @@ void wxTreeCtrlBase::SetItemState(const wxTreeItemId& item, int state)
{
if ( state == wxTREE_ITEMSTATE_NEXT )
{
state = GetItemState(item) + 1;
int current = GetItemState(item);
if ( current == wxTREE_ITEMSTATE_NONE )
return;
state = current + 1;
if ( m_imageListState && state >= m_imageListState->GetImageCount() )
state = 0;
}
else if ( state == wxTREE_ITEMSTATE_PREV )
{
state = GetItemState(item) - 1;
int current = GetItemState(item);
if ( current == wxTREE_ITEMSTATE_NONE )
return;
state = current - 1;
if ( state == -1 )
state = m_imageListState ? m_imageListState->GetImageCount() - 1 : 0;
}