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::TrackPopupMenu Can Lockup Application UI Collapse All
Subject Author Date
David Baginski Feb 6, 2008 - 3:55 PM

I have a customer that discovered he can lock himself out of the UI of our application using the following procedure:

1. Right click inside of a window with a context menu that contains sub menu items (I used a CView)
2. Left click on a sub menu item (SubItem 1) and drag the mouse off of the menu before releasing the left mouse button.

What happens is the sub menu will disappear but the main popup menu will still be visible. However, this menu will not be functional and the UI will not respond to any other input. The only way I found to clear it is to click into another application window and then back to my application. This causes the context menu to end.

I have reproduced this behavior in 2.82 and 2.53 using a minimal application. Here is my code that simulates a the context menu:

void CPopupMenuTestView::OnContextMenu(CWnd* /*pWnd*/, CPoint point)
{
    /* Create Popup Menu
    Item 1
        Subitem 1
        Subitem 2
    */
    CExtPopupMenuWnd * pMenu = new CExtPopupMenuWnd;

    CExtPopupMenuWnd * pSubMenu1 = new CExtPopupMenuWnd;
    pSubMenu1->CreatePopupMenu(GetSafeHwnd());
    pSubMenu1->ItemInsert(ID_TEST_SUBITEM1);
    pSubMenu1->ItemInsert(ID_TEST_SUBITEM2);

    pMenu->CreatePopupMenu(GetSafeHwnd());
    pMenu->ItemInsertSpecPopup(pSubMenu1, -1, "Item 1");
    
    //pMenu->LoadMenu(NULL, IDR_POPUP_TEST);

    pMenu->TrackPopupMenu(
        0,
        point.x,
        point.y);
}

Technical Support Feb 13, 2008 - 9:25 AM

We are sorry for this inconvenience. If you have a valid subscription, you can download the latest stable source code, profuis283(2008-02-11).zip, from our ftp site.

David Baginski Feb 11, 2008 - 1:02 PM

I can’t rebuild ProfUIS with your new source files because of the following errors:

..\Src\ExtPopupMenuWnd.cpp(4655) : error C2039: ’Construct’ : is not a member of ’CExtPopupDatePickerMenuWnd’
c:\Program Files\FOSS Software Inc\Prof-UIS\Include\ExtPopupCtrlMenu.h(1162) : see declaration of ’CExtPopupDatePickerMenuWnd’
..\Src\ExtPopupMenuWnd.cpp(14543) : error C2039: ’stat_DoDragDetect’ : is not a member of ’CExtControlBar’
c:\Program Files\FOSS Software Inc\Prof-UIS\Include\ExtControlBar.h(719) : see declaration of ’CExtControlBar’
..\Src\ExtPopupMenuWnd.cpp(14543) : error C3861: ’stat_DoDragDetect’: identifier not found

If this is easy to resolve great otherwise I can wait for the next release. Thanks you for taking care of this issue.

Technical Support Feb 11, 2008 - 7:39 AM

Thank you for reporting this issue. We fixed it and here is the update (../Prof-UIS/Include/ExtPopupMenuWnd.h and ../Prof-UIS/Src/ExtPopupMenuWnd.cpp):

UpdatedPopupMenu.zip

Technical Support Feb 9, 2008 - 1:15 AM

We tried to reproduce this problem using the DRAWCLI sample but failed. We run it, painted some shape, switched to the pointer/selection mode and invoked a context menu over the just drawn shape. We tried different mouse click combinations but the context menu always worked correctly.

David Baginski Feb 9, 2008 - 9:53 AM

OK. Please try this:

1. Build DRAWCLI using the profuis282md.dll (mbcs, MFC DLL, profuis DLL)
2. Run DRAWCLI and draw a rectangle
3. Right click inside the new rectangle for the context menu
4. Select "Line Width" then left click on "2"
5. Without releasing the left mouse button, drag the mouse to the right, off of 2 somewhere over the MDI child client area (away from the context menu)
6. Release the left mouse button

What you should see happen is that the Line Width submenu will disappear but the parent context menu will remain on the screen. There is no way to terminate this menu without switching to a different application and then back.

Please try to reproduce this again. Thank you.