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 General Discussion » CExtPopupMenuWnd Adding a Title Collapse All
Subject Author Date
mediatime Conseil Feb 17, 2012 - 8:41 AM

Hi


I am trying to add an item to a popup menu that is not selectable, I want it to be like a title.


I can bold it, and make it disabled, but the "look" of the disabled item is not good to be a title.




  


    CExtPopupMenuWnd *menu1 = new CExtPopupMenuWnd();

    VERIFY( menu1->CreatePopupMenu( GetSafeHwnd() ) );

    UINT nResultCmdID = 0;

    DWORD dwTrackFlags = TPMX_DO_MESSAGE_LOOP | TPMX_NO_WM_COMMAND | TPMX_NO_CMD_UI | TPMX_NO_HIDE_RARELY;


    menu1->ItemInsertCommand(RAYONTREECTRL_MENU_CMD_TITLE,-1,sSectionTitle);

    menu1->ItemBoldSet(0);

    int nIndex = menu1->ItemFindPosForCmdID( RAYONTREECTRL_MENU_CMD_TITLE );

    if( nIndex >= 0 )

    {

        CExtPopupMenuWnd::MENUITEMDATA & _mii = menu1->ItemGetInfo( nIndex );

        _mii.Enable( false );

    }


 


Best Regards

Technical Support Feb 17, 2012 - 11:35 AM

Please run the ProfUIS_Controls sample application, select the Popup Menus dialog page and invoke context menu over this page via right mouse button click. The first level of displayed context menu contains menu item like you need. Menu item repainting is implemented in the CPagePopupMenus::OnDrawPopupMenuItem() method which handles the CExtPopupMenuWnd::g_nMsgPopupDrawItem registered message.