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 » CExtTabWnd PopUp menu Collapse All
Subject Author Date
Roberto Manes May 24, 2005 - 7:10 AM

How can I get the messages coming from the CExtTabWnd PopUp menu created runtime in the OnTabWndClickedButton() method ? I would undestand when the focus changes between the menu items while moving the cursor. Thanks in advance for your help.


 

Technical Support May 24, 2005 - 1:28 PM

You cannot receive any message from the tab control’s popup menu because it does not send any message at all. Here is a code snippet from CExtTabWnd::OnTabWndClickedButton() that can be found in the ExtTabWnd.cpp file:

    if( pPopup->TrackPopupMenu(
            TPMX_OWNERDRAW_FIXED
                | nAlign
                | TPMX_COMBINE_DEFAULT
                | TPMX_DO_MESSAGE_LOOP
                | TPMX_NO_WM_COMMAND
                | TPMX_NO_CMD_UI
                | TPMX_NO_HIDE_RARELY,
            ptTrack.x, 
            ptTrack.y,
            &rcExcludeArea,
            NULL,
            _CbPaintCombinedTabListBtnContent,
            &nCmdRetVal
            )
        )
    {
This code is tracking a pop-up menu when the menu button is clicked and, as you can see, the flags enforce the pop-up menu do not return back until the menu is tracked, do not invoke MFC’s command updating mechanism and do not send any WM_COMMAND message when an items is clicked. This is similar the behavior of the list box dropped down by the combo box control. The selection identifier is simply returned and analyzed. So, if you need some custom menu in the tab window, you should use your own CExtTabWnd-derived class and override the CExtTabWnd::OnTabWndClickedButton() virtual method in which you should analyze tab buttons, construct and track your own pop-up menu and, finally, implement any actions specific for your tab control. Please let us know the details of you task and we will help you with advice or a ready-to-use solution.

In addition, tracking the menu item selection is a new feature that appeared in Prof-UIS 2.31 (available for registered library users) and demonstrated in the HelpNotes sample.

Roberto Manes May 25, 2005 - 3:07 AM

I will have a look at the HelpNotes sample. Thanks