I would change the definition of the LoadToolBar method by adding two input parameters:
BOOL CTextToolBar::LoadToolBar(LPCTSTR lpszResourceName, int imageCxSize, int imageCySize)
where the two additional parameters mean the size of the image in the button. further SetSizes should be changed into:
This allows to fit the toolbar to the particular image size used(when you create the toolbar buttons the sizes (found in View->Properties) may differ from user to user).
Also, if you have more toolbars of different sizes this allow to display all of them correctly.
Like IE 6.0, I want to combine buttons with bitmap and text and just plain bitmap toolbar buttons on the same row (the text should appear next to the bitmap, not beneath it).
The problem is that when I set the text for one button, it seems that it's set for all of them (at least the space for the text is allocated).
I just somehow want to adjust the size of each button.
Does anybody know a nice way of how to handle this?
There's a bug in the Cmnctr32 code, I think. If you set the text of any of the buttons, and then set one of
the buttons to NULL, none of the buttons will have text displayed, even though they are adjusted to the
correct size. You can do this blatantly:
or not so blatantly:
// Never initialize 'buttontext', assuming an empty
// string is a safe default
// buttontext.c_str() returns (char*)0x00000000 here!
Either way I believe you don't get any text, at least with the common control DLL that I'm using from VC6
and IE4.01 sp1.