From 11f7c42c8debe7fd08ac52dca2d84ba03d0564a0 Mon Sep 17 00:00:00 2001 From: komoto Date: Sun, 11 Sep 2022 12:58:15 +0900 Subject: [PATCH 1/2] Fix OpenEditor offset to integer --- wx/lib/mixins/listctrl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wx/lib/mixins/listctrl.py b/wx/lib/mixins/listctrl.py index a74295ea..1a5a5a38 100644 --- a/wx/lib/mixins/listctrl.py +++ b/wx/lib/mixins/listctrl.py @@ -588,7 +588,7 @@ class TextEditMixin: # scroll a bit more than what is minimum required # so we don't have to scroll every time the user presses TAB # which is very tireing to the eye - addoffset = self.GetSize()[0]/4 + addoffset = self.GetSize()[0]//4 # but be careful at the end of the list if addoffset + scrolloffset < self.GetSize()[0]: offset += addoffset From ef8f887618f02f3eaf0b3563fd4a15f8ceb1dca9 Mon Sep 17 00:00:00 2001 From: komoto Date: Sun, 11 Sep 2022 13:07:58 +0900 Subject: [PATCH 2/2] Remove TE_RICH2 style to avoid selection disappearing on a second focus (of the same format item). --- wx/lib/mixins/listctrl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wx/lib/mixins/listctrl.py b/wx/lib/mixins/listctrl.py index 1a5a5a38..fe91d713 100644 --- a/wx/lib/mixins/listctrl.py +++ b/wx/lib/mixins/listctrl.py @@ -461,7 +461,7 @@ class TextEditMixin: def make_editor(self, col_style=wx.LIST_FORMAT_LEFT): - style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB|wx.TE_RICH2 + style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT, wx.LIST_FORMAT_RIGHT: wx.TE_RIGHT, wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE