Re: How to merge toolbars?
Open these toolbars in the resource editor, drag-n-drop (copy) buttons from one to another.
Then you should hide/show these buttons depending on the current View (use CToolbarCtrl::HideButton method to do it).
Re: How to merge toolbars?
Thank you Victor for your answer, but this is not an option. Or let’s say it’s not an elegant one. You must imagine a lot of toolbar buttons for each file type (many types not only picture and music). It will be very difficult to manage such a big toolbar. I want to handle this separately. Also I could handle all of them as separate very small toolbars and put them together, but I look for a method to this (merging/insert NOT disabling) at the runtime.
Ciao,
Emil
Re: How to merge toolbars?
1. There is no problem to show any number of the toolbars sowing/hiding some of their buttons.
2. There is no function for "merging" toolbars. You however can add/insert any new buttons to any of your toolbars. Have a look at:
CToolBarCtrl::GetButton
CToolBarCtrl::AddButtons
CToolBarCtrl::InsertButton
CToolBarCtrl::AddBitmap
CToolBarCtrl::AddStrings
CToolBarCtrl::AddString