Print Page | Close Window

How to change toolbars at runtime

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=11622
Printed Date: 28 February 2025 at 9:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change toolbars at runtime
Posted By: Luigi
Subject: How to change toolbars at runtime
Date 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.



Replies:
Posted By: Oleg
Date 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



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