Added SetColumnCount method

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-10-22 23:29:54 +00:00
parent 93b79b6b57
commit c85417f629

View File

@@ -40,15 +40,18 @@ class wxColumnSorterMixin:
""" """
def __init__(self, numColumns): def __init__(self, numColumns):
self._colSortFlag = [0] * numColumns self.SetColumnCount(numColumns)
self._col = -1
list = self.GetListCtrl() list = self.GetListCtrl()
if not list: if not list:
raise ValueError, "No wxListCtrl available" raise ValueError, "No wxListCtrl available"
EVT_LIST_COL_CLICK(list, list.GetId(), self.__OnColClick) EVT_LIST_COL_CLICK(list, list.GetId(), self.__OnColClick)
def SetColumnCount(self, newNumColumns):
self._colSortFlag = [0] * newNumColumns
self._col = -1
def SortListItems(self, col=-1, ascending=1): def SortListItems(self, col=-1, ascending=1):
"""Sort the list on demand. Can also be used to set the sort column and order.""" """Sort the list on demand. Can also be used to set the sort column and order."""
oldCol = self._col oldCol = self._col