From caa20b1e31b6a180b5ea33f15edbf1a6335c1e1a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 2 Jan 2003 21:00:17 +0000 Subject: [PATCH] added test for wxLIST_FORMAT_CENTRE/RIGHT git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/listctrl/listtest.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index c79e252863..661bd5c70a 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -391,23 +391,20 @@ void MyFrame::InitWithReportItems() { m_listCtrl->SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); - // under MSW for SetColumnWidth() to work we need to create the items with - // images initially -#if 1 + // note that under MSW for SetColumnWidth() to work we need to create the + // items with images initially even if we specify dummy image id wxListItem itemCol; - itemCol.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE; - itemCol.m_text = _T("Column 1"); - itemCol.m_image = -1; + itemCol.SetText(_T("Column 1")); + itemCol.SetImage(-1); m_listCtrl->InsertColumn(0, itemCol); - itemCol.m_text = _T("Column 2"); + + itemCol.SetText(_T("Column 2")); + itemCol.SetAlign(wxLIST_FORMAT_CENTRE); m_listCtrl->InsertColumn(1, itemCol); - itemCol.m_text = _T("Column 3"); + + itemCol.SetText(_T("Column 3")); + itemCol.SetAlign(wxLIST_FORMAT_RIGHT); m_listCtrl->InsertColumn(2, itemCol); -#else - m_listCtrl->InsertColumn(0, _T("Column 1")); // , wxLIST_FORMAT_LEFT, 140); - m_listCtrl->InsertColumn(1, _T("Column 2")); // , wxLIST_FORMAT_LEFT, 140); - m_listCtrl->InsertColumn(2, _T("One More Column (2)")); // , wxLIST_FORMAT_LEFT, 140); -#endif // to speed up inserting we hide the control temporarily m_listCtrl->Hide(); -- 2.45.2