[wxPython] Starting editing in grid with non-ascii character.

I'm back with my grids!

If I move around in a any wxGrid some demo for instance, and starts to type
"Apple" for instace, it appears as expected. So far so good.

But if I use my native language, and type "Äpple", I have no such luck. I just
get "pple". Aha, I think. The app doesn't understand that "Ä" is a letter. So I
add:
   import locale
   locale.setlocale(locale.LC_ALL, '')

Now "string.letters" grew quite a bit!

Then I try again, but now I get "Þpple". Typing another "Ä" will turn out as
expexcted. The problem only occurs with the starting letter.

(In case your Latin1 characters are garbled, I got an Icelandic thorn instead
of an A with umlaut, or in HTML þ instead of Ä.)

I suppose this is related to Geza Groma's previous mails, but I didn't
see any clear resolution to that.

Hope this will be solved...

/Magnus

···

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

Please enter a bug report about this.

···

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

Done, id 475069. I can inform you that the problem also exists
with wxWindows/C++ 2.2.7 for Windows, but that it works as it
should in Linux. At least that narrows things down a bit...

I made another observation:

If I start editing with one of the characters above the digits,
the digit will be entered into the cell, not the shifted character
I wanted. On the other hand it handles shift correctly for A-Z.

Can someone check if this bug appears with US keyboards as well,
or is this bug connected to the keyboard types?

/Magnus

···

At 10:29 2001-10-25 -0700, you wrote:

Please enter a bug report about this.

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

Can someone check if this bug appears with US keyboards as well,
or is this bug connected to the keyboard types?

It does.

The problem stems from the fact that the starting key is caught in a KeyDown
handler in the grid, so it is not completely translating the key into the
char. before passing it on to the editor.

···

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

Indeed, this is the same problem I reported a few days ago. Temporarly I
found the following workaround:

1. Write your own cell editor class, inherited from wxPyGridCellEditor. I
basically followed the demo.
2. The problem lies in the StartingKey method, the evt parameter of wich
carries key code, not char code. So don't handle the key code in this
method. Instead, simply set a flag in the namespace of the grid.
3. In the __init__ method of the grid catch wxEVT_CHAR by
grid.GetGridWindow() (not by the grid itself!). In the corresponding event
handler method check for the flag. If set, clear it and, get the character
code by evt.GetKeyCode() and handle according to your aim (usually you want
to put it or append to the editor control). Note, that this is already
character code so you have simply to check that it is < 256. This works at
least with the Latin 2 code page, I have no idea if and how Unicode
characters can be handled.

Good luck,
Geza Groma

Please enter a bug report about this.

Done, id 475069. I can inform you that the problem also exists
with wxWindows/C++ 2.2.7 for Windows, but that it works as it
should in Linux. At least that narrows things down a bit...

I made another observation:

If I start editing with one of the characters above the digits,
the digit will be entered into the cell, not the shifted character
I wanted. On the other hand it handles shift correctly for A-Z.

Can someone check if this bug appears with US keyboards as well,
or is this bug connected to the keyboard types?

/Magnus

···

At 10:29 2001-10-25 -0700, you wrote:

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users