Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Context Menu request
Context Menu request [message #44194] Thu, 22 January 2015 11:22 Go to next message
frankdeprins is currently offline  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 #44195 is a reply to message #44194] Thu, 22 January 2015 14:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hard to say. Current behaviour is consistent with e.g. GTK apps or OpenOffice.

It has advantage that you can choose menu item by releasing the mouse button.

[Updated on: Thu, 22 January 2015 14:31]

Report message to a moderator

Re: Context Menu request [message #44196 is a reply to message #44195] Thu, 22 January 2015 15:53 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I need to agree with Mirek. Current "WhenBar" implementation is "international" standard (Mostly all GUI frameworks use this solution) and it shouldn't be changed. Maybe for some people you solution will be more intuitive, but habits acquired over the years are hard to change.

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: Context Menu request [message #44197 is a reply to message #44196] Thu, 22 January 2015 16:14 Go to previous messageGo to next message
frankdeprins is currently offline  frankdeprins
Messages: 99
Registered: September 2008
Location: Antwerp - Belgium
Member
I think you forget a small niche GUI: Windows Razz
Just open an explorer, right click a file wait a bit and release the mouse button. You will notice it also opens the menu on mouse up, not down.
Re: Context Menu request [message #44198 is a reply to message #44197] Thu, 22 January 2015 16:58 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
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 Wink). 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 Go to previous messageGo to next message
bushman is currently offline  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 #44201 is a reply to message #44200] Fri, 23 January 2015 08:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, what is worth noting is that SOME windows apps, notable OpenOffice, open context menu on mouse down too.

Now I agree that ideal would be to be 100% compliant with look&feel of target platform, but such a goal is difficult to achieve. I think that something like this, when some small difference is noticed after 15 years for the first time, I guess I am good with it. Changing this has potential risk of breaking BW compatibility.
Re: Context Menu request [message #44203 is a reply to message #44201] Fri, 23 January 2015 10:27 Go to previous message
frankdeprins is currently offline  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 Smile

[Updated on: Fri, 23 January 2015 11:34]

Report message to a moderator

Previous Topic: How to check internet availability?
Next Topic: Image DnD into Upp app
Goto Forum:
  


Current Time: Fri Mar 29 08:16:21 CET 2024

Total time taken to generate the page: 0.01904 seconds