X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..e1265174571765b279434383788a52832b5992b4:/src/common/ctrlsub.cpp diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index 9a7ec228e3..36bf79cec9 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 /////////////////////////////////////////////////////////////////////////////// @@ -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,6 +58,38 @@ wxString wxItemContainer::GetStringSelection() const return s; } +bool wxItemContainerImmutable::SetStringSelection(const wxString& s) +{ + const int sel = FindString(s); + if ( sel == wxNOT_FOUND ) + return false; + + SetSelection(sel); + + return true; +} + +wxArrayString wxItemContainerImmutable::GetStrings() const +{ + wxArrayString result; + + const size_t count = GetCount(); + result.Alloc(count); + for ( size_t n = 0; n < count; n++ ) + result.Add(GetString(n)); + + return result; +} + +// ============================================================================ +// wxItemContainer implementation +// ============================================================================ + +wxItemContainer::~wxItemContainer() +{ + // this destructor is required for Darwin +} + // ---------------------------------------------------------------------------- // appending items // ----------------------------------------------------------------------------