]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/lib/mixins/grid.py
1 #----------------------------------------------------------------------------
2 # Name: wx.lib.mixins.grid
3 # Purpose: Helpful mix-in classes for wx.Grid
9 # Copyright: (c) 2001 by Total Control Software
10 # Licence: wxWindows license
11 #----------------------------------------------------------------------------
12 # 12/14/2003 - Jeff Grimmett (grimmtooth@softhome.net)
14 # o 2.5 compatability update.
17 # 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
19 # o wxGridAutoEditMixin -> GridAutoEditMixin
25 #----------------------------------------------------------------------------
28 class GridAutoEditMixin
:
29 """A mix-in class that automatically enables the grid edit control when
32 If your class hooks EVT_GRID_SELECT_CELL be sure to call event.Skip so
33 this handler will be called too.
37 self
.Bind(wx
.grid
.EVT_GRID_SELECT_CELL
, self
.__OnSelectCell
)
40 def __DoEnableEdit(self
):
41 if self
.CanEnableCellControl():
42 self
.EnableCellEditControl()
45 def __OnSelectCell(self
, evt
):
46 wx
.CallAfter(self
.__DoEnableEdit
)