Help: Problem with floating toolbar
Prakash N -- pran@wings.xko.dec.com
Wednesday, August 21, 1996
Environment: MSVC 4.0, Win 95
Hello!
I have a strange problem. I have a floating toolbar whose layout is =
fixed to two columns. This floating toolbar's size is also fixed. It is =
getting created properly. But whenever I click on some other button in =
the toolbar, or try to move it by holding the titlebar, it resizes =
itself to the default, i.e., single horizontal row. I am creating the =
toolbar by using a large bitmap and cutting the bitmap into equal pieces =
for the individual bitmaps for the toobar buttons. For this purpose, I =
am using a derived class from CToolBar. I use the following code to =
create the toolbar:
BOOL CMainFrame::CreatePalette() {
... ... ...
... ... ...
if (!myToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_SIZE_FIXED=20
| CBRS_TOP, CBRS_TOOLTIPS) || !myToolBar.LoadBitmap(MY_BITMAP_ID)=20
|| !myToolBar.SetButtons(myPalette, sizeof(myPalette) / sizeof(UINT)))
{
return FALSE;
}
... ... ...
return TRUE;
}
Here, myPalette is a static array of UINTs which contain the individual =
ids of the bitmaps of the toolbar.
What is the cause and what could be the solution? Somebody .. ?
Cheers,
Prakash N
DEC, India.
pran@wings.xko.dec.com
Mike Blaszczak -- mikeblas@nwlink.com
Monday, August 26, 1996
At 06:01 PM 8/21/96 +-5-30, you wrote:
>Environment: MSVC 4.0, Win 95
>I have a strange problem. I have a floating toolbar whose layout is fixed
to two columns.
How did you set it to two columns?
> This floating toolbar's size is also fixed. It is getting created properly.
> But whenever I click on some other button in the toolbar, or try to move
> it by holding the titlebar, it resizes itself to the default,
> i.e., single horizontal row.
Did you set the m_nColumns member to 2?
> I am creating the toolbar by using a large bitmap and cutting the bitmap
> into equal pieces for the individual bitmaps for the toobar buttons.
You're chopping up the bitmap yourself? Why?
> For this purpose, I am using a derived class from CToolBar.
> I use the following code to create the toolbar:
I'm not sure I see anything here that causes the tollbar to be split
into two columns.
Have you tried looking at the CTRLBARS sample? It makes a toolbar
show up with two columns, and it does just fine.
.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
| Вернуться в корень Архива
|