]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/mixins/listctrl.py
Source cleaning, wxW headers, whitespaces and improved PCH support.
[wxWidgets.git] / wxPython / wx / lib / mixins / listctrl.py
index c649396f72634c5daf8385634260f2ca79021e9e..06e9e392c2a606ad2ddd6c2761f7732c47bdf6d4 100644 (file)
@@ -115,7 +115,7 @@ class ColumnSorterMixin:
     def __OnColClick(self, evt):
         oldCol = self._col
         self._col = col = evt.GetColumn()
-        self._colSortFlag[col] = not self._colSortFlag[col]
+        self._colSortFlag[col] = int(not self._colSortFlag[col])
         self.GetListCtrl().SortItems(self.GetColumnSorter())
         self.__updateImages(oldCol)
         evt.Skip()
@@ -424,7 +424,6 @@ class TextEditMixin:
 
 
     def make_editor(self, col_style=wx.LIST_FORMAT_LEFT):
-        editor = wx.PreTextCtrl()
         
         style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB|wx.TE_RICH2
         style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT,
@@ -432,7 +431,7 @@ class TextEditMixin:
                   wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE
                   }[col_style]
         
-        editor.Create(self, -1, style=style)
+        editor = wx.TextCtrl(self, -1, style=style)
         editor.SetBackgroundColour(self.editorBgColour)
         editor.SetForegroundColour(self.editorFgColour)
         font = self.GetFont()
@@ -442,6 +441,8 @@ class TextEditMixin:
         self.curCol = 0
 
         editor.Hide()
+        if hasattr(self, 'editor'):
+            self.editor.Destroy()
         self.editor = editor
 
         self.col_style = col_style