]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/mixins/listctrl.py
Send the calendar and date changed events to the datepicker ctrl first
[wxWidgets.git] / wxPython / wx / lib / mixins / listctrl.py
index 06e9e392c2a606ad2ddd6c2761f7732c47bdf6d4..a28a164f793fd2a43b10db1e87ab25923c3fc981 100644 (file)
@@ -117,8 +117,18 @@ class ColumnSorterMixin:
         self._col = col = evt.GetColumn()
         self._colSortFlag[col] = int(not self._colSortFlag[col])
         self.GetListCtrl().SortItems(self.GetColumnSorter())
         self._col = col = evt.GetColumn()
         self._colSortFlag[col] = int(not self._colSortFlag[col])
         self.GetListCtrl().SortItems(self.GetColumnSorter())
-        self.__updateImages(oldCol)
+        if wx.Platform != "__WXMAC__" or wx.SystemOptions.GetOptionInt("mac.listctrl.always_use_generic") == 1:
+            self.__updateImages(oldCol)
         evt.Skip()
         evt.Skip()
+        self.OnSortOrderChanged()
+        
+        
+    def OnSortOrderChanged(self):
+        """
+        Callback called after sort order has changed (whenever user
+        clicked column header).
+        """
+        pass
 
 
     def __ColumnSorter(self, key1, key2):
 
 
     def __ColumnSorter(self, key1, key2):
@@ -248,6 +258,9 @@ class ListCtrlAutoWidthMixin:
         
         if not self:  # avoid a PyDeadObject error
             return
         
         if not self:  # avoid a PyDeadObject error
             return
+
+        if self.GetSize().height < 32:
+            return  # avoid an endless update bug when the height is small.
         
         numCols = self.GetColumnCount()
         if numCols == 0: return # Nothing to resize.
         
         numCols = self.GetColumnCount()
         if numCols == 0: return # Nothing to resize.
@@ -702,12 +715,17 @@ class CheckListCtrlMixin:
     """
     This is a mixin for ListCtrl which add a checkbox in the first
     column of each row. It is inspired by limodou's CheckList.py(which
     """
     This is a mixin for ListCtrl which add a checkbox in the first
     column of each row. It is inspired by limodou's CheckList.py(which
-    can be got from his NewEdit) and improved:    
+    can be got from his NewEdit) and improved:
+    
         - You can just use InsertStringItem() to insert new items;
         - You can just use InsertStringItem() to insert new items;
-        - Once a checkbox is checked/unchecked, the corresponding item is not
-          selected;
+
+        - Once a checkbox is checked/unchecked, the corresponding item
+          is not selected;
+
         - You can use SetItemData() and GetItemData();
         - You can use SetItemData() and GetItemData();
-        - Interfaces are changed to OnCheckItem(), IsChecked(), CheckItem().
+
+        - Interfaces are changed to OnCheckItem(), IsChecked(),
+          CheckItem().
 
     You should not set a imagelist for the ListCtrl once this mixin is used.
     """
 
     You should not set a imagelist for the ListCtrl once this mixin is used.
     """