X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/069eeb1772ac35b443200a71da46e04ece244619..9467bdb7f5bfde9f99331097daacb93564ca122e:/wxPython/wx/lib/mixins/listctrl.py diff --git a/wxPython/wx/lib/mixins/listctrl.py b/wxPython/wx/lib/mixins/listctrl.py index fbfc82a229..09972aa4ea 100644 --- a/wxPython/wx/lib/mixins/listctrl.py +++ b/wxPython/wx/lib/mixins/listctrl.py @@ -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 @@ -701,12 +702,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 - 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; - - 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(); - - 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. """