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 » CExtPropertyGridCtrl popup menu override Collapse All
Subject Author Date
Nathan Explosions Jun 7, 2007 - 2:58 AM

Greetings.

When user clicks the CExtPropertyCategory item, I modify the CExtPropertyGridCtrl popup menu in the ::OnPgcContextMenuReconstruct() method:


    bool CMyExtPropertyGridCtrl::OnPgcContextMenuReconstruct(CExtPopupMenuWnd *pPopup, CWnd *pWndHit, CPoint ptScreen, CExtGridHitTestInfo *pHtInfo, CExtPropertyItem *pPropertyItem, CExtPropertyGridWnd *pPGW)
    {
        if (pPropertyItem && pPropertyItem->IsKindOf(RUNTIME_CLASS(CExtComponentPropertyCategory)))
        {
            pPopup->ItemRemove();
            pPopup->LoadMenu(GetSafeHwnd(), IDR_PROPERTY_CATEGORY_MENU, false, true);
            pPopup->ItemEnabledSet(0);
            pPopup->ItemSetDisplayed(0);

            return true;
        }

        return CExtPPVW<CExtPropertyGridCtrl>::OnPgcContextMenuReconstruct(pPopup, pWndHit, ptScreen, pHtInfo, pPropertyItem, pPGW);
    }


It works, but since I am working with the trial version of Prof-UIS library at the moment and thus can’t take a look at the CExtPropertyGridCtrl implementation, I can’t understand how and where to catch the click event on the reconstructed menu item...

Please tell me, what should I do?

Thank you.

Nathan Explosions Jun 7, 2007 - 10:52 PM

Silly me... Thank you!

Technical Support Jun 7, 2007 - 10:45 AM

You have invoked the following code:

pPopup->LoadMenu( GetSafeHwnd(), IDR_PROPERTY_CATEGORY_MENU, false, true );
The popup menu will send WM_COMMAND messages to the window handle you have specified.