[wxPython] wxGrid test program

The attached gridtest.py illustrates some problems that exist in wxGrid, in
particular the differences between Win32 and wxGTK implementations, and a
problem with the wxPyGridCellEditor.

* Win32 page:

Under linux I cannot start entering text in a cell until I click it twice with
the mouse. Note that it doesn't have to be a doubleclick (quick).

* GTK page:

The GTK page works almost perfectly in Linux.

Small problems:
When the page is activated, the focus remains in the tab (although the grid
'cursor' has (0,0) selected). Under Windows the focus is automatically at
(0,0). I'd prefer the Windows behaviour on Linux as well, but maybe that
is platform (GTK) native behaviour.

As I mentioned previously, the numeric pad Enter does not work under linux.

Under Win32 the Enter key does not leave the cell.

There is something funny about the CellEditor. For some reason it will
loose the track of what row it should be editing. After a while the editor will
appear on a wrong row, but after edit the correct row's cell gets pasted with
the results.

My environment:
Linux: Mandrake 7.1, Python 2.0
wxPython 2.2.2, wxWindows 2.2.2, installed from Robin's RPMs
Under Win98 the same from prebuilt exe's.

-Harri

PS. disclaimer, I'm rather tired and might have overlooked something, but I
wanted to profit from the US-daylight hours to have replys when I wake
up in the morning :wink:

gridtest.py (5.91 KB)

PS. disclaimer, I'm rather tired and might have overlooked something, but

I

wanted to profit from the US-daylight hours to have replys when I wake
up in the morning :wink:

Sorry Harri, I had to paint the kids' bedroom tonight and now I'm dead
tired. I'll take a closer look at your sample tomorrow.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

The attached gridtest.py illustrates some problems that exist in wxGrid,

in

particular the differences between Win32 and wxGTK implementations, and a
problem with the wxPyGridCellEditor.

* Win32 page:

Under linux I cannot start entering text in a cell until I click it twice

with

the mouse. Note that it doesn't have to be a doubleclick (quick).

I can't duplicate this. As long as the grid has the focus and not the
notebook then the editor starts every time for me.

Oops! Correction. If the NumLock is on then no key is accepted as a
starting key, which is very weird. I'll try and track down a fix. It's
probably considered a modifier or something...

* GTK page:

The GTK page works almost perfectly in Linux.

Small problems:
When the page is activated, the focus remains in the tab (although the

grid

'cursor' has (0,0) selected). Under Windows the focus is automatically at
(0,0). I'd prefer the Windows behaviour on Linux as well, but maybe that
is platform (GTK) native behaviour.

I agree. Maybe you could enter a bug about this and see what happens...

As I mentioned previously, the numeric pad Enter does not work under

linux.

Where you the one that entered the bug on this? I'll try and get it fixed
for the grid but I'll leave the bug report open for the other controls.

Under Win32 the Enter key does not leave the cell.

Neither does the Tab. The wxNotebook on MSW is grabbing the enter and tab
and treating them as navigation keys, for switching notebook pages I guess.
You can see this by giving the notebook a EVT_NAVIGATION_KEY handler.
Giving the text ctrl the wxTE_PROCESS_ENTER and wxTE_PROCESS_TAB style flags
ensures that it gets events for those keys so the grid event handler can
switch cells while the text ctrl is active. The default cell editor creates
its control like this:

    m_control = new wxTextCtrl(parent, id, wxEmptyString,
                               wxDefaultPosition, wxDefaultSize
#if defined(__WXMSW__)
                               , wxTE_MULTILINE | wxTE_NO_VSCROLL |
wxTE_AUTO_SCROLL
#endif
                              );

which implies wxTE_PROCESS_ENTER, I'll add wxTE_PROCESS_TAB to it so the
default editor works right in a notebook or on a dialog, panel, or etc.

There is something funny about the CellEditor. For some reason it will
loose the track of what row it should be editing. After a while the

editor will

appear on a wrong row, but after edit the correct row's cell gets pasted

with

the results.

I never saw this. Can you consistently duplicate it?

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

I've checked in a new wxWindows/src/generic/grid.cpp into CVS on both the
main trunk and the 2.2 branch that fixes these:

1. Tab not completing a text ctrl on MSW when the grid is in a notebook,
(also probably when on a panel or dialog.)

2. NumLock-on not allowing keys to activate the cell editor on wxGTK. This
was because the metaDown flag was turned on and by default the cell editor
wouldn't activate for key events with modifiers set. Apparently XFree86
treats NumLock as Meta, which is kinda dumb if you ask me.

3. WXK_NUMPAD_ENTER is treated the same as WXK_RETURN.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Thanks a lot Robin. I'll check out wxWin from the CVS so I can track the mods
a bit better.

One idea that has been going through my mind every once and then would have a
'recorder' functionality for events inside wxWindows. That would enable test
scripts, sort of like SilkTest, and similar tools that cost $$$. For those
scripts to work cross platform, the functional differences have to be minimal,
so even the little things matter.

I may never have the time to doit, but hey, now the idea is out for anyone to
implement it. :wink:

-Harri

···

On Sun, 12 Nov 2000, Robin Dunn wrote:

I've checked in a new wxWindows/src/generic/grid.cpp into CVS on both the
main trunk and the 2.2 branch that fixes these:

1. Tab not completing a text ctrl on MSW when the grid is in a notebook,
(also probably when on a panel or dialog.)

2. NumLock-on not allowing keys to activate the cell editor on wxGTK. This
was because the metaDown flag was turned on and by default the cell editor
wouldn't activate for key events with modifiers set. Apparently XFree86
treats NumLock as Meta, which is kinda dumb if you ask me.

3. WXK_NUMPAD_ENTER is treated the same as WXK_RETURN.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users