X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da6069e29c0dd892eb2e55e4314499f68fb4c02b..6afa47d63d56094958ed4d2528bf45ad67340954:/src/common/ctrlsub.cpp diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index 1d8421d728..03be03f3dc 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "controlwithitems.h" #endif @@ -32,12 +32,18 @@ #ifndef WX_PRECOMP #include "wx/ctrlsub.h" + #include "wx/arrstr.h" #endif // ============================================================================ // implementation // ============================================================================ +wxItemContainer::~wxItemContainer() +{ + // this destructor is required for Darwin +} + // ---------------------------------------------------------------------------- // selection // ---------------------------------------------------------------------------- @@ -52,6 +58,47 @@ wxString wxItemContainer::GetStringSelection() const return s; } +wxArrayString wxItemContainer::GetStrings() const +{ + wxArrayString result ; + size_t count = GetCount() ; + for ( size_t n = 0 ; n < count ; n++ ) + result.Add(GetString(n)); + return result ; +} + +// ---------------------------------------------------------------------------- +// appending items +// ---------------------------------------------------------------------------- + +void wxItemContainer::Append(const wxArrayString& strings) +{ + size_t count = strings.GetCount(); + for ( size_t n = 0; n < count; n++ ) + { + Append(strings[n]); + } +} + +int wxItemContainer::Insert(const wxString& item, int pos, void *clientData) +{ + int n = DoInsert(item, pos); + if ( n != wxNOT_FOUND ) + SetClientData(n, clientData); + + return n; +} + +int +wxItemContainer::Insert(const wxString& item, int pos, wxClientData *clientData) +{ + int n = DoInsert(item, pos); + if ( n != wxNOT_FOUND ) + SetClientObject(n, clientData); + + return n; +} + // ---------------------------------------------------------------------------- // client data // ---------------------------------------------------------------------------- @@ -104,4 +151,9 @@ void *wxItemContainer::GetClientData(int n) const return DoGetItemClientData(n); } +wxControlWithItems::~wxControlWithItems() +{ + // this destructor is required for Darwin +} + #endif // wxUSE_CONTROLS