Merge pull request #1631 from topic2k/ulc_get_checked_item_count

[ULC] add method GetCheckedItemCount
This commit is contained in:
Robin Dunn
2020-05-20 14:08:39 -07:00
committed by GitHub

View File

@@ -9430,6 +9430,19 @@ class UltimateListMainWindow(wx.ScrolledWindow):
# item count
# ----------------------------------------------------------------------------
def GetCheckedItemCount(self, col=0):
"""
Returns the number of checked items in the given column.
:param col: an integer specifying the column index.
:returns: the number of checked items.
:rtype: int
"""
GetLine = self.GetLine # local optimization
return len([line for line in range(self.GetItemCount()) if GetLine(line).IsChecked(col)])
def GetItemCount(self):
""" Returns the number of items in the :class:`UltimateListCtrl`. """
@@ -11182,6 +11195,18 @@ class UltimateListCtrl(wx.Control):
return self._mainWin.GetUserLineHeight()
def GetCheckedItemCount(self, col=0):
"""
Returns the number of checked items in the given column.
:param 'col': an integer specifying the column index.
:returns: the number of checked items.
:rtype: int
"""
return self._mainWin.GetCheckedItemCount(col)
def GetColumn(self, col):
"""
Returns information about this column.