Add wxGrid::IsUsingNativeHeader()

It is convenient to have this function if only in order to be able to
call GetGridColHeader() safely, i.e. without triggering an assert if
native header is not being used.
This commit is contained in:
Vadim Zeitlin
2020-03-11 01:58:37 +01:00
parent e1dcfc73d1
commit 8802657490
2 changed files with 12 additions and 0 deletions

View File

@@ -1837,6 +1837,9 @@ public:
wxWindow* GetGridColLabelWindow() const { return m_colLabelWin; } wxWindow* GetGridColLabelWindow() const { return m_colLabelWin; }
wxWindow* GetGridCornerLabelWindow() const { return (wxWindow*)m_cornerLabelWin; } wxWindow* GetGridCornerLabelWindow() const { return (wxWindow*)m_cornerLabelWin; }
// Return true if native header is used by the grid.
bool IsUsingNativeHeader() const { return m_useNativeHeader; }
// This one can only be called if we are using the native header window // This one can only be called if we are using the native header window
wxHeaderCtrl *GetGridColHeader() const wxHeaderCtrl *GetGridColHeader() const
{ {

View File

@@ -5373,9 +5373,18 @@ public:
This function can only be called if UseNativeColHeader() had been This function can only be called if UseNativeColHeader() had been
called. called.
@see IsUsingNativeHeader()
*/ */
wxHeaderCtrl *GetGridColHeader() const; wxHeaderCtrl *GetGridColHeader() const;
/**
Return true if native header control is currently being used.
@since 3.1.4
*/
bool IsUsingNativeHeader() const;
//@} //@}