From 8a0dc9ecdbd8e64be6df61c37ee3bee0b7e944ae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Sep 2015 00:35:47 +0200 Subject: [PATCH] Implement wxCollapsibleHeaderCtrlBase::Create() This method was declared but not implemented, so do implement it and delegate to it from wxGenericCollapsibleHeaderCtrl::Create(). --- include/wx/collheaderctrl.h | 10 +++++++++- src/generic/collheaderctrlg.cpp | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/wx/collheaderctrl.h b/include/wx/collheaderctrl.h index 27997b287d..4acfe69548 100644 --- a/include/wx/collheaderctrl.h +++ b/include/wx/collheaderctrl.h @@ -47,7 +47,15 @@ public: const wxSize& size = wxDefaultSize, long style = wxBORDER_NONE, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCollapsibleHeaderCtrlNameStr); + const wxString& name = wxCollapsibleHeaderCtrlNameStr) + { + if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) + return false; + + SetLabel(label); + + return true; + } virtual void SetCollapsed(bool collapsed = true) = 0; diff --git a/src/generic/collheaderctrlg.cpp b/src/generic/collheaderctrlg.cpp index 08105d7853..ac5527a312 100644 --- a/src/generic/collheaderctrlg.cpp +++ b/src/generic/collheaderctrlg.cpp @@ -57,10 +57,11 @@ bool wxGenericCollapsibleHeaderCtrl::Create(wxWindow *parent, const wxValidator& validator, const wxString& name) { - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) + if ( !wxCollapsibleHeaderCtrlBase::Create(parent, id, label, pos, size, + style, validator, name) ) + { return false; - - SetLabel(label); + } Bind(wxEVT_PAINT, &wxGenericCollapsibleHeaderCtrl::OnPaint, this); Bind(wxEVT_LEFT_DOWN, &wxGenericCollapsibleHeaderCtrl::OnLeftDown, this);