X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6012f61212b67d510e4a6393272e867a4ceb58c1..1736f021a83e2547fd5ca1272cb038f37c721481:/src/common/combocmn.cpp diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 30b35a7dd0..b9792d8df8 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -492,19 +492,7 @@ void wxComboBoxExtraInputHandler::OnKey(wxKeyEvent& event) ( keycode != WXK_RIGHT && keycode != WXK_LEFT ) ) { - // Alternate keys: UP and DOWN show the popup instead of cycling - if ( (comboStyle & wxCC_ALT_KEYS) ) - { - if ( keycode == WXK_UP || keycode == WXK_DOWN ) - { - m_combo->OnButtonClick(); - return; - } - else - event.Skip(); - } - else - popupInterface->OnComboKeyEvent(event); + popupInterface->OnComboKeyEvent(event); } else event.Skip(); @@ -681,7 +669,7 @@ void wxComboCtrlBase::Init() m_btnState = 0; m_btnWidDefault = 0; m_blankButtonBg = false; - m_btnWid = m_btnHei = 0; + m_btnWid = m_btnHei = -1; m_btnSide = wxRIGHT; m_btnSpacingX = 0; @@ -813,7 +801,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) if ( ( (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) || (m_bmpNormal.Ok() && m_blankButtonBg) ) && m_btnSpacingX == 0 && - m_btnHei == 0 ) + m_btnHei <= 0 ) { m_iFlags |= wxCC_IFLAG_BUTTON_OUTSIDE; btnBorder = 0; @@ -841,9 +829,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) int butHeight = sz.y - btnBorder*2; // Adjust button width - if ( m_btnWid < 0 ) - butWidth += m_btnWid; - else if ( m_btnWid > 0 ) + if ( m_btnWid > 0 ) butWidth = m_btnWid; else { @@ -865,9 +851,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) } // Adjust button height - if ( m_btnHei < 0 ) - butHeight += m_btnHei; - else if ( m_btnHei > 0 ) + if ( m_btnHei > 0 ) butHeight = m_btnHei; // Use size of normal bitmap if... @@ -1857,7 +1841,7 @@ void wxComboCtrlBase::HidePopup() // ---------------------------------------------------------------------------- void wxComboCtrlBase::SetButtonPosition( int width, int height, - int side, int spacingX ) + int side, int spacingX ) { m_btnWid = width; m_btnHei = height; @@ -1867,6 +1851,25 @@ void wxComboCtrlBase::SetButtonPosition( int width, int height, RecalcAndRefresh(); } +wxSize wxComboCtrlBase::GetButtonSize() +{ + if ( m_btnSize.x > 0 ) + return m_btnSize; + + wxSize retSize(m_btnWid,m_btnHei); + + // Need to call CalculateAreas now if button size is + // is not explicitly specified. + if ( retSize.x <= 0 || retSize.y <= 0) + { + OnResize(); + + retSize = m_btnSize; + } + + return retSize; +} + void wxComboCtrlBase::SetButtonBitmaps( const wxBitmap& bmpNormal, bool blankButtonBg, const wxBitmap& bmpPressed,