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 separator length Collapse All
Subject Author Date
Dirk lindner Oct 20, 2008 - 3:07 AM

Hello,

i have a problem width the CExtPopupMenuWnd.

if i use the following code:

    CExtPopupMenuWnd* pPopup = new CExtPopupMenuWnd;
    pPopup->CreatePopupMenu(GetSafeHwnd());

    VERIFY(
        pPopup->UpdateFromMenu(
        GetSafeHwnd(),
        pMenu,
        false,
        true,
        true
        )
        );

    POINT p;
    VERIFY(GetCursorPos(&p));
    VERIFY(
        pPopup->TrackPopupMenu(
        TPMX_SELECT_ANY,
        p.x,
        p.y
        )
        );

It looks like.


My problem is the "separator width"
I use the code within a CExtNCSB <CListCtrl>.

CPrfMenuBar displayed the separators correctly:

.

Any Idea ?

Greets Dirk Lindner


Dirk lindner Oct 24, 2008 - 1:36 AM

Thank you very much.

Dirk Lindner

Technical Support Oct 20, 2008 - 12:55 PM

Please provide us with more details:

1) Which Prof-UIS paint manager is used?

2) Which Windows desktop theme is used?

3) Whether any custom desktop DPI is set?

4) Whether any custom painting handler methods are implemented for your menus?

5) Whether any dynamic popup menu initialization handler methods are implement for your menus?

6) Whether your code occasionally changed widths of the menu’s left area via invocation of its SetLeftAreaWidth() method?

7) Whether the problem can be seen in the first level menu only?



Dirk lindner Oct 23, 2008 - 3:29 AM

I located the problem:

LRESULT CMainFrame::OnExtMenuPrepare( WPARAM wParam, LPARAM lParam ){

    CExtPopupMenuWnd * pPopup;
    CExtPopupMenuWnd::MsgPrepareMenuData_t * pData;
    if(wParam){
    pData =
            reinterpret_cast<CExtPopupMenuWnd::MsgPrepareMenuData_t *>(wParam );

        ASSERT( pData != NULL );

        pPopup = pData->m_pPopup;

        ASSERT( pPopup != NULL );
    }else{
        pPopup = (CExtPopupMenuWnd *)lParam;
    }

    if(!pPopup)
        return false;

    for(int i = 0;i < pPopup->ItemGetCount(); i++){

        if(pPopup->ItemGetPopup(i)){
//This produce my problem
                pPopup->ItemSetPopupText(
                i,
                pPopup->ItemGetText(i)//normally I translate the text here.
                );
            OnExtMenuPrepare( 0, (LPARAM)pPopup->ItemGetPopup(i) );
        }else{
            pPopup->ItemSetPopupText(
                i,
                pPopup->ItemGetText(i)//normally i translate the text here.
            );
        }
    }
    return TRUE;
}



1) Which Prof-UIS paint manager is used?

    CExtPaintManagerOffice2007_R1

2) Which Windows desktop theme is used?
    native windows classic, but it also appears if xp style is enabled.

3) Whether any custom desktop DPI is set?
    No

4) Whether any custom painting handler methods are implemented for your menus?
    No

5) Whether any dynamic popup menu initialisation handler methods are implement for your menus?
    No

6) Whether your code occasionally changed widths of the menu’s left area via invocation of its SetLeftAreaWidth() method?
    pPopup->SetLeftAreaWidth(30);
    looks like




7) Whether the problem can be seen in the first level menu only?

    No




Technical Support Oct 23, 2008 - 2:17 PM

If your code if the CMainFrame::OnExtMenuPrepare() handler method modifies a popup menu, then it should set the pData->m_bMenuChanged flag to true. This will let the popup menu know that the menu layout should be completely recomputed.