Link to home
Start Free TrialLog in
Avatar of JRVision2
JRVision2

asked on

Docking CControlBar derived classes in a CFrameWnd

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.
ASKER CERTIFIED SOLUTION
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRVision2
JRVision2

ASKER

Thanks guys, I've seen the sizecbar and been to the datamekanix web site before.  I'd like to avoid using any 3rd party toolkits or other subclasses.  Plus it bothers me there isn't a good way using just MFC.  I tried plugging in the sizecbar stuff and even it docks side by side sometimes when I don't want it to.