Add wxCheckListBox::GetCheckedItems() helper.
This method is similar to wxListBox::GetSelections() and allows to retrieve all checked items at once. Closes #14969. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -99,4 +99,22 @@ wxCONSTRUCTOR_4( wxCheckListBox, wxWindow*, Parent, wxWindowID, Id, \
|
||||
wxPoint, Position, wxSize, Size )
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
unsigned int wxCheckListBoxBase::GetCheckedItems(wxArrayInt& checkedItems) const
|
||||
{
|
||||
unsigned int const numberOfItems = GetCount();
|
||||
|
||||
checkedItems.clear();
|
||||
for ( unsigned int i = 0; i < numberOfItems; ++i )
|
||||
{
|
||||
if ( IsChecked(i) )
|
||||
checkedItems.push_back(i);
|
||||
}
|
||||
|
||||
return checkedItems.size();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user