Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to change toolbars at runtime
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change toolbars at runtime

 Post Reply Post Reply
Author
Message
Luigi View Drop Down
Newbie
Newbie
Avatar

Joined: 28 July 2008
Location: Italy
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Luigi Quote  Post ReplyReply Direct Link To This Post Topic: How to change toolbars at runtime
    Posted: 28 July 2008 at 1:04pm
Hi,
I'm porting my application to XTP and I've a problem. My application has a "explorer-like" layout with a tree on the left part and a view on the right.

There exists three types (read classess) of view and each one is bound to a specific menu and toolbar layout.

The first part about the menu exchange was easy to port, with the following code:
CXTPCommandBars* pCommandBars = pFrameWnd->GetCommandBars();
CXTPMenuBar    *pMenuBar = pCommandBars->GetMenuBar();
pMenuBar->LoadMenu( &menu);

where menu is the CMenu object with the menu associated to the view.

For the second part, I'd like to share toolbars definitions among the views and let the user to customize the toolbar contents and number in a per application basis and toolbar visibility in a per view basis.

For example, if I have two toolbars, in the view type 1 the user could see them both, in view type 2 he could see only the first and in view type 3 he could see only the second.

I don't konw how to proceed. Help me.
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: 29 July 2008 at 1:39am
Hi,
 
Create all 3 toobars, but hide and show them when you switch views.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.