Docking CControlBar derived classes in a CFrameWnd
Posted on 2004-11-09
I want to be able to dock 2 CControlbar dervied objects on the same side of a CFrameWnd in an SDI application forcing them to always stack on top of each other and never go side by side in the same area of the frame. Or to be more specifc if the user drags one of these controlbars to the same side of the frame(lets say left) that the other one already exists on I NEVER want it to dock to the left or right of that control bar, but always above or below it (but still on the left side of the frame).
Which of course leads me into the next problem of resizing each control bar appropriately depending on how much space they can occupy on the frames docking bar.
I have tried to search for a message that will notify me when a control bar is docked to the frame so I could make any necessary adjustments there, thinking that if I find out I have just docked 1 control bar on the same side where another one exists then I can simply recall DockControlBar on that one to force it above or below the existing one since the default behavior does not stick them side by side.
I have tried changing the CalcFixedLayout and CalcDynamicLayout functions of my control bar thinking I could change the rect in which it draws, but I have not succeeded.