if ( !enabled )
drawState |= wxCONTROL_DISABLED;
- if ( !m_bmpNormal.Ok() )
+ // Need to clear button background even if m_btn is present
+ // and also when using custom bitmap for the button
+ if ( (flags & Button_PaintBackground) &&
+ (!HasTransparentBackground() ||
+ !(m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE)) )
{
- if ( flags & Button_BitmapOnly )
- return;
+ wxColour bgCol;
- // Need to clear button background even if m_btn is present
- if ( (flags & Button_PaintBackground) &&
- (!HasTransparentBackground() ||
- !(m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE)) )
- {
- wxColour bgCol;
+ if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE )
+ bgCol = GetParent()->GetBackgroundColour();
+ else
+ bgCol = GetBackgroundColour();
- if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE )
- bgCol = GetParent()->GetBackgroundColour();
- else
- bgCol = GetBackgroundColour();
+ dc.SetBrush(bgCol);
+ dc.SetPen(bgCol);
+ dc.DrawRectangle(rect);
+ }
- dc.SetBrush(bgCol);
- dc.SetPen(bgCol);
- dc.DrawRectangle(rect);
- }
+ if ( !m_bmpNormal.Ok() )
+ {
+ if ( flags & Button_BitmapOnly )
+ return;
// Draw standard button
wxRendererNative::Get().DrawComboBoxDropButton(this,
if ( m_blankButtonBg )
{
- // If using blank button background, we need to clear its background
- // with button face colour instead of colour for rest of the control.
- if ( flags & Button_PaintBackground )
- {
- wxColour bgCol = GetParent()->GetBackgroundColour(); //wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
- //wxColour bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
- dc.SetPen(bgCol);
- dc.SetBrush(bgCol);
- dc.DrawRectangle(rect);
- }
-
if ( !(flags & Button_BitmapOnly) )
{
wxRendererNative::Get().DrawPushButton(this,
drawState);
}
}
- else
-
- {
- // Need to clear button background even if m_btn is present
- // (assume non-button background was cleared just before this call so brushes are good)
- if ( flags & Button_PaintBackground )
- dc.DrawRectangle(rect);
- }
// Draw bitmap centered in drawRect
dc.DrawBitmap(*pBmp,