diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 4c932cfd1c..247a30d253 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -154,7 +154,7 @@ public: // user interactively. void WXOnResize(int width); - int WXGetManuallySetWidth() const { return m_manuallySetWidth; } + int WXGetManuallySetWidth() const; private: // common part of all ctors diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index bce892416b..0e8689765d 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -217,6 +217,15 @@ void wxDataViewColumn::WXOnResize(int width) m_owner->OnColumnResized(); } +int wxDataViewColumn::WXGetManuallySetWidth() const +{ + // Note that we need to return valid value even if no width was initially + // specified, as otherwise the last column created without any explicit + // width could be reduced to nothing by UpdateColumnSizes() when the + // control is shrunk. + return DoGetEffectiveWidth(m_manuallySetWidth); +} + void wxDataViewColumn::UpdateDisplay() { if (m_owner)