wxPython4 sequels: usual naming problem in grid cell change events, non kw-args to menu.Append and event not being skipped. wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Fri, 06 May 2022 14:40:33 +0200
branchwxPython4
changeset 3449 6279ec06df98
parent 3448 523f6fcc7a28
child 3450 8be4b8f092cd
wxPython4 sequels: usual naming problem in grid cell change events, non kw-args to menu.Append and event not being skipped.
dialogs/DurationEditorDialog.py
editors/DataTypeEditor.py
editors/ResourceEditor.py
--- a/dialogs/DurationEditorDialog.py	Thu Apr 07 15:28:24 2022 +0200
+++ b/dialogs/DurationEditorDialog.py	Fri May 06 14:40:33 2022 +0200
@@ -153,6 +153,7 @@
         return duration
 
     def OnOK(self, event):
+        event.Skip()
         self.OnCloseDialog()
 
     def OnCloseDialog(self):
--- a/editors/DataTypeEditor.py	Thu Apr 07 15:28:24 2022 +0200
+++ b/editors/DataTypeEditor.py	Fri May 06 14:40:33 2022 +0200
@@ -47,7 +47,7 @@
 
 
 def AppendMenu(parent, help, kind, text):
-    return parent.Append(help=help, id=wx.ID_ANY, kind=kind, text=text)
+    return parent.Append(wx.MenuItem(helpString=help, id=wx.ID_ANY, kind=kind, text=text))
 
 
 def GetElementsTableColnames():
@@ -375,7 +375,7 @@
 
         self.StructureElementsGrid = CustomGrid(self.StructurePanel,
                                                 size=wx.Size(0, 150), style=wx.VSCROLL)
-        self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING,
+        self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGED,
                                         self.OnStructureElementsGridCellChange)
         self.StructureElementsGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN,
                                         self.OnStructureElementsGridEditorShown)
--- a/editors/ResourceEditor.py	Thu Apr 07 15:28:24 2022 +0200
+++ b/editors/ResourceEditor.py	Fri May 06 14:40:33 2022 +0200
@@ -247,7 +247,7 @@
             tasks_buttons_sizer.Add(button)
 
         self.TasksGrid = CustomGrid(self.Editor, style=wx.VSCROLL)
-        self.TasksGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING, self.OnTasksGridCellChange)
+        self.TasksGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGED, self.OnTasksGridCellChange)
         tasks_sizer.Add(self.TasksGrid, flag=wx.GROW)
 
         instances_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
@@ -277,7 +277,7 @@
             instances_buttons_sizer.Add(button)
 
         self.InstancesGrid = CustomGrid(self.Editor, style=wx.VSCROLL)
-        self.InstancesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGING, self.OnInstancesGridCellChange)
+        self.InstancesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGED, self.OnInstancesGridCellChange)
         instances_sizer.Add(self.InstancesGrid, flag=wx.GROW)
 
         self.Editor.SetSizer(main_sizer)