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