// Created: 22.10.99
// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
#endif
// ============================================================================
-// implementation
+// wxItemContainerImmutable implementation
// ============================================================================
-wxItemContainer::~wxItemContainer()
+wxItemContainerImmutable::~wxItemContainerImmutable()
{
// this destructor is required for Darwin
}
// selection
// ----------------------------------------------------------------------------
-wxString wxItemContainer::GetStringSelection() const
+wxString wxItemContainerImmutable::GetStringSelection() const
{
wxString s;
int sel = GetSelection();
return s;
}
-wxArrayString wxItemContainer::GetStrings() const
+bool wxItemContainerImmutable::SetStringSelection(const wxString& s)
{
- wxArrayString result ;
- size_t count = GetCount() ;
- for ( size_t n = 0 ; n < count ; n++ )
+ 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 ;
+
+ return result;
+}
+
+// ============================================================================
+// wxItemContainer implementation
+// ============================================================================
+
+wxItemContainer::~wxItemContainer()
+{
+ // this destructor is required for Darwin
}
// ----------------------------------------------------------------------------