Using Delete as an accelerator key

0 views
Skip to first unread message

David Hughes

unread,
Oct 24, 2003, 12:36:00 PM10/24/03
to wxPytho...@lists.wxwindows.org
I have implemented an edit menu containing copy, cut, paste, clear and
select-all items for manipulating highlighted rows in a wxGridCtrl and
have used the usual accelerator keys - Ctrl/C, Ctrl/V etc, including
Delete. It all works OK except that Delete no longer works in any of the
wxTextCtrl's that are in panels or notebooks inside the frame containing
the edit menu (pop up dialogs are OK). Changing the accelerator to
Ctrl/Delete solves the problem for now, but is this a known problem, have
I tried to do something silly, or should it be reported as a bug?

(wxPython 2.4.2.4 Python 2.3c.1 Windows 2000 SP4)

Regards,

David Hughes
Forestfield Software Ltd
www.forestfield.co.uk

Robin Dunn

unread,
Oct 24, 2003, 12:54:06 PM10/24/03
to wxPytho...@lists.wxwindows.org
David Hughes wrote:
> I have implemented an edit menu containing copy, cut, paste, clear and
> select-all items for manipulating highlighted rows in a wxGridCtrl and
> have used the usual accelerator keys - Ctrl/C, Ctrl/V etc, including
> Delete. It all works OK except that Delete no longer works in any of the
> wxTextCtrl's that are in panels or notebooks inside the frame containing
> the edit menu (pop up dialogs are OK). Changing the accelerator to
> Ctrl/Delete solves the problem for now, but is this a known problem, have
> I tried to do something silly, or should it be reported as a bug?

Accelerators are checked before the key event is given to the focused
window, if a matching accelerator is found then the EVT_MENU event is
sent and the key event is discarded. Things like the above are an
unfortunate side-effect of that fact, but making it behave differently
when the focused window is a textctrl and the key is one that it should
process woudl be complex and woudl probably lead to confusing
inconsistencies.

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

David Hughes

unread,
Oct 25, 2003, 2:09:00 AM10/25/03
to wxPytho...@lists.wxwindows.org
Fair enough, I can live with that. But the thing that made me raise the
question was that the other accelerators - Ctrl/C /V and /X all work OK in
the textctrl, but Delete doesn't.
Reply all
Reply to author
Forward
0 new messages