X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa3d4aaf0fdffa51372d15f17862cb7081687107..b5e9cbb92d56a2bccf5ef65986727f1bdcd96328:/src/generic/datavgen.cpp diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index ca91268171..0fbcc1510c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -88,12 +88,25 @@ public: wxDataViewCtrl *GetOwner() const { return static_cast(GetParent()); } -private: +protected: + // implement/override wxHeaderCtrl functions by forwarding them to the main + // control virtual wxHeaderColumnBase& GetColumn(unsigned int idx) { return *(GetOwner()->GetColumn(idx)); } + virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle) + { + wxDataViewCtrl * const owner = GetOwner(); + + int widthContents = owner->GetBestColumnWidth(idx); + owner->GetColumn(idx)->SetWidth(wxMax(widthTitle, widthContents)); + + return true; + } + +private: bool SendEvent(wxEventType type, unsigned int n) { wxDataViewCtrl * const owner = GetOwner();