-#if wxUSE_UXTHEME
- // we may need to draw themed colour so that we appear correctly on
- // e.g. notebook page under XP with themes but only do it if the parent
- // draws themed background itself
- if ( !GetParent()->UseBgCol() )
- {
- wxUxThemeEngine *theme = wxUxThemeEngine::GetIfActive();
- if ( theme )
- {
- HRESULT
- hr = theme->DrawThemeParentBackground(GetHwnd(), hdc, &rect);
- if ( hr == S_OK )
- return;
-
- // it can also return S_FALSE which seems to simply say that it
- // didn't draw anything but no error really occurred
- if ( FAILED(hr) )
- wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr);
- }
- }
-#endif // wxUSE_UXTHEME
-
- // if we are transparent then paint our background ourselves
- LRESULT style = ::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L);
- if ( style & TBSTYLE_TRANSPARENT )
- {
- ::FillRect(hdc, &rect, ::GetSysColorBrush(COLOR_BTNFACE));
- }
- else
- {
- // let the system do it for us
- event.Skip();
- }