Print Page | Close Window

Adding dynamic Toolbars...

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=22800
Printed Date: 24 November 2024 at 12:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Adding dynamic Toolbars...
Posted By: guiuser1
Subject: Adding dynamic Toolbars...
Date Posted: 25 November 2015 at 2:52pm
I'm a bit stuck in how to add toolbars dynamically for a MDI application.
Depending on the settings, we optionally want to display a new toolbar...

We are so far a bit puzzled about how to go about this.

Any pointers?



Replies:
Posted By: guiuser1
Date Posted: 25 November 2015 at 5:34pm
Found a solution but not sure this is the expected one.
We create a optional toolbar in the CMainFrame::OnCreate like normal,
set the toolbar to be non-visible: pToolBar->SetVisible(FALSE);
Then when a document is loaded, and with the proper settings in place, we force that toolbar to be visible by call pToolBar->SetVisible(TRUE);

As a side affect (I believe this is a bug), when saving and restoring the toolbars via the CXTPPropExchangeXMLNode, the toolbar becomes visible all the time, when the app is reloaded.  To fix that we had to put an additional call to pToolBar->SetVisible(FALSE); at the end of CMainFrame::ExchangeLayout(..)

It works but seems a bit untidy...
Suggestions?



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