Kelly
September 21st, 1999, 04:22 PM
hey all,
I'm creating a simple CToolBar which loads a 256 color bitmap for the button images. I used the SetSizes() method to reduce the size of the images to 12x12 and the buttons to 19x20. On calling DockControlBar, the bar pops up there and looks normal except that there is an undesired border surrounding it that I can't seem to get rid of, and when moved around the pixels in the border start making a small mess. By this i mean that the 2-pixel thick border seems to grab pixel values from other locations on update, alternating seemingly randomly here and there between light and dark grey which are the default system colors on this machine. Also, strangely if I coverup the toolbar by another application and then switch back to my app, the pixels in this "border" space are not updated and contian pixel data from the app which I covered it with.
Perhaps if I can get rid of the border altogether, this would work itself out, but can't seem to make it go away. Here is a snippet of the toolbar creation code I am using:
CToolBar m_StripColors;
CRect rcBorders = CRect(0,0,0,0);
SIZE bsize, isize;
CMainFrame* pMainFrame = (CMainFrame *)theApp.m_pMainWnd;
if (!m_StripColors.CreateEx((CWnd *)theApp.m_pMainWnd,
TBSTYLE_FLAT,
WS_CHILD | WS_VISIBLE | CBRS_ALIGN_ANY | CBRS_TOOLTIPS | CBRS_GRIPPER,
rcBorders,
IDW_STRIPCOLS) ||
!m_StripColors.LoadBitmap(IDB_SMK) ||
!m_StripColors.SetButtons(smks, sizeof(smks)/sizeof(UINT))) {
TRACE0("Failed to create strip color bar\n");
return;
}
bsize.cx = 19;
bsize.cy = 20;
isize.cx = 12;
isize.cy = 12;
m_StripColors.SetSizes(bsize, isize);
anything outrageous? Any tips appreciated..
--Kelly
I'm creating a simple CToolBar which loads a 256 color bitmap for the button images. I used the SetSizes() method to reduce the size of the images to 12x12 and the buttons to 19x20. On calling DockControlBar, the bar pops up there and looks normal except that there is an undesired border surrounding it that I can't seem to get rid of, and when moved around the pixels in the border start making a small mess. By this i mean that the 2-pixel thick border seems to grab pixel values from other locations on update, alternating seemingly randomly here and there between light and dark grey which are the default system colors on this machine. Also, strangely if I coverup the toolbar by another application and then switch back to my app, the pixels in this "border" space are not updated and contian pixel data from the app which I covered it with.
Perhaps if I can get rid of the border altogether, this would work itself out, but can't seem to make it go away. Here is a snippet of the toolbar creation code I am using:
CToolBar m_StripColors;
CRect rcBorders = CRect(0,0,0,0);
SIZE bsize, isize;
CMainFrame* pMainFrame = (CMainFrame *)theApp.m_pMainWnd;
if (!m_StripColors.CreateEx((CWnd *)theApp.m_pMainWnd,
TBSTYLE_FLAT,
WS_CHILD | WS_VISIBLE | CBRS_ALIGN_ANY | CBRS_TOOLTIPS | CBRS_GRIPPER,
rcBorders,
IDW_STRIPCOLS) ||
!m_StripColors.LoadBitmap(IDB_SMK) ||
!m_StripColors.SetButtons(smks, sizeof(smks)/sizeof(UINT))) {
TRACE0("Failed to create strip color bar\n");
return;
}
bsize.cx = 19;
bsize.cy = 20;
isize.cx = 12;
isize.cy = 12;
m_StripColors.SetSizes(bsize, isize);
anything outrageous? Any tips appreciated..
--Kelly