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
This commit is contained in:
Vadim Zeitlin
2006-11-12 23:34:11 +00:00
parent 4b98d13d36
commit 373d466f85
4 changed files with 14 additions and 6 deletions

View File

@@ -419,8 +419,14 @@ protected:
// Installs standard input handler to combo (and optionally to the textctrl) // Installs standard input handler to combo (and optionally to the textctrl)
void InstallInputHandlers(); void InstallInputHandlers();
// flags for DrawButton()
enum
{
Draw_PaintBg = 1
};
// Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. // 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. // Call if cursor is on button area or mouse is captured for the button.
//bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside ); //bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside );

View File

@@ -1238,7 +1238,7 @@ void wxComboCtrlBase::PrepareBackground( wxDC&, const wxRect&, int ) const
} }
#endif #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; int drawState = m_btnState;

View File

@@ -276,8 +276,10 @@ void wxGenericComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) )
dc.DrawRectangle(rect); dc.DrawRectangle(rect);
if ( !m_btn ) if ( !m_btn )
{
// Standard button rendering // Standard button rendering
DrawButton(dc,rectb,true); DrawButton(dc,rectb);
}
// paint required portion on the control // paint required portion on the control
if ( (!m_text || m_widthCustomPaint) ) if ( (!m_text || m_widthCustomPaint) )

View File

@@ -456,7 +456,7 @@ void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) )
dc.DrawRectangle(rect); dc.DrawRectangle(rect);
// Button background with theme? // Button background with theme?
bool drawButBg = true; int drawButFlags = Draw_PaintBg;
if ( hTheme && m_blankButtonBg ) if ( hTheme && m_blankButtonBg )
{ {
RECT r; RECT r;
@@ -468,11 +468,11 @@ void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) )
GetHdcOf(dc), GetHdcOf(dc),
&r); &r);
drawButBg = false; drawButFlags = 0;
} }
// Standard button rendering // Standard button rendering
DrawButton(dc,rectb,drawButBg); DrawButton(dc,rectb,drawButFlags);
// paint required portion on the control // paint required portion on the control
if ( (!m_text || m_widthCustomPaint) ) if ( (!m_text || m_widthCustomPaint) )