I am having trouble with key presses on a grid that is on a wxWizard. When I press the Enter key after I am finished editing a cell, instead of hiding the editor, or moving to the next cell, the focus jumps to the "Next" button. I am having trouble intercepting this event. I would like it to behave "normally" (how it does in the demo) whereas the cell's editor is hidden and the focus is moved to the next cell. Is this possible?
Giald
Gilad (Giald?) wrote:
I am having trouble with key presses on a grid that is on a wxWizard. When
I press the Enter key after I am finished editing a cell, instead of hiding
the editor, or moving to the next cell, the focus jumps to the "Next"
button. I am having trouble intercepting this event. I would like it to
behave "normally" (how it does in the demo) whereas the cell's editor is
hidden and the focus is moved to the next cell. Is this possible?
Giald
This sounds similar to a problem I had using wxPyGridCellEditor, though I
was not using wxWizard, so it may not be the same. Anyway, my solution was
to use wxTE_PROCESS_ENTER as the style on the wxTextCtrl associated with the
editor. I also used wxTE_PROCESS_TAB, as I had a similar problem with the
tab key.
Hope this helps.
Frank Millman
···
----- Original Message -----
From: "Gilad Suberri" <gsuberri@eos.east.hitc.com>
To: "wxPython-users" <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, November 05, 2003 6:52 PM
Subject: [wxPython-users] Enter key with Grid and Wizard
Thanks for your help. That sounds like it might work, but I am not sure how
to go about that. If I am using a wxGrid, how do I use wxTE_PROCESS_ENTER
for each cell and what id do I use when calling EVT_TEXT_ENTER? Thanks
again.
Gilad
···
----- Original Message -----
From: "Frank Millman" <frank@chagford.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Thursday, November 06, 2003 5:30 AM
Subject: Re: [wxPython-users] Enter key with Grid and Wizard
----- Original Message -----
From: "Gilad Suberri" <gsuberri@eos.east.hitc.com>
To: "wxPython-users" <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, November 05, 2003 6:52 PM
Subject: [wxPython-users] Enter key with Grid and Wizard
Gilad (Giald?) wrote:
> I am having trouble with key presses on a grid that is on a wxWizard.
When
I press the Enter key after I am finished editing a cell, instead of
hiding
the editor, or moving to the next cell, the focus jumps to the "Next"
button. I am having trouble intercepting this event. I would like it to
behave "normally" (how it does in the demo) whereas the cell's editor is
hidden and the focus is moved to the next cell. Is this possible?
> Giald
This sounds similar to a problem I had using wxPyGridCellEditor, though I
was not using wxWizard, so it may not be the same. Anyway, my solution was
to use wxTE_PROCESS_ENTER as the style on the wxTextCtrl associated with
the
editor. I also used wxTE_PROCESS_TAB, as I had a similar problem with the
tab key.
Hope this helps.
Frank Millman
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Gilad Suberri wrote:
Thanks for your help. That sounds like it might work, but I am not sure
how
to go about that. If I am using a wxGrid, how do I use wxTE_PROCESS_ENTER
for each cell and what id do I use when calling EVT_TEXT_ENTER? Thanks
again.
Gilad
I assumed form your original post that you were using a customised
GridCellEditor. If this is the case, you must have a Create() function with
a line such as 'self._tc = wxTextCtrl(parent, id, "")'. This is where you
would add the extra style.
I see you refer to EVT_TEXT_ENTER. I have never used this. The default
behaviour of wxGrid is to accept "enter" as an indication to close the
editor and move down one cell. Maybe this is causing your problem.
If none of this helps, I suggest that you post a small but complete example
of your code that illustrates the problem. If I cannot spot the error, there
is a good chance that someone with more knowledge than me will be able to
assist. (Also you would be surprised how often the exercise of constructing
a small but complete example enables you to spot the error yourself.)
Frank