|
From: Marcin 'Malcom' Malich on 6 May 2008 11:11 The menu key (shortcut for showing context menu) should be (win/gtk/ x): WXK_MENU = VK_APPS / GDK_Menu / XK_Menu But VK_APPS isn't mapped to WXK_MENU on Windows. And this key code generating right mouse click event in WM_KEYDOWN/ WM_KEYUP, so it makes problematic situation in handling context menu on custom controlls when the event is generated form keyboard. Why wx has no left and right version of shift/ctrl/alt? Win, gtk and x generate this key code, and sometimes it is helpful. -- Pozdrowienia, Marcin 'Malcom' Malich me /at/ malcom.pl http://malcom.pl
From: Marcin 'Malcom' Malich on 7 May 2008 06:39 On 7 Maj, 01:51, Vadim Zeitlin <va...(a)wxwidgets.org> wrote: > MMM> I added handle to wxEVT_CONTEXT_MENU in app. > MMM> > MMM> mouse button right up: > MMM> - OnMouseRightUp > MMM> - OnContextMenu with cursor position (called only if event.Skip() on > MMM> OnMouseRightUp) > MMM> > MMM> pressed VK_APPS: > MMM> - OnContextMenu with (-1, -1) position > MMM> - OnMouseRightUp (probably called by mouse right up event generated in > MMM> WM_KEY* for VK_APPS key) > > Yes, this behaviour is expected. Or did I miss something? OnMouseRightUp on pressed VK_APPS is not necessary, wxgtk and other port (probably) no generate it. > MMM> So, in my opinion, we should delete generate mouse event code from > MMM> WM_KEY* (or sign to deprecate/compatible2.8 for existing code and > MMM> delete in wx3.0), > > I don't really see any reason to do this, what's the harm in keeping it? > This change would break the existing code silently (you can't ensure that > the code using this feature would generate compilation warnings or errors) > and this is the worst kind of breakage possible so there should be really a > very good reason to do it. The generate mouse event is not necessary, the code should by using wxContextMenu for showing popup menu, no mosuse handlign event. Ofcourse it will ruin compatibility with older code that uses wx, but developer should take it into consideration every time he changes library's version he's using. It would be a good habit to make some migration notes, which would cover functionality that was changed and which could cause problems with existing code. In my opinion wx3 should supporting exception, namespace and other language features ;) > MMM> mapping VK_APPS to VK_MENU Sorry for my mistake. Mapping VK_APPS to WXK_MENU. > If you can write and test a (presumably very simple) patch needed to do > this, I'd be glad to apply it. Ok, I'll write the patch in free time. -- Pozdrowienia, Marcin 'Malcom' Malich me /at/ malcom.pl http://malcom.pl
|
Pages: 1 Prev: Creating UI object in a different thread causing crash Next: wxSashWindow Event |