Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Right click Menu with control bars listed Collapse All
Subject Author Date
William Keadey Jul 26, 2005 - 11:08 AM

I have two problems.


 


1. I have certain control bars where I don’t want the right click menu that lists all the control bars in my application to appear.


2. When I create a dynamic docking window.  It shows up in the right click menu, but is disabled.  I do not want it to appear in the menu at all.

Technical Support Jul 27, 2005 - 8:52 AM

We assume you are using dynamic resizable control bars (the CExtDynamicControlBar class) which are managed by the dynamic bar site (the CExtDynamicBarSite class). To customize context menus of particular bars, you need to use your own CExtDynamicControlBar-derived class. Your dynamic control bar should override the CExtDynamicControlBar::OnInitDbsMenu() and return false. This will suppress the menus as you requested. To make the dynamic bar site create the control bars of your type, override its CExtDynamicBarSite::OnDbsCreateNewBarInstance() method which should simply return newly created bars of your class.

William Keadey Jul 28, 2005 - 6:16 AM

I’m actually using CExtControlBar.


I changed my derived class to one of CExtDynamicControlBar and did what you had said.  If you return false in OnInitDbsMenu the CExtDynamicControlBar Class ASSERTS.


I’m not trying to suppress that menu.  Now I have a CExtDynamicControlBar derived class that has a dialog on it.  The dialog has a series of controls.  When I right click on any of the ctrls or on the control bar itself I get a menu that lists all the menu bars, control bars, and so on.  I do not want this menu or would like to modify the behavior of this menu.  This is same menu that occurs when you right click up in the frame area between menu and my view area.

Technical Support Jul 28, 2005 - 1:24 PM

Now things become clearer. You should simply handle the WM_CONTEXTMENU message in your dialog and make the OnContextMenu() method’s body empty. This solution is based on the WM_CONTEXTMENU message behavior. If it is not processed by some window, the message is sent to the parent window and so on up to the topmost pop-up window. You should also handle this message in your main view window. If your last explanation is correct, then you really don’t need dynamic control bars. The assertion relating to the CExtDynamicControlBar problem can be discussed in details. Do you use the CExtDynamicBarSite class as a second base class in your main frame window. Do you invoke the CExtDynamicBarSite::BarAlloc() method for creating dynamic resizable control bars?