Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Context Menu request
Context Menu request [message #44194] |
Thu, 22 January 2015 11:22 |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
Hello Mirek,
I noticed that the context menu handler (WhenBar) is called in the Right mouse Down event handler.
I think it would be better to do that in the Right mouse Up.
The reason is made clear with the following example:
- Take an ArrayCtrl with a Context menu, right click on an item => the context menu is opened
- With the menu still open, right click another item => the context menu closes but does not reopen for the newly selected item.
- So you have to do a second Right click on that item to get the Context menu for it. I think this is not really user friendly
I have tried this little modification in the ArrayCtrl and it does seem to work ok.
Best regards,
frank
[Updated on: Thu, 22 January 2015 11:22] Report message to a moderator
|
|
|
|
|
|
Re: Context Menu request [message #44198 is a reply to message #44197] |
Thu, 22 January 2015 16:58 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello frankdeprins,
It makes sense. It seems that default behaviour for M$ Windows operating system family is behaviour you were talking about (I siwtched OS from Linux to test it ). What is funny here is that GTK apss for example Firefox have got different behaviour on Unix like operating system and Windows.
Of course we can emulate this behaviour when Windows is detected by simply using "#ifdef" preprocessor macro. Example (pseudocode):
#ifdef PLATFORM_WINDOWS
// Right up invokes context menu
#else
// Right down invokes context menu
#endif
P.S.
This change should be carefully introduced (What happend with custom Ctrl's - Should we move WhenBar to Ctrl class to make it independent from operating system).
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Thu, 22 January 2015 18:57] Report message to a moderator
|
|
|
Re: Context Menu request [message #44200 is a reply to message #44194] |
Thu, 22 January 2015 21:41 |
|
bushman
Messages: 134 Registered: February 2009
|
Experienced Member |
|
|
hi, there!
I've experimented right-clicking a couple "CtrlArray-like" Windows ctrls and, indeed, context menu pops up after releasing RMB, but I honestly see no use in having it done this way, since you have to release RMB anyway, if you you now decide to change selection, otherwise either you just drag selected object (when allowed), or you do nothing, but to cause Context menu to pop up at some other view area point and that's all. Curiously enough, I've been using Windows for some time now without ever noticing or bothering about this aspect, but now that you raised this point, I see that the way Upp does it is actually the best and more appropriate approach and I think the Windows way is rather wrong: one should be able to visualize and consult menu content immediately right after RMB click!
Thank you!
|
|
|
|
Re: Context Menu request [message #44203 is a reply to message #44201] |
Fri, 23 January 2015 10:27 |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
Hello Mirek (and others),
The fact that those differences exist on Windows is not that strange.
Those apps that are built directly on the Windows SDK or on some framework that follows it closely (like MFC), will show the behaviour as I mentioned. Those that are built on custom frameworks might not follow this convention.
Of course, even in the Windows SDK, the user can still react to WM_RBUTTONDOWN or WM_RBUTTONUP, but the proper way to handle it is in WM_CONTEXTMENU.
PS: Java (Swing) on Windows also follows the SDK convention.
I can see and respect the reason for not changing it though and hope you will not hold it against me if I change it on my local copy of Upp
[Updated on: Fri, 23 January 2015 11:34] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 26 16:00:43 CEST 2024
Total time taken to generate the page: 0.02207 seconds
|