]> git.saurik.com Git - wxWidgets.git/commitdiff
[ 1492391 ] Fix wxComboCtrl button rendering problem.
authorWłodzimierz Skiba <abx@abx.art.pl>
Sun, 21 May 2006 21:12:59 +0000 (21:12 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Sun, 21 May 2006 21:12:59 +0000 (21:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/combocmn.cpp

index bf2e830a65579d5a3460d99a337c3b8f0479202d..e5e2efc37f03deff580bcb7da8dac3e6b196f915 100644 (file)
@@ -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,