From b61f4f77bc6c45f4d25aac767b93b30f00611d8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Sun, 21 May 2006 21:12:59 +0000 Subject: [PATCH] [ 1492391 ] Fix wxComboCtrl button rendering problem. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/combocmn.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index bf2e830a65..e5e2efc37f 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combocmn.cpp +// Name: src/common/combocmn.cpp // Purpose: wxComboCtrlBase // Author: Jaakko Salli // Modified by: @@ -26,7 +26,6 @@ #if wxUSE_COMBOCTRL #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/log.h" #include "wx/combobox.h" #include "wx/dcclient.h" @@ -694,13 +693,13 @@ void wxComboCtrlBase::Init() } bool wxComboCtrlBase::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) + wxWindowID id, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) { if ( !wxControl::Create(parent, id, @@ -1178,9 +1177,19 @@ void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, bool paintBg ) if ( !m_bmpNormal.Ok() ) { // 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 ( paintBg ) + { + wxColour bgCol; + + if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE ) + bgCol = GetParent()->GetBackgroundColour(); + else + bgCol = GetBackgroundColour(); + + dc.SetBrush(bgCol); + dc.SetPen(bgCol); dc.DrawRectangle(rect); + } // Draw standard button wxRendererNative::Get().DrawComboBoxDropButton(this, -- 2.45.2