X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4264a8317caf3a5813adc2bc5ddb755595e6481..34326da778583ca8eab95f2e41738da2852a5a16:/samples/listctrl/listtest.cpp diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 0536b20076..c7fbde5c45 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -20,11 +20,11 @@ #include "wx/wx.h" #endif -#if !defined(__WXMSW__) && !defined(__WXPM__) +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif -#ifndef __WXMSW__ +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "bitmaps/toolbrai.xpm" #include "bitmaps/toolchar.xpm" #include "bitmaps/tooldata.xpm" @@ -177,7 +177,7 @@ MyFrame::MyFrame(const wxChar *title) m_imageListNormal = new wxImageList(32, 32, true); m_imageListSmall = new wxImageList(16, 16, true); -#ifdef __WXMSW__ +#ifdef wxHAS_IMAGES_IN_RESOURCES m_imageListNormal->Add( wxIcon(wxT("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon(wxT("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) ); m_imageListNormal->Add( wxIcon(wxT("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) ); @@ -571,8 +571,14 @@ void MyFrame::InitWithIconItems(bool withText, bool sameIcon) if ( withText ) { - m_listCtrl->InsertItem(i, wxString::Format(wxT("Label %d"), i), - image); + // Make labels of different widths to test the layout. + wxString label; + if ( !(i % 5) ) + label.Printf("Longer label %d", i); + else + label.Printf("Label %d", i); + + m_listCtrl->InsertItem(i, label, image); } else { @@ -839,7 +845,7 @@ void MyFrame::OnAdd(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) { // demonstrate cancelling editing: this currently is wxMSW-only -#ifdef __WXMSW__ +#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) if ( m_listCtrl->GetEditControl() ) { m_listCtrl->EndEditLabel(true);