Fix horizontal alignment in icon view in generic wxListCtrl.
Ensure that all the items in the same column have the same width, so that their labels are centred. Closes #9227. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user