|
-
May 24th, 2007, 03:20 AM
#1
How to merge toolbars?
Hi all,
I have a „Multiple top-level documents“ application, which should show different file types: pictures, music, etc. Now I have a common tool bar with action available for all file types like “open”, “about” and some other toolbars, depending on what kind of files I open, something like:
IDR_MAINFRAME TOOLBAR 16, 15
BEGIN
BUTTON ID_FILE_OPEN
BUTTON ID_APP_ABOUT
END
IDR_PICTURE_TOOLBAR TOOLBAR 16, 15
BEGIN
BUTTON ID_ROTATE_PICTURE
BUTTON ID_ZOOM_PICTURE
BUTTON ID_BLA_PICTURE
END
IDR_MUSIC_TOOLBAR TOOLBAR 16, 15
BEGIN
BUTTON ID_STOP
BUTTON ID_PREVIOUS
BUTTON ID_PLAY
BUTTON ID_NEXT
END
Now I want to merge some of them, better say I want to insert one between 2 special buttons (in this case between open and about), so if I open a picture file I want to have a result like:
IDR_PICTURE_RES_TOOLBAR TOOLBAR 16, 15
BEGIN
BUTTON ID_FILE_OPEN
SEPARATOR
BUTTON ID_ROTATE_PICTURE
BUTTON ID_ZOOM_PICTURE
BUTTON ID_BLA_PICTURE
SEPARATOR
BUTTON ID_APP_ABOUT
END
Or a music file:
IDR_MUSIC_TOOLBAR TOOLBAR 16, 15
BEGIN
BUTTON ID_FILE_OPEN
SEPARATOR
BUTTON ID_STOP
BUTTON ID_PREVIOUS
BUTTON ID_PLAY
BUTTON ID_NEXT
SEPARATOR
BUTTON ID_APP_ABOUT
END
Knows somebody if this is possible or not? Maybe knows somebody a good sample? Thank you in advance!
Best regards,
Emil
-
May 24th, 2007, 04:00 AM
#2
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).
-
May 24th, 2007, 04:17 AM
#3
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
-
May 24th, 2007, 04:35 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|