- // Draw parent background if needed (since button looks like its out of
- // the combo, this is preferred).
- theme->DrawThemeParentBackground(GetHwndOf(this),
- GetHdcOf(dc),
- &r);
+ if ( useVistaComboBox )
+ {
+ if ( drawFullButton )
+ {
+ // We need to alter the button style slightly before
+ // drawing the actual button (but it was good above
+ // when background etc was done).
+ if ( butState == CBXS_HOT || butState == CBXS_PRESSED )
+ butState = CBXS_NORMAL;
+ }
+
+ if ( m_btnSide == wxRIGHT )
+ butPart = CP_DROPDOWNBUTTONRIGHT;
+ else
+ butPart = CP_DROPDOWNBUTTONLEFT;
+
+ }
+ theme->DrawThemeBackground( hTheme, hDc, butPart, butState, &rButton, NULL );
+ }
+ else if ( useVistaComboBox &&
+ (m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE) )
+ {
+ // We'll do this, because DrawThemeParentBackground
+ // doesn't seem to be reliable on Vista.
+ drawButFlags |= Button_PaintBackground;
+ }
+ }
+ else
+ {
+ // Windows 2000 and earlier
+ drawButFlags = Button_PaintBackground;