diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index 14053a5d5e..e66d5b7247 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -361,7 +361,7 @@ public: @param width The width of the column in pixels or the special wxCOL_WIDTH_AUTOSIZE value indicating that the column should adjust - to its contents. Notice that the first column is special and will + to its contents. Notice that the last column is special and will be always resized to fill all the space not taken by the other columns, i.e. the width specified here is ignored for it. @param align @@ -405,7 +405,7 @@ public: Set column width to either the given value in pixels or to the value large enough to fit all of the items if width is wxCOL_WIDTH_AUTOSIZE. - Notice that setting the width of the first column is ignored as this + Notice that setting the width of the last column is ignored as this column is always resized to fill the space left by the other columns. */ void SetColumnWidth(unsigned col, int width); diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 1880bee6a3..f68d74e42d 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -1455,28 +1455,6 @@ void wxTreeListCtrl::OnSize(wxSizeEvent& event) view->Refresh(); view->Update(); #endif // wxHAS_GENERIC_DATAVIEWCTRL - - // Resize the first column to take the remaining available space. - const unsigned numColumns = GetColumnCount(); - if ( !numColumns ) - return; - - // There is a bug in generic wxDataViewCtrl: if the column width sums - // up to the total size, horizontal scrollbar (unnecessarily) appears, - // so subtract a bit to ensure this doesn't happen. - int remainingWidth = rect.width - 5; - for ( unsigned n = 1; n < GetColumnCount(); n++ ) - { - remainingWidth -= GetColumnWidth(n); - if ( remainingWidth <= 0 ) - { - // There is not enough space, as we're not going to give the - // first column negative width anyhow, just don't do anything. - return; - } - } - - SetColumnWidth(0, remainingWidth); } }