Print Page | Close Window

how to set toolbar associate with menu item

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8074
Printed Date: 06 October 2024 at 4:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to set toolbar associate with menu item
Posted By: Pearl
Subject: how to set toolbar associate with menu item
Date Posted: 18 September 2007 at 8:12pm
Hi
 
In my old MFC application, I have some code to associate the toolbars with menu items, which means, once you click the corresponding menu item, the associate toolbar will display or disappear. It's so strange, when I reskin my first MFC application, and add some CXTPToolbar, it do automatically add corresponding menu items in View Menu. But for the second application I am doing, it never works. Please help me.
 
Thanks in advance
 
Pearl
 



Replies:
Posted By: Oleg
Date Posted: 19 September 2007 at 4:54am
Hi,
 
Just add item with standard ID_VIEW_TOOLBAR id, CommandBars will automatically build list of toolbars.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Pearl
Date Posted: 19 September 2007 at 11:32am
Hi, I got a little bit confused. I add toolbar like this way:
 
m_wndExpressBar = (CXTPToolBar*)
        pCommandBars->Add(_T("Express"), xtpBarTop);
    if (!m_wndExpressBar || !m_wndExpressBar->LoadToolBar(IDR_EXPRESSTOOLS))
    {
        TRACE0("Failed to create express toolbar\n");
        return -1;
    }
 
IDR_EXPRESSTOOLS is resourceID for toolbar. And there is a menu resource ID - IDW_EXPRESSTOOLS which will accociate with IDR_EXPRESSTOOLS. Where I can put IDW_EXPRESSTOOLS when I add toolbar.
 
Thanks



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net