lock toolbar position after docking
-
You have 2 options: 1. Implement state persistence - in CMainFrame::OnCreate() call LoadBarState(), and in OnClose() or DestroyWindow() call SaveBarState(). You have to make sure the toolbars have different IDs. (see the toolbars & docking windows section for related info). 2. Derive your own classes from CToolbar or whatever, and block WM_LBUTTONDOWN and WM_LBUTTONDBLCLK (handle the messages and do nothing in the handlers' implementations). The drawback is thath the user will no longer able to drag the toolbars around, nor to float them, but you can control them programmatically (using CFrameWnd's ShowControlBar(), DockControlBar(), FloatControlBar(), etc.). Another problem of this approach is that the bars will be arranged on different rows if the user resizes the main window in a way the second toolbar is completely invisible. Personally, I preffer (1). Cristi ================== The original message was: how do i lock the position of two toolbars after docking them side by side?
-
The whole point of Dockable toolbars is so that they can be moved. The best thing to do is not to lock them. I can't see any reason why it would ultimately benefit the user in the end. Users like to be able to arrange things any way they want.