From f2ef438692be601120c60a8c2cde63968af12466 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Thu, 27 May 2010 15:11:58 +0000 Subject: [PATCH] Make wxComboCtrl::SetButtonPosition() now again work on wxMSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@64412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/combo.h | 6 +++++- src/common/combocmn.cpp | 3 +++ src/msw/combo.cpp | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/wx/combo.h b/include/wx/combo.h index 73ae300bb1..3639a8d42e 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -93,7 +93,11 @@ enum // Internal use: Secondary popup window type should be used (if available). wxCC_IFLAG_USE_ALT_POPUP = 0x1000, // Internal use: Skip popup animation. - wxCC_IFLAG_DISABLE_POPUP_ANIM = 0x2000 + wxCC_IFLAG_DISABLE_POPUP_ANIM = 0x2000, + // Internal use: Drop-button is a bitmap button or has non-default size + // (but can still be on either side of the control), regardless whether + // specified by the platform or the application. + wxCC_IFLAG_HAS_NONSTANDARD_BUTTON = 0x4000 }; diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 6a1b299e2a..cfe509a2a9 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -2110,6 +2110,9 @@ void wxComboCtrlBase::SetButtonPosition( int width, int height, m_btnSide = side; m_btnSpacingX = spacingX; + if ( width > 0 || height > 0 || spacingX ) + m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; + RecalcAndRefresh(); } diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 25f8f6cf69..13f9d2998b 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -539,7 +539,8 @@ void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) RECT rBorder; wxCopyRectToRECT(borderRect, rBorder); - wxUint32 isNonStdButton = (m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE); + bool isNonStdButton = (m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE) || + (m_iFlags & wxCC_IFLAG_HAS_NONSTANDARD_BUTTON); // // Get some states for themed drawing