Print Page | Close Window

where and when set toolbars right pos

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=1666
Printed Date: 18 May 2024 at 10:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: where and when set toolbars right pos
Posted By: nettel
Subject: where and when set toolbars right pos
Date Posted: 13 January 2005 at 5:30am
I have a problem with my toolbars in a MDIapplication.

Like I posted in an other thread, I want to hide/show toolbars dynamic. The problem of using the hide/show commands for the toolbar is, that they allways shown in CustomizeDlg for the bars. I solve this problem by remove and add the toolbar in ToolbarList of CommandBarsObject. It's work. But then there come the next problem.
To save the state, position, etc. for customizing I use local varibles. That means, in one way (hide) save the old status and in the other (show) read the status from the variables. Thats OK. I run this procedure when the MDIChildWnd activate. So, if the user change the active document, the toolbar shows/hide in order of the active document.
When I close the application, I have to save the old status of the toolbar. In that way, I make the toolbar visible and use the SaveCommandBars(...) function for all my toolbars. Next time I open the application the toolbar will be loaded by the LoadCommandBars(..) function. Thats right.
And now the problem:
The application fired the WM_Activate Message, my handler in CMDIChildWnd get it and try, for instance, to hide the toolbar. In that way, the toolbar hasn't the right position in the DockingBar. So the my variables get the wrong values and next time I show the toolbar, it appears somewhere in the DockingBar. If the toolbar has to be visible at start of the application, there is no problem. The bar is drawing at the right place.
So I think, the problem is to calculate the placement of the toolbar before the bar will be removed from the CommandBarList. Is it possible to do that under my control??

Have a nice day

Bernd



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