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.
This commit is contained in:
Ilya Sinitsyn
2019-09-18 01:20:53 +02:00
committed by Vadim Zeitlin
parent d8c3c53f05
commit 0766283b2e
2 changed files with 16 additions and 0 deletions

View File

@@ -159,6 +159,12 @@ public:
// compute column title width // compute column title width
int GetColumnTitleWidth(const wxHeaderColumn& col); 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 // implementation only from now on
// ------------------------------- // -------------------------------

View File

@@ -404,6 +404,16 @@ public:
*/ */
int GetColumnTitleWidth(const wxHeaderColumn& col); 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: protected:
/** /**
Method to be implemented by the derived classes to return the Method to be implemented by the derived classes to return the