Create wxPGHeaderCtrl in one step

Code simplification - 2-step creation is useless here.
This commit is contained in:
Artur Wieczorek
2019-01-20 18:32:48 +01:00
parent 547db34ce4
commit 4b0d74e04d

View File

@@ -229,8 +229,9 @@ void wxPropertyGridPage::DoSetSplitterPosition( int pos,
class wxPGHeaderCtrl : public wxHeaderCtrl class wxPGHeaderCtrl : public wxHeaderCtrl
{ {
public: public:
wxPGHeaderCtrl(wxPropertyGridManager* manager) : wxPGHeaderCtrl(wxPropertyGridManager* manager, wxWindowID id, const wxPoint& pos,
wxHeaderCtrl() const wxSize& size, long style) :
wxHeaderCtrl(manager, id, pos, size, style)
{ {
m_manager = manager; m_manager = manager;
EnsureColumnCount(2); EnsureColumnCount(2);
@@ -1637,12 +1638,9 @@ void wxPropertyGridManager::RecreateControls()
#if wxUSE_HEADERCTRL #if wxUSE_HEADERCTRL
if ( m_showHeader ) if ( m_showHeader )
{ {
if ( !m_pHeaderCtrl ) if ( !m_pHeaderCtrl )
{ {
wxPGHeaderCtrl* hc = new wxPGHeaderCtrl(this); m_pHeaderCtrl = new wxPGHeaderCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
hc->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
m_pHeaderCtrl = hc;
} }
else else
{ {