Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - how to set toolbar associate with menu item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to set toolbar associate with menu item

 Post Reply Post Reply
Author
Message
Pearl View Drop Down
Newbie
Newbie


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post Topic: how to set toolbar associate with menu item
    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
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Pearl View Drop Down
Newbie
Newbie


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.