From 0e0bc921908ab73cac0cd14f00ac448c83fdec35 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2002 15:20:57 +0000 Subject: [PATCH] added Append(wxArrayString) to wxItemContainer (and so to wxChoice, wxComboBox, wxListBox, ...) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/ctrlsub.h | 3 +++ src/common/ctrlsub.cpp | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index ac07defc27..38b22f90fc 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -44,6 +44,9 @@ public: int Append(const wxString& item, wxClientData *clientData) { int n = DoAppend(item); SetClientObject(n, clientData); return n; } + // append several items at once to the control + void Append(const wxArrayString& strings); + // deleting items // -------------- diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index 1c7e18ea27..aa0714d83f 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -57,6 +57,19 @@ wxString wxItemContainer::GetStringSelection() const return s; } +// ---------------------------------------------------------------------------- +// appending items +// ---------------------------------------------------------------------------- + +void wxItemContainer::Append(const wxArrayString& strings) +{ + size_t count = strings.GetCount(); + for ( size_t n = 0; n < count; n++ ) + { + Append(strings[n]); + } +} + // ---------------------------------------------------------------------------- // client data // ---------------------------------------------------------------------------- -- 2.47.2