X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c905c0d60f4bd407cc4cbfd809d5cf8a51a61523..850df2d78866c3edcf848103b5dbc7e7fa1ee5fa:/src/common/combocmn.cpp diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 588772db18..c2dab94710 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -34,6 +34,7 @@ #include "wx/settings.h" #include "wx/dialog.h" #include "wx/timer.h" + #include "wx/textctrl.h" #endif #include "wx/tooltip.h" @@ -1005,10 +1006,10 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) { int newY = butHeight+(customBorder*2); SetClientSize(wxDefaultCoord,newY); - if ( m_bmpNormal.Ok() || m_btnArea.width != butWidth || m_btnArea.height != butHeight ) - m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; - else - m_iFlags &= ~wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; + if ( m_bmpNormal.Ok() || m_btnArea.width != butWidth || m_btnArea.height != butHeight ) + m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; + else + m_iFlags &= ~wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; sz.y = newY; } @@ -1265,7 +1266,7 @@ void wxComboCtrlBase::PrepareBackground( wxDC& dc, const wxRect& rect, int flags { // Drawing control isEnabled = IsEnabled(); - doDrawFocusRect = ShouldDrawFocus() & !(m_iFlags & wxCC_FULL_BUTTON); + doDrawFocusRect = ShouldDrawFocus() && !(m_iFlags & wxCC_FULL_BUTTON); // Windows-style: for smaller size control (and for disabled background) use less spacing focusSpacingX = isEnabled ? 2 : 1; @@ -1275,7 +1276,7 @@ void wxComboCtrlBase::PrepareBackground( wxDC& dc, const wxRect& rect, int flags { // Drawing a list item isEnabled = true; // they are never disabled - doDrawFocusRect = flags & wxCONTROL_SELECTED ? true : false; + doDrawFocusRect = (flags & wxCONTROL_SELECTED) != 0; focusSpacingX = 0; focusSpacingY = 0; @@ -2249,6 +2250,7 @@ void wxComboCtrlBase::SetValueWithEvent(const wxString& value, bool withEvent) m_ignoreEvtText++; m_text->SetValue(value); + if ( !(m_iFlags & wxCC_NO_TEXT_AUTO_SELECT) ) m_text->SelectAll(); } @@ -2261,7 +2263,8 @@ void wxComboCtrlBase::SetValueWithEvent(const wxString& value, bool withEvent) EnsurePopupControl(); - m_popupInterface->SetStringValue(value); + if (m_popupInterface) + m_popupInterface->SetStringValue(value); } Refresh();