fixed SetColumnWidth() in wxLC_LIST mode (set column to 0, not -1)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-03-21 10:36:59 +00:00
parent 6671c68b08
commit 514ee25088

View File

@@ -671,17 +671,15 @@ int wxListCtrl::GetColumnWidth(int col) const
// Sets the column width // Sets the column width
bool wxListCtrl::SetColumnWidth(int col, int width) bool wxListCtrl::SetColumnWidth(int col, int width)
{ {
int col2 = col;
if ( m_windowStyle & wxLC_LIST ) if ( m_windowStyle & wxLC_LIST )
col2 = -1; col = 0;
int width2 = width; if ( width == wxLIST_AUTOSIZE)
if ( width2 == wxLIST_AUTOSIZE) width = LVSCW_AUTOSIZE;
width2 = LVSCW_AUTOSIZE; else if ( width == wxLIST_AUTOSIZE_USEHEADER)
else if ( width2 == wxLIST_AUTOSIZE_USEHEADER) width = LVSCW_AUTOSIZE_USEHEADER;
width2 = LVSCW_AUTOSIZE_USEHEADER;
return ListView_SetColumnWidth(GetHwnd(), col2, width2) != 0; return ListView_SetColumnWidth(GetHwnd(), col, width) != 0;
} }
// Gets the number of items that can fit vertically in the // Gets the number of items that can fit vertically in the