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 » checking a menu item in CExtPopupMenuWnd Collapse All
Subject Author Date
Pierre MEDART Jul 3, 2007 - 7:24 AM

Hi,

I’m constructing a CExtPopupMenuWnd like

CExtPopupMenuWnd * p_anExtPopupWnd = new CExtPopupMenuWnd();
CExtPopupMenuWnd::g_bMenuExpanding = false;

p_anExtPopupWnd->UpdateFromMenu(this->m_hWnd,&aMenu, false, true, false);

One of the item of my aMenu is set to checked but in the p_anExtPopupWnd it is not.

What do I miss ?

Suhai Gyorgy Jul 3, 2007 - 8:37 AM

Support’s answer to a similar problem:

Each menu/toolbar item controls its status (enabled/disabled, checked/unchecked) via MFC command updating mechanism. So you can make the menu item checked by providing an update handler for the command ID (simply add the ON_UPDATE_COMMAND_UI handler for this command):


afx_msg void OnUpdateYourCommand(CCmdUI* pCmdUI);
...
ON_UPDATE_COMMAND_UI(ID_YOUR_COMMAND, OnUpdateYourCommand)
...
void CMainFrame::OnUpdateYourCommand( CCmdUI * pCmdUI ) 
{
	pCmdUI->SetCheck( m_bChecked ? 1 : 0 );
}