wxGrid and wxGridEvent Questions
I suspect my group is not the only one having these problems… Please help answer these questions (below) and point to the right code sample…
In the grid (wxGrid), editors (subclasses of wxPyGridCellEditor) “react” only after second click (or tab into the cell, and then click). First click (or tab into the cell) does not do anything to activate the editor - its only function is to “select” a given cell. So cell selection always “eats” initial click (or tab). This may not be such a big deal for a simple text control, but it does make big deal for other types of editors (check box, choice list, combo box) - as these require extra click to perform an action (check/uncheck check box, expand drop-down list, etc), requiring users make at least 2 clicks. This does not happen outside of grid…
So questions are:
Is there any way to "eliminate" extra click by enabling editor control at the same time as cell selection is done?
If (1) is not possible - how can second click (or double-click) event (EVT_GRID_CELL_LEFT_CLICK, EVT_GRID_CELL_LEFT_DCLICK) be "forced" in code? I tried creating single-click event handler that generates double-click event in turn, but that does not activate the editor
I suspect my group is not the only one having these problems… Please help answer these questions (below) and point to the right code sample…
In the grid (wxGrid), editors (subclasses of wxPyGridCellEditor) "react" only after second click (or tab into the cell, and then click). First click (or tab into the cell) does not do anything to activate the editor - its only function is to "select" a given cell. So cell selection always "eats" initial click (or tab). This may not be such a big deal for a simple text control, but it does make big deal for other types of editors (check box, choice list, combo box) - as these require extra click to perform an action (check/uncheck check box, expand drop-down list, etc), requiring users make at least 2 clicks. This does not happen outside of grid…
So questions are:
1. Is there any way to "eliminate" extra click by enabling editor control at the same time as cell selection is done?
See wx.lib.mixins.grid.GridAutoEditMixin
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I suspect my group is not the only one having these problems… Please
help answer these questions (below) and point to the right code sample…
In the grid (wxGrid), editors (subclasses of wxPyGridCellEditor)
"react" only after second click (or tab into the cell, and then
click). First click (or tab into the cell) does not do anything to
activate the editor - its only function is to "select" a given cell.
So cell selection always "eats" initial click (or tab). This may not
be such a big deal for a simple text control, but it does make big
deal for other types of editors (check box, choice list, combo box) -
as these require extra click to perform an action (check/uncheck check
box, expand drop-down list, etc), requiring users make at least 2
clicks. This does not happen outside of grid…
So questions are:
1. Is there any way to "eliminate" extra click by enabling editor
control at the same time as cell selection is done?
See wx.lib.mixins.grid.GridAutoEditMixin
Without having looked at it I think that it catches the SELECT event and calls
self.EnableCellEditControl()
or wx.CallAfter(self.EnableCellEditControl)