Add wxTreeCtrl::GetStateImageCount() and HasStateImages()

Add these functions for consistency with SetStateImages() and to avoid
using GetStateImageList() in the treectrl sample, which can now use
GetStateImageCount() instead.
This commit is contained in:
Vadim Zeitlin 2023-10-26 01:46:00 +02:00
parent a5449a94a1
commit f9a22962e0
3 changed files with 34 additions and 1 deletions

View file

@ -1288,7 +1288,7 @@ void MyTreeCtrl::DoToggleState(const wxTreeItemId& item)
srand (time(nullptr));
do {
nState = rand() % GetStateImageList()->GetImageCount();
nState = rand() % GetStateImageCount();
} while (nState == state);
SetItemState(item, nState);