Toolbar with two columns how
-
i would like to create a toolbar which is docked to the left side of the SDI window but which has two column instead of one which is the default. What i already know is: 1. Derive a class from toolbar 2. Include a handler for WM_SIZEPARENT, which is MFC's private message. 3. Overwrite the virtual functions CalcDyanamicLayout and CalcFixedLayout in my derived class. 4. Write code in CalcDynamicLayout and CalcFixedlayout to set the flags of each button in the toolbar. 5. Use my derived Toolbar to replece the original toolbar. I need help in 3 and 4 especially 4. I am also getting some kind of error when i close my application. Anyone who can help me out would be great. If you have better idea, please advise so. Mark
-
i would like to create a toolbar which is docked to the left side of the SDI window but which has two column instead of one which is the default. What i already know is: 1. Derive a class from toolbar 2. Include a handler for WM_SIZEPARENT, which is MFC's private message. 3. Overwrite the virtual functions CalcDyanamicLayout and CalcFixedLayout in my derived class. 4. Write code in CalcDynamicLayout and CalcFixedlayout to set the flags of each button in the toolbar. 5. Use my derived Toolbar to replece the original toolbar. I need help in 3 and 4 especially 4. I am also getting some kind of error when i close my application. Anyone who can help me out would be great. If you have better idea, please advise so. Mark
You shouldn't need step 2. I personally use a CControlBar with CToolbars embedded (members of the control bar). Here's 3 reasons why... In the CControlBar class Calc____Layout() override(s) I can return a CSize that has the appropriate dimensions to fill a side of the parent frame window. In the CControlBar class Calc____Layout() override(s) I can resize the embedded toolbar(s) to force it to wrap the rows/columns of buttons into multiple rows or columns (depending on orientation). With CControlBa, it's easy to mix toolbars and any other windows/controls and wrap them all nicely in one bar docked to the frame. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You shouldn't need step 2. I personally use a CControlBar with CToolbars embedded (members of the control bar). Here's 3 reasons why... In the CControlBar class Calc____Layout() override(s) I can return a CSize that has the appropriate dimensions to fill a side of the parent frame window. In the CControlBar class Calc____Layout() override(s) I can resize the embedded toolbar(s) to force it to wrap the rows/columns of buttons into multiple rows or columns (depending on orientation). With CControlBa, it's easy to mix toolbars and any other windows/controls and wrap them all nicely in one bar docked to the frame. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
I got your idea. But i am not sure if i can not do it the way i am doing it. That is derive my class directly from CToolBar. I think you are saying that derive my class from CControlBar, which has CMyToolBar class embedded in it which is more flexible. I would need CControlBar the way you described it as an option bar in my application which will be horizonal. My vertical bar needs not to be moved and will be fixed. Depening on which button you press in ver bar, the right option bar should show. It is more like adobe photoshop type application that i am trying to develop. You said i do not need step 2. That is using WM_SIZEPARENT. Is that what you really meant. Please explain a little. And thanks for the help. Mark