Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

MenuBar blocks SpinCtrl copy/cut/paste/delete commands

Open gentlegiantJGC opened this issue 2 years ago • 4 comments

Operating system: Windows 10 wxPython version & source: 4.1.1 from pypi Python version & source: Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32

Description of the problem: I have a menubar that catches ctrl+c, ctrl+x, ctrl+v and delete. I also have a SpinCtrl widget and a TextCtrl widget. copy, cut, paste and delete all work as expected in the TextCtrl widget but in the SpinCtrl widget they do not work and the menu events are called.

I would expect that the TextCtrl behaviour would be the intended behaviour for both widgets.

More details and code can be found on the forum post below. https://discuss.wxpython.org/t/menubar-spinctrl-and-copy/35968

We have been trying to find a workaround (as documented in the forum post) but have not had any luck beyond copy due to a quirk in the way wx.UIActionSimulator().KeyDown(wx.WXK_CONTROL_C) behaves.

gentlegiantJGC avatar May 05 '22 15:05 gentlegiantJGC

This issue has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/menubar-spinctrl-and-copy/35968/10

RobinD42 avatar May 05 '22 15:05 RobinD42

The "broken" behaviour might also extend to some other widgets.

gentlegiantJGC avatar May 05 '22 15:05 gentlegiantJGC

I have tried this with wxWidgets and can see it there as well. I will have a look whether I can find the cause.

DietmarSchwertberger avatar May 05 '22 16:05 DietmarSchwertberger

The fix is implemented in wxWidgets and will be part of wxWidgets 3.1.7.

DietmarSchwertberger avatar May 07 '22 15:05 DietmarSchwertberger