On Saturday, January 5, 2013 6:51:15 AM UTC-6, Raffaello wrote:
It would be of some use for me that the editor of a single wx.grid cell opens automatically as soon as that cell is selected by the user.
Is it possible and, in case, how can it be implemented?
Many thanks in advance for any suggestion.
In the wxPython demo for the grid, there’s this code which seems to implement exactly what you want:
def OnLeftDClick(self, evt):
if self.CanEnableCellControl():
self.EnableCellEditControl()
There is also a mixin class in wx.lib.mixins.grid that will do it for you.
···
On 1/8/13 4:20 PM, Mike Driscoll wrote:
Hi,
On Saturday, January 5, 2013 6:51:15 AM UTC-6, Raffaello wrote:
It would be of some use for me that the editor of a single wx.grid
cell opens automatically as soon as that cell is selected by the user.
Is it possible and, in case, how can it be implemented?
Many thanks in advance for any suggestion.
In the wxPython demo for the grid, there's this code which seems to
implement exactly what you want:
def OnLeftDClick(self, evt):
if self.CanEnableCellControl():
self.EnableCellEditControl()
It would be of some use for me that the editor of a single wx.grid
cell opens automatically as soon as that cell is selected by the user.
Is it possible and, in case, how can it be implemented?
Many thanks in advance for any suggestion.
In the wxPython demo for the grid, there’s this code which seems to
implement exactly what you want:
def OnLeftDClick(self, evt):
if self.CanEnableCellControl():
self.EnableCellEditControl()
There is also a mixin class in wx.lib.mixins.grid that will do it for you.
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()
···
Il giorno mercoledì 9 gennaio 2013 16:47:47 UTC+1, Robin Dunn ha scritto:
On 1/8/13 4:20 PM, Mike Driscoll wrote:
On Saturday, January 5, 2013 6:51:15 AM UTC-6, Raffaello wrote: