From dc2f83c4f1aa373d6d10207dc9d04f853c9a3e2d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 29 Jun 2013 12:52:34 +0000 Subject: [PATCH] Use more readable wxListCtrl::AppendColumn() in the samples. Call this function instead of InsertColumn() with incrementing indices. See #15265. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/artprov/artbrows.cpp | 2 +- samples/listctrl/listtest.cpp | 8 ++++---- samples/mediaplayer/mediaplayer.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/artprov/artbrows.cpp b/samples/artprov/artbrows.cpp index e58377e..8f36347 100644 --- a/samples/artprov/artbrows.cpp +++ b/samples/artprov/artbrows.cpp @@ -149,7 +149,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300), wxLC_REPORT | wxSUNKEN_BORDER); - m_list->InsertColumn(0, wxT("wxArtID")); + m_list->AppendColumn(wxT("wxArtID")); subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10); wxSizer *subsub = new wxBoxSizer(wxVERTICAL); diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index eaeb8a9..052260b 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -666,14 +666,14 @@ void MyFrame::InitWithVirtualItems() if ( m_smallVirtual ) { - m_listCtrl->InsertColumn(0, wxT("Animal")); - m_listCtrl->InsertColumn(1, wxT("Sound")); + m_listCtrl->AppendColumn(wxT("Animal")); + m_listCtrl->AppendColumn(wxT("Sound")); m_listCtrl->SetItemCount(WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS)); } else { - m_listCtrl->InsertColumn(0, wxT("First Column")); - m_listCtrl->InsertColumn(1, wxT("Second Column")); + m_listCtrl->AppendColumn(wxT("First Column")); + m_listCtrl->AppendColumn(wxT("Second Column")); m_listCtrl->SetColumnWidth(0, 150); m_listCtrl->SetColumnWidth(1, 150); m_listCtrl->SetItemCount(1000000); diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index 589e1e5..ad38264 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -1620,9 +1620,9 @@ wxMediaPlayerNotebookPage::wxMediaPlayerNotebookPage(wxMediaPlayerFrame* parentF // Column two is the name of the file // // Column three is the length in seconds of the file - m_playlist->InsertColumn(0,_(""), wxLIST_FORMAT_CENTER, 20); - m_playlist->InsertColumn(1,_("File"), wxLIST_FORMAT_LEFT, /*wxLIST_AUTOSIZE_USEHEADER*/305); - m_playlist->InsertColumn(2,_("Length"), wxLIST_FORMAT_CENTER, 75); + m_playlist->AppendColumn(_(""), wxLIST_FORMAT_CENTER, 20); + m_playlist->AppendColumn(_("File"), wxLIST_FORMAT_LEFT, /*wxLIST_AUTOSIZE_USEHEADER*/305); + m_playlist->AppendColumn(_("Length"), wxLIST_FORMAT_CENTER, 75); #if wxUSE_DRAG_AND_DROP m_playlist->SetDropTarget(new wxPlayListDropTarget(*m_playlist)); -- 2.7.4