Explicitly create all sub-controls in wxPropertyGridManager::Create()
Instead of deferring creation of wxPropertyGrid and other controls to EVT_SIZE handler we can create them when wxPropertyGridManager is created and its initial size is known. This way we can avoid using a trick with magic number used as a flag to determine when to create all controls in OnResize(). Closes #24171.
This commit is contained in:
parent
94252d84b1
commit
b681a80b96
1 changed files with 2 additions and 6 deletions
|
|
@ -634,6 +634,8 @@ bool wxPropertyGridManager::Create( wxWindow *parent,
|
|||
Init2(style);
|
||||
|
||||
SetInitialSize(size);
|
||||
// Create controls
|
||||
RecreateControls();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
@ -763,9 +765,6 @@ void wxPropertyGridManager::Init2( int style )
|
|||
// (see wxPropertyGridManager::ProcessEvent).
|
||||
ReconnectEventHandlers(wxID_NONE, m_pPropGrid->GetId());
|
||||
|
||||
// Optional initial controls.
|
||||
m_width = -12345;
|
||||
|
||||
m_iFlags |= wxPG_MAN_FL_INITIALIZED;
|
||||
|
||||
}
|
||||
|
|
@ -2149,9 +2148,6 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) )
|
|||
|
||||
GetClientSize(&width, &height);
|
||||
|
||||
if ( m_width == -12345 )
|
||||
RecreateControls();
|
||||
|
||||
RecalculatePositions(width, height);
|
||||
|
||||
if ( m_pPropGrid && m_pPropGrid->GetParent() )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue