Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - where and when set toolbars right pos
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

where and when set toolbars right pos

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


Joined: 04 January 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote nettel Quote  Post ReplyReply Direct Link To This Post Topic: where and when set toolbars right pos
    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
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.141 seconds.