From 0766283b2ea1bbc259c0412e28574c0b714284f1 Mon Sep 17 00:00:00 2001 From: Ilya Sinitsyn Date: Wed, 18 Sep 2019 01:20:53 +0200 Subject: [PATCH] Add wxHeaderCtrl::GetColumnTitleWidth() overload taking index This makes it possible to get the appropriate column width from outside the class, as GetColumn() itself is currently protected and so the existing overload couldn't easily used. --- include/wx/headerctrl.h | 6 ++++++ interface/wx/headerctrl.h | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index f2270bf78e..8d677eec67 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -159,6 +159,12 @@ public: // compute column title width int GetColumnTitleWidth(const wxHeaderColumn& col); + // compute column title width for the column with the given index + int GetColumnTitleWidth(unsigned int idx) + { + return GetColumnTitleWidth(GetColumn(idx)); + } + // implementation only from now on // ------------------------------- diff --git a/interface/wx/headerctrl.h b/interface/wx/headerctrl.h index d8045cf6de..3980a9a01e 100644 --- a/interface/wx/headerctrl.h +++ b/interface/wx/headerctrl.h @@ -404,6 +404,16 @@ public: */ int GetColumnTitleWidth(const wxHeaderColumn& col); + /** + Returns width needed for the column with the given index. + + This is just a convenient wrapper for the overload taking + wxHeaderColumn. + + @since 3.1.3 + */ + int GetColumnTitleWidth(unsigned int idx); + protected: /** Method to be implemented by the derived classes to return the