Create wxPGHeaderCtrl in one step
Code simplification - 2-step creation is useless here.
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user