From fea37f4984e36cde8cbd7829c151795f49d89e3b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Feb 2016 01:25:54 +0100 Subject: [PATCH] Don't assert when creating wxComboBox with wxCB_SORT in wxOSX Partially undo the changes of 8e7262fca7520f73e711981019c6407ee84e5e26: using wxLogWarning() was wrong, but using asserts is not really great neither as it results in crashes, and prevents from using, some samples. Also at least document that this style is not supported. See #12419. --- interface/wx/combobox.h | 3 ++- src/osx/combobox_osx.cpp | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/interface/wx/combobox.h b/interface/wx/combobox.h index a23358d2a8..2ba41dca3b 100644 --- a/interface/wx/combobox.h +++ b/interface/wx/combobox.h @@ -38,7 +38,8 @@ allows the user to choose from the list of options but doesn't allow to enter a value not present in the list. @style{wxCB_SORT} - Sorts the entries in the list alphabetically. + Sorts the entries in the list alphabetically. Notice that this style + is not currently implemented in wxOSX. @style{wxTE_PROCESS_ENTER} The control will generate the event @c wxEVT_TEXT_ENTER (otherwise pressing Enter key is either processed internally by the diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index faf325a867..f529d019f9 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -56,9 +56,6 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) return false; - wxASSERT_MSG( !(style & wxCB_SORT), - "wxCB_SORT not currently supported by wxOSX/Cocoa"); - SetPeer(wxWidgetImpl::CreateComboBox( this, parent, id, NULL, pos, size, style, GetExtraStyle() )); MacPostControlCreate( pos, size );