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 » Docking bar problem/question Collapse All
Subject Author Date
Offer Har Nov 23, 2006 - 8:28 AM

Hi,
I have docking bars that i don’t want to be displayed in the right click menu which displays all the bars.
What function controls this?
Thanks.

Suhai Gyorgy Nov 23, 2006 - 8:41 AM

I use this code to remove MenuBar’s entry from all right-click popup menus:
in MainFrm.h:

	afx_msg LRESULT OnConstructPopupMenuCB(WPARAM wParam, LPARAM lParam);
in MainFrm.cpp:
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	...
	ON_REGISTERED_MESSAGE(CExtControlBar::g_nMsgConstructPopupMenu, OnConstructPopupMenuCB)
	...
END_MESSAGE_MAP()
...
LRESULT CMainFrame::OnConstructPopupMenuCB(WPARAM wParam, LPARAM lParam)
{
	ASSERT_VALID( this );
	lParam;
	CExtControlBar::POPUP_MENU_EVENT_DATA * p_pmed =
		CExtControlBar::POPUP_MENU_EVENT_DATA::FromWParam( wParam );
	ASSERT( p_pmed != NULL );
	ASSERT_VALID( p_pmed->m_pPopupMenuWnd );
	if( p_pmed->m_bPostNotification )
	{
		VERIFY( p_pmed->m_pPopupMenuWnd->ItemRemove( p_pmed->m_pPopupMenuWnd->ItemFindPosForCmdID(AFX_IDW_DIALOGBAR))
			);
	}
	return 0;
}
You can customize it by writing different ID in place of AFX_IDW_DIALOGBAR.

Offer Har Nov 23, 2006 - 10:16 AM

Thanks!
Problem solved.

Technical Support Nov 23, 2006 - 11:01 AM

In addition to what Chris said, there is another solution: set the CExtControlBar::m_bAppearInDockSiteControlBarPopupMenu property to false. This is applicable to any control bar (toolbar, menu bar, resizable control bar, and panel bar).


Offer Har Nov 23, 2006 - 11:06 AM

Another question - what is the sort order in this menu?
It is not alphabetical.

Technical Support Nov 27, 2006 - 12:59 PM

The control bars are shown in the order of creation (the order of constructor calls). For example, if you declare control bars in the following order:

CExtControlBar    m_wndResizableBar0;
CExtControlBar    m_wndResizableBar1;
CExtControlBar    m_wndResizableBar2;
CExtControlBar    m_wndResizableBar3;
CExtControlBar    m_wndResizableBar4;
they will be shown in this order:
m_wndResizableBar0;
m_wndResizableBar1;
m_wndResizableBar2;
m_wndResizableBar3;
m_wndResizableBar4;

Offer Har Nov 27, 2006 - 1:32 PM

Is there any way of changing it to be sorted?
I have limited control over the order, the bars are plug-ins.

Technical Support Nov 28, 2006 - 10:37 AM

You can modify and rebuild any of the built-in Prof-UIS menus. This is demonstrated in the ProfStudio sample, where you can see menus with lists of control bars organized into groups. So you could do this in a similar way, using the CExtControlBar::g_nMsgConstructPopupMenu message (it is handled in the CMainFrame::OnConstructPopupMenuCB() method in ProfStudio).

Offer Har Nov 23, 2006 - 11:05 AM

Even Better!