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++ Widgets - General questions or Mixed problems » MenuBar::Execute isn't modal?
MenuBar::Execute isn't modal? [message #23355] Tue, 13 October 2009 16:29 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

TheIDE help says MenuBar::Execute function starts modal context menu. But when it does, mouse messages are still sent to control in the background.
In my case it is not very convenient because this control changes it's internal state on mouse movement. And when user clicks context menu item, control is in the different state than it was when menu was actually generated and shown.
My questions: is this behaviour ok and how to make really modal context menu?

P.S. May be there is a MenuBar event on menu closing? This would help, but I failed to find one.

P.P.S. Please move this topic to Menu forum branch. Thanks in forward.

[Updated on: Tue, 13 October 2009 21:22]

Report message to a moderator

Re: MenuBar::Execute isn't modal? [message #23379 is a reply to message #23355] Thu, 15 October 2009 13:33 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Anyone please can help?
Re: MenuBar::Execute isn't modal? [message #23380 is a reply to message #23379] Thu, 15 October 2009 15:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Execute has own message loop. Anyway, as port of process, messages are still sent to any enabled widgets/windows.

You would have to disable the window to avoid this.

Mirek
Re: MenuBar::Execute isn't modal? [message #23385 is a reply to message #23380] Thu, 15 October 2009 21:14 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I can't disable the window/parent control because I can't determine the moment MenuBar is closed (and none of items were selected). I failed to find handler on menu bar closing.
Re: MenuBar::Execute isn't modal? [message #23404 is a reply to message #23385] Sat, 17 October 2009 00:03 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Mirek, how could I catch the moment popup menu is closed?
Re: MenuBar::Execute isn't modal? [message #23427 is a reply to message #23404] Sun, 18 October 2009 21:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Fri, 16 October 2009 18:03

Mirek, how could I catch the moment popup menu is closed?


YOu are right, you cannot now. I can add WhenClose.

Anyway, I am a little bit puzzled as I had never a problem with this....

Mirek
Re: MenuBar::Execute isn't modal? [message #23435 is a reply to message #23427] Mon, 19 October 2009 10:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I am now trying to improve here...

One thing to notice: We cannot make MenuBar completely modal, because normal GUI operation e.g. needs that if in wordprocessor you invoke any menu, then click the text, menu disappears and CARET MOVES TO THE POSITION CLICKED. So disabling everything as with modal dialogs is not and option.

The plan now is to add WhenOpen and WhenClose callbacks that would trigger when menu's submenu is opened/closed (note that you do not need callbacks for Execute).

Mirek
Re: MenuBar::Execute isn't modal? [message #23436 is a reply to message #23435] Mon, 19 October 2009 11:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, we have na WhenOpenSubMenu and WhenCloseSubmenu.

Note that they are really useful only for "child" menus (normal menubars in TopWindow).

For Execute, before call is "Open" and after "Close".

Mirek
Re: MenuBar::Execute isn't modal? [message #23444 is a reply to message #23436] Tue, 20 October 2009 12:00 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

WhenClose still doesn't reflect on MenuBar closing.

"For Execute, before call is "Open" and after "Close"."
--- Please explain what does it mean. And the problem catching menu bar closing is still actual.
Re: MenuBar::Execute isn't modal? [message #23473 is a reply to message #23444] Wed, 21 October 2009 22:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Tue, 20 October 2009 06:00

WhenClose still doesn't reflect on MenuBar closing.

"For Execute, before call is "Open" and after "Close"."
--- Please explain what does it mean. And the problem catching menu bar closing is still actual.


// disable your items here
menu.Execute();
// enable your items here


Mirek
Re: MenuBar::Execute isn't modal? [message #23474 is a reply to message #23444] Wed, 21 October 2009 22:23 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Tue, 20 October 2009 06:00

WhenClose still doesn't reflect on MenuBar closing.



Well, there is a problem with "what menu".

Note that these callbacks are named

WhenOpenSubMenu and WhenCloseSubmenu.

-> note 'SubMenu'.

This is because the intended use is for the main menu (which is not a popup and is visible all the time) and callbacks reflect opening/closing of first level submenus.

Mirek
Previous Topic: DropList + AddSeparator + mouse wheel problem
Next Topic: Sending an email from Upp application
Goto Forum:
  


Current Time: Thu Mar 28 14:36:54 CET 2024

Total time taken to generate the page: 0.01768 seconds