X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64fa6f167ebb404e5441eddcee5bbd0808466d7a..c497d0b2123337d89fe5d35c25a2f37026b7dba9:/src/common/ctrlsub.cpp diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index 59a9c9832b..36bf79cec9 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -36,10 +36,10 @@ #endif // ============================================================================ -// implementation +// wxItemContainerImmutable implementation // ============================================================================ -wxItemContainer::~wxItemContainer() +wxItemContainerImmutable::~wxItemContainerImmutable() { // this destructor is required for Darwin } @@ -48,7 +48,7 @@ wxItemContainer::~wxItemContainer() // selection // ---------------------------------------------------------------------------- -wxString wxItemContainer::GetStringSelection() const +wxString wxItemContainerImmutable::GetStringSelection() const { wxString s; int sel = GetSelection(); @@ -58,24 +58,36 @@ wxString wxItemContainer::GetStringSelection() const return s; } -bool wxItemContainer::SetStringSelection(const wxString& s) +bool wxItemContainerImmutable::SetStringSelection(const wxString& s) { const int sel = FindString(s); if ( sel == wxNOT_FOUND ) return false; - Select(sel); + SetSelection(sel); return true; } -wxArrayString wxItemContainer::GetStrings() const +wxArrayString wxItemContainerImmutable::GetStrings() const { - wxArrayString result ; - size_t count = GetCount() ; - for ( size_t n = 0 ; n < count ; n++ ) + wxArrayString result; + + const size_t count = GetCount(); + result.Alloc(count); + for ( size_t n = 0; n < count; n++ ) result.Add(GetString(n)); - return result ; + + return result; +} + +// ============================================================================ +// wxItemContainer implementation +// ============================================================================ + +wxItemContainer::~wxItemContainer() +{ + // this destructor is required for Darwin } // ---------------------------------------------------------------------------- @@ -167,13 +179,4 @@ 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