m_hBitmap = 0;
}
- if ( m_disabledImgList )
- {
- delete m_disabledImgList;
- m_disabledImgList = NULL;
- }
+ wxDELETE(m_disabledImgList);
Realize();
}
void wxToolBar::CreateDisabledImageList()
{
- if (m_disabledImgList != NULL)
- {
- delete m_disabledImgList;
- m_disabledImgList = NULL;
- }
+ wxDELETE(m_disabledImgList);
// as we can't use disabled image list with older versions of comctl32.dll,
// don't even bother creating it
wxBitmap bmpDisabled = tool->GetDisabledBitmap();
if ( bmpDisabled.Ok() )
{
+ const wxSize sizeBitmap = bmpDisabled.GetSize();
m_disabledImgList = new wxImageList
(
- m_defaultWidth,
- m_defaultHeight,
+ sizeBitmap.x,
+ sizeBitmap.y,
bmpDisabled.GetMask() != NULL,
GetToolsCount()
);
{
// for some reason TB_GETITEMRECT returns a rectangle 1 pixel
// shorter than the full window size (at least under Windows 7)
- // but we need to erase the full height below
+ // but we need to erase the full width/height below
RECT rcItem = wxGetTBItemRect(GetHwnd(), toolIndex);
- rcItem.top = 0;
- rcItem.bottom = rectTotal.height;
+ if ( IsVertical() )
+ {
+ rcItem.left = 0;
+ rcItem.right = rectTotal.width;
+ }
+ else
+ {
+ rcItem.top = 0;
+ rcItem.bottom = rectTotal.height;
+ }
rgnDummySeps.Union(wxRectFromRECT(rcItem));
}
wxBrush * const
brush = wxTheBrushList->FindOrCreateBrush(colBg);
- return brush ? brush->GetResourceHandle() : 0;
+ return brush ? static_cast<WXHBRUSH>(brush->GetResourceHandle()) : 0;
}
WXHBRUSH wxToolBar::MSWGetBgBrushForChild(WXHDC hDC, wxWindowMSW *child)