diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 815dfcb75b..2ee210ceac 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -107,6 +107,8 @@ public: return m_flags; } + virtual bool IsResizeable() const wxOVERRIDE; + virtual bool IsSortKey() const wxOVERRIDE { return m_sort; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index c5aad72db8..5df51937e1 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -256,6 +256,17 @@ void wxDataViewColumn::SetSortOrder(bool ascending) m_owner->OnColumnChange(idx); } +bool wxDataViewColumn::IsResizeable() const +{ + // The last column in generic wxDataViewCtrl is never resizeable by the + // user because it's always automatically expanded to consume all the + // available space, so prevent the user from resizing it. + if ( this == GetOwner()->GetColumn(GetOwner()->GetColumnCount() - 1) ) + return false; + + return wxDataViewColumnBase::IsResizeable(); +} + //----------------------------------------------------------------------------- // wxDataViewHeaderWindow //-----------------------------------------------------------------------------