wxGrid bug

Hi

win98, Py 2.3.3, wxPy 2.4.2.4

A problem with wxGrid and/or more precicely with the GridCellEditor

1) The cell editor is not working if you edit a cell in the *last* row.
Eg. Put the cursor on a cell in the last row, press any key to open the editor,
<enter> to close the editor, the cursor stay on the cell, ok.
Now press again a key to reopen the editor, it is impossible to
reopen the editor. It will only be possible if you move the grid
cursor back and forth.
This is best seen if you create a grid with a single cell (1 row x 1 col)
or a grid containing a single row.

2) Events mismatch. I creates an app with a custrom editor and
put a print statement in every def. Same thing with the
EVT_GRID_EDITOR_SHOWN and EVT_GRID_EDITOR_HIDDEN
events handlers.
I noticed that the event corresponding to the EVT_GRID_EDITOR_HIDDEN
is fired *before*, the cell grid editor fct EndEdit is processed. Strange.

Look at this log info from my app, cell (0, 0)

main is running...
MyCellEditor: IsAcceptedKey: 32
[15:35:29] OnEditorShown: (0,0) (-1, -1)
MyCellEditor: Create
MyCellEditor: SetSize (0, 0, 79, 18)
MyCellEditor: BeginEdit (0,0)
[15:35:31] OnEditorHidden: (0,0) (-1, -1)
MyCellEditor: EndEdit (0,0)

Log info, cell (lastrow, 0)

After the cell editing:

main is running...
MyCellEditor: IsAcceptedKey: 32
[15:44:57] OnEditorShown: (19,0) (-1, -1)
MyCellEditor: Create
MyCellEditor: SetSize (0, 285, 79, 18)
MyCellEditor: BeginEdit (19,0)
MyCellEditor: EndEdit (19,0)

Now moving the grid cursor

[15:45:48] OnEditorHidden: (19,0) (-1, -1)
MyCellEditor: EndEdit (19,0)

A little bit more, if I put an self.SetGridCursor(0, 0) in the fct
OnEditorHidden, the application crashes completely. (Some grid
blue lines are even drawn on my editor!, - I guess on the wxScreen
or the exposed scree portion.)

Regards

Jean-Michel Fauth, Switzerland

Jean-Michel Fauth wrote:

Hi

win98, Py 2.3.3, wxPy 2.4.2.4

A problem with wxGrid and/or more precicely with the GridCellEditor

1) The cell editor is not working if you edit a cell in the *last* row.
Eg. Put the cursor on a cell in the last row, press any key to open the editor,
<enter> to close the editor, the cursor stay on the cell, ok.
Now press again a key to reopen the editor, it is impossible to
reopen the editor. It will only be possible if you move the grid
cursor back and forth.
This is best seen if you create a grid with a single cell (1 row x 1 col)
or a grid containing a single row.

I think that there is already a bug report about this. Please check SF and see if there is any additional info about it.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!