+#----------------------------------------------------------------------------
+
+
+class GridAutoEditMixin:
+    """A mix-in class that automatically enables the grid edit control when
+    a cell is selected.
+
+    If your class hooks EVT_GRID_SELECT_CELL be sure to call event.Skip so
+    this handler will be called too.
+    """
+
+    def __init__(self):
+        self.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.__OnSelectCell)
+
+
+    def __DoEnableEdit(self):
+        if self.CanEnableCellControl():
+            self.EnableCellEditControl()
+
+
+    def __OnSelectCell(self, evt):
+        wx.CallAfter(self.__DoEnableEdit)
+        evt.Skip()