X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..170e293d9f890ce4805a73efbc0ad8aa1ad8b8f7:/src/common/ctrlsub.cpp diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index abbaabb4ff..67e8a80333 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -38,6 +38,11 @@ // implementation // ============================================================================ +wxItemContainer::~wxItemContainer() +{ + // this destructor is required for Darwin +} + // ---------------------------------------------------------------------------- // selection // ---------------------------------------------------------------------------- @@ -52,6 +57,19 @@ wxString wxItemContainer::GetStringSelection() const return s; } +// ---------------------------------------------------------------------------- +// appending items +// ---------------------------------------------------------------------------- + +void wxItemContainer::Append(const wxArrayString& strings) +{ + size_t count = strings.GetCount(); + for ( size_t n = 0; n < count; n++ ) + { + Append(strings[n]); + } +} + // ---------------------------------------------------------------------------- // client data // ---------------------------------------------------------------------------- @@ -61,12 +79,22 @@ void wxItemContainer::SetClientObject(int n, wxClientData *data) wxASSERT_MSG( m_clientDataItemsType != wxClientData_Void, wxT("can't have both object and void client data") ); - wxClientData *clientDataOld = DoGetItemClientObject(n); - if ( clientDataOld ) - delete clientDataOld; + // when we call SetClientObject() for the first time, m_clientDataItemsType + // is still wxClientData_None and so calling DoGetItemClientObject() would + // fail (in addition to being useless) - don't do it + if ( m_clientDataItemsType == wxClientData_Object ) + { + wxClientData *clientDataOld = DoGetItemClientObject(n); + if ( clientDataOld ) + delete clientDataOld; + } + else // m_clientDataItemsType == wxClientData_None + { + // now we have object client data + m_clientDataItemsType = wxClientData_Object; + } DoSetItemClientObject(n, data); - m_clientDataItemsType = wxClientData_Object; } wxClientData *wxItemContainer::GetClientObject(int n) const @@ -94,4 +122,9 @@ void *wxItemContainer::GetClientData(int n) const return DoGetItemClientData(n); } +wxControlWithItems::~wxControlWithItems() +{ + // this destructor is required for Darwin +} + #endif // wxUSE_CONTROLS