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 » Can't get one of my toolbars to bet accessible from the show/hide popup Collapse All
Subject Author Date
Harvey Cohen Mar 13, 2005 - 12:33 AM

Hello,

I am evaluating Prof-UIS for commerical use. My application has two toolbars that I converted to CExtControlToolBars per what passes for documentation.

The toolbars work. The various buttons on the tool bar activate and deactivate as required, and I can control whether the toolbars are visible using the MFC standard ShowControlBar when called from the "View" menu.

The problem is this:

My main toolbar (IDR_MAINFRAME) can be controlled via the "Show/Hide" pop-up found in the lower right corner of the CExtControlToolBar instances. My other toolbar is listed there as well, but is consistently greyed out DESPITE the fact that the toolbar is active.

I inserted the following commands into the CMainFrame message map per the documentation:

ON_COMMAND_EX (ID_VIEW_PROJECTTOOLBAR,    OnBarCheck )
ON_UPDATE_COMMAND_UI (ID_VIEW_PROJECTTOOLBAR,    OnUpdateControlBarMenu)

Technical Support Mar 13, 2005 - 10:08 AM

It seems you have created your toolbars absolutely correctly. So, we may guess your source code has some typo and that is why the show/hide command does not work well. We would like to ask you to check everything relating to your second toolbar step by step:

  1. You created your second toolbar using the following code:
    if(    (! m_wndToolBarSecond.Create(
                    _T("My Second Toolbar"),
                    this,
                    ID_VIEW_PROJECTTOOLBAR
                ) )
            || (! m_wndToolBarSecond.LoadToolBar(
                    IDR_SECOND_TOOLBAR_RESOURCE
                ) )
            )
        {
            ASSERT( FALSE );
            return -1;
        }
  2. The menu resource for you frame is specified with ID_VIEW_PROJECTTOOLBAR resource and you updated the command manager:
    VERIFY(
            g_CmdManager->UpdateFromMenu(
                command_profile_name,
                IDR_MAINFRAME
                )
            );
        // and in MDI case
        VERIFY(
            g_CmdManager->UpdateFromMenu(
                command_profile_name,
                IDR_YOUR_DOCUMENT_TYPE
                )
            );
  3. Please take a look at the resource.h file in your project and check whether show/hide commands for all toolbars like ID_VIEW_PROJECTTOOLBAR have unique identifiers.
You may note that most of the samples provided with Prof-UIS have at least two toolbars: the main toolbar and second toolbar that often contains the commands relating to theme toggling. So, you can compare your source code with samples like SDI, MDI, SDIDOCVIEW, and MDIDOCVIEW. Of course, you can send us your source code and we will help you.