def InsertColumnMixin(self, col, heading,
format=wx.LIST_FORMAT_LEFT, width=-1):
'''Replaces ListCtrl InsertColumn to keep the ascending/descending sort flags
sync'ed with column insertion
The reason to do this: if put on the right hand side of the "base
classes" list a plain InsertColumn method would not be found and Mixins
are usually put on the right hand side
'''
index = self.InsertColumnOrig(col, heading, format, width)
if index != -1:
# Colum insert: Insert a sorting flag in the returned index
self.sortflags.insert(index, True)
if self.col >= index:
# Fix index of last sorted column because we added to the left
self.col += 1
return index
评论列表
文章目录