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 » CExtPopupMenuWnd don't want left column Collapse All
Subject Author Date
Krustys Donuts Oct 16, 2008 - 1:20 AM

Dear Support,


My CExtPopupMenuWnd code is below:



HMENU oMenu;

 

{

 

if((oMenu = LoadMenu(GlobalInstance,MAKEINTRESOURCE(IDR_menuTpContextMenu)))!=NULL) //!Get the sub-menu.

CMenu menu;

menu.Attach(oMenu);

 

//!Use the Prof-uis menu class.

CExtPopupMenuWnd* pPopup =

pPopup->UpdateFromMenu(GetParent()->m_hWnd, &menu,

new CExtPopupMenuWnd;true, true, true);

 

//!Use the name of TP A for the header of this context menu.

pPopup->MenuCaptionTextSet(strTpA.c_str());

 

//!Put the name of TP B into the ’Transfer from’ and ’Transfer to’ commands.

string str = (boost::format(m_st.GetString( IDS_strTransferTo)) % strTpB).str();

pPopup->ItemSetPopupText(pPopup->ItemFindPosForCmdID(ID_TransferAtoB), str.c_str());

str = (boost::format(m_st.GetString( IDS_strTransferFrom)) % strTpB).str();

pPopup->ItemSetPopupText(pPopup->ItemFindPosForCmdID(ID_TransferBtoA), str.c_str());//!Show the menu

pPopup->TrackPopupMenu( TPM_CENTERALIGN | TPMX_NO_CMD_UI | TPMX_HIDE_KEYBOARD_ACCELERATORS, point.x, point.y);

 


This code gets me what I want except there is an empty column on the left side of the menu. How can I eliminate this feature. I tried SetLeftColumnWidth(0) and SetLeftColumnWidth(1) withoout luck.


Thanks,


Gil

Technical Support Oct 17, 2008 - 8:50 AM

The icon area on the left of a popup menu is a built-in menu part. You can re-paint it without painting anything on it. You should handle a CExtPopupMenuWnd::g_nMsgPopupDrawLeftArea registered message as it is demonstrated in the ProfUIS_Controls sample.