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 » CExtToolControlBar: Chevron button / context menu Collapse All
Subject Author Date
Takis Takoglou Nov 6, 2009 - 3:45 AM

Good day,


I am trying to understand the basic functionality of the above feature.

Could you please clarify what items are displayed by default in the context menu of the CExtToolControlBars ?

From your samples, i presume all toolbars are added in this context menu, but i’m not sure.

If i want to add/remove another item in that menu what must i do?


I have been given an old project which has the following bug:

The project contains several control bars given each a name when created: "Main0" , "Main1", "2D","3D",...etc.

When the context menu appears, it has 13 times the same thing : "Main0". Clicking on any of these produces no noticable effect (i.e. none of the control bars becomes hidden/unhidden).


 


Any guidance in the above matters would be most useful.

Thanx in advance.


 

Technical Support Nov 6, 2009 - 10:13 AM

All the control bars inside the frame window must have unique identifiers. This is related both to MFC and Prof-UIS control bars. You should add the main frame message map entries for each control bar. Here is the example of how it looks like in the DRAWCLI sample application:

   ON_COMMAND_EX(ID_VIEW_TOOLBAR2, OnBarCheck )
            ON_UPDATE_COMMAND_UI(ID_VIEW_TOOLBAR2, OnUpdateControlBarMenu)

            ON_COMMAND_EX(ID_VIEW_PALETTE, OnBarCheck )
            ON_UPDATE_COMMAND_UI(ID_VIEW_PALETTE, OnUpdateControlBarMenu)

            ON_COMMAND_EX(ID_VIEW_UI_LOOK_BAR, OnBarCheck )
            ON_UPDATE_COMMAND_UI(ID_VIEW_UI_LOOK_BAR, OnUpdateControlBarMenu)

The OnBarCheck() and OnUpdateControlBarMenu() methods are provided by the MFC’s CFrameWnd class. The work well with Prof-UIS toolbar, menu bar, panel bars and resizable control bars without auto-hiding feature enabled. If you are using resizable control bars with auto-hiding feature, then you should re-define the OnBarCheck() and OnUpdateControlBarMenu() methods in your main frame class:
 void CMainFrame::OnUpdateControlBarMenu( CCmdUI * pCmdUI )
{
            CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, false );
}

BOOL CMainFrame::OnBarCheck( UINT nID )
{
            Return CExtControlBar::DoFrameBarCheckCmd( this, nID, false );
}

Takis Takoglou Nov 6, 2009 - 5:11 AM

Some things i found that were wrong:


Every time a toolbar was created,  AFX_IDW_TOOLBAR was supplied as the third argument. I replaced all AFX_IDW_TOOLBAR with some newly defined ones IDW_TOOLBAR_1 ,2, 3 etc.


When i invoke the context menu the names are displayed correctly, but they are all greyed out and i cannot select them! 

What is the problem?