X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e0bc921908ab73cac0cd14f00ac448c83fdec35..ecd20d4a916884895dcd8873a9f1156e34f4ac89:/src/common/ctrlsub.cpp diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index aa0714d83f..cf913548e0 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 22.10.99 // RCS-ID: $Id$ -// Copyright: (c) wxWindows team +// Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "controlwithitems.h" #endif @@ -32,6 +32,7 @@ #ifndef WX_PRECOMP #include "wx/ctrlsub.h" + #include "wx/arrstr.h" #endif // ============================================================================ @@ -57,6 +58,15 @@ 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 // ---------------------------------------------------------------------------- @@ -70,6 +80,25 @@ void wxItemContainer::Append(const wxArrayString& strings) } } +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 // ---------------------------------------------------------------------------- @@ -122,4 +151,18 @@ void *wxItemContainer::GetClientData(int n) const return DoGetItemClientData(n); } +wxControlWithItems::~wxControlWithItems() +{ + // this destructor is required for Darwin +} + +#if WXWIN_COMPATIBILITY_2_2 + +int wxItemContainer::Number() const +{ + return GetCount(); +} + +#endif // WXWIN_COMPATIBILITY_2_2 + #endif // wxUSE_CONTROLS