}
// draw focus background on area in a way typical on platform
-void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags )
+void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) const
{
wxUxThemeEngine* theme = (wxUxThemeEngine*) NULL;
+
+ // Constructor only calls GetHWND() const, so it should be safe
+ // to cast "this" to const.
wxUxThemeHandle hTheme(this, L"COMBOBOX");
//COLORREF cref;
wxRect selRect(rect);
selRect.y += focusSpacingY;
selRect.height -= (focusSpacingY*2);
- selRect.x += m_widthCustomPaint + focusSpacingX;
- selRect.width -= m_widthCustomPaint + (focusSpacingX*2);
+
+ int wcp = 0;
+
+ if ( !(flags & wxCONTROL_ISSUBMENU) )
+ wcp += m_widthCustomPaint;
+
+ selRect.x += wcp + focusSpacingX;
+ selRect.width -= wcp + (focusSpacingX*2);
if ( hTheme )
theme = wxUxThemeEngine::GetIfActive();