From 373d466f85e880baef6a13c130dc019a6b143331 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Nov 2006 23:34:11 +0000 Subject: [PATCH] changed last DrawButton() parameter from bool to int to allow for future extensions (patch 1595264) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/combo.h | 8 +++++++- src/common/combocmn.cpp | 2 +- src/generic/combog.cpp | 4 +++- src/msw/combo.cpp | 6 +++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/wx/combo.h b/include/wx/combo.h index a504c1543e..886ea13a65 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -419,8 +419,14 @@ protected: // Installs standard input handler to combo (and optionally to the textctrl) void InstallInputHandlers(); + // flags for DrawButton() + enum + { + Draw_PaintBg = 1 + }; + // Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. - void DrawButton( wxDC& dc, const wxRect& rect, bool paintBg = true ); + void DrawButton( wxDC& dc, const wxRect& rect, int flags = Draw_PaintBg ); // Call if cursor is on button area or mouse is captured for the button. //bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside ); diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 9160f1b710..a633163d30 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1238,7 +1238,7 @@ void wxComboCtrlBase::PrepareBackground( wxDC&, const wxRect&, int ) const } #endif -void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, bool paintBg ) +void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int paintBg ) { int drawState = m_btnState; diff --git a/src/generic/combog.cpp b/src/generic/combog.cpp index 082612d098..ad7874f22c 100644 --- a/src/generic/combog.cpp +++ b/src/generic/combog.cpp @@ -276,8 +276,10 @@ void wxGenericComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) dc.DrawRectangle(rect); if ( !m_btn ) + { // Standard button rendering - DrawButton(dc,rectb,true); + DrawButton(dc,rectb); + } // paint required portion on the control if ( (!m_text || m_widthCustomPaint) ) diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 367f609c50..7c69f60c86 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -456,7 +456,7 @@ void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) dc.DrawRectangle(rect); // Button background with theme? - bool drawButBg = true; + int drawButFlags = Draw_PaintBg; if ( hTheme && m_blankButtonBg ) { RECT r; @@ -468,11 +468,11 @@ void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) GetHdcOf(dc), &r); - drawButBg = false; + drawButFlags = 0; } // Standard button rendering - DrawButton(dc,rectb,drawButBg); + DrawButton(dc,rectb,drawButFlags); // paint required portion on the control if ( (!m_text || m_widthCustomPaint) ) -- 2.47.2