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?
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 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.
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.
Regards,
David Hughes
Forestfield Software Ltd
www.forestfield.co.uk