don't assign the returned value in wxMDIParentFrame::OnCreateClient() to any member variables, this is the job of the caller (according to documentation and wxMSW code) (modified patch 1910602)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -110,9 +110,11 @@ bool wxAuiMDIParentFrame::Create(wxWindow *parent,
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
wxFrame::Create(parent, id, title, pos, size, style, name);
|
if ( !wxFrame::Create(parent, id, title, pos, size, style, name) )
|
||||||
OnCreateClient();
|
return false;
|
||||||
return true;
|
|
||||||
|
m_pClientWindow = OnCreateClient();
|
||||||
|
return m_pClientWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -252,8 +254,7 @@ wxAuiMDIClientWindow *wxAuiMDIParentFrame::GetClientWindow() const
|
|||||||
|
|
||||||
wxAuiMDIClientWindow *wxAuiMDIParentFrame::OnCreateClient()
|
wxAuiMDIClientWindow *wxAuiMDIParentFrame::OnCreateClient()
|
||||||
{
|
{
|
||||||
m_pClientWindow = new wxAuiMDIClientWindow( this );
|
return new wxAuiMDIClientWindow( this );
|
||||||
return m_pClientWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxAuiMDIParentFrame::ActivateNext()
|
void wxAuiMDIParentFrame::ActivateNext()
|
||||||
|
@@ -95,10 +95,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos, const wxSize& size,
|
||||||
long style, const wxString& name)
|
long style, const wxString& name)
|
||||||
{
|
{
|
||||||
bool success = wxFrame::Create(parent,winid,title,pos,size,style,name);
|
if ( !wxFrame::Create(parent,winid,title,pos,size,style,name) )
|
||||||
if(success)
|
return false;
|
||||||
OnCreateClient();
|
|
||||||
return success;
|
m_clientWindow = OnCreateClient();
|
||||||
|
|
||||||
|
return m_clientWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMDIParentFrame::~wxMDIParentFrame()
|
wxMDIParentFrame::~wxMDIParentFrame()
|
||||||
@@ -145,8 +147,7 @@ wxMDIClientWindow *wxMDIParentFrame::GetClientWindow() const
|
|||||||
|
|
||||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
||||||
{
|
{
|
||||||
m_clientWindow = new wxMDIClientWindow( this );
|
return new wxMDIClientWindow( this );
|
||||||
return m_clientWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::ActivateNext()
|
void wxMDIParentFrame::ActivateNext()
|
||||||
|
@@ -120,11 +120,12 @@ bool wxGenericMDIParentFrame::Create(wxWindow *parent,
|
|||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
if ( !wxFrame::Create( parent, id, title, pos, size, style, name ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
OnCreateClient();
|
m_pClientWindow = OnCreateClient();
|
||||||
|
|
||||||
return true;
|
return m_pClientWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
@@ -248,11 +249,10 @@ wxGenericMDIClientWindow *wxGenericMDIParentFrame::GetClientWindow() const
|
|||||||
wxGenericMDIClientWindow *wxGenericMDIParentFrame::OnCreateClient()
|
wxGenericMDIClientWindow *wxGenericMDIParentFrame::OnCreateClient()
|
||||||
{
|
{
|
||||||
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
||||||
m_pClientWindow = new wxMDIClientWindow( this );
|
return new wxMDIClientWindow( this );
|
||||||
#else
|
#else
|
||||||
m_pClientWindow = new wxGenericMDIClientWindow( this );
|
return new wxGenericMDIClientWindow( this );
|
||||||
#endif
|
#endif
|
||||||
return m_pClientWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericMDIParentFrame::ActivateNext()
|
void wxGenericMDIParentFrame::ActivateNext()
|
||||||
|
@@ -99,11 +99,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
if ( !wxFrame::Create( parent, id, title, pos, size, style, name ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
OnCreateClient();
|
m_clientWindow = OnCreateClient();
|
||||||
|
|
||||||
return true;
|
return m_clientWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::OnInternalIdle()
|
void wxMDIParentFrame::OnInternalIdle()
|
||||||
@@ -246,8 +247,7 @@ wxMDIClientWindow *wxMDIParentFrame::GetClientWindow() const
|
|||||||
|
|
||||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
||||||
{
|
{
|
||||||
m_clientWindow = new wxMDIClientWindow( this );
|
return new wxMDIClientWindow( this );
|
||||||
return m_clientWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::ActivateNext()
|
void wxMDIParentFrame::ActivateNext()
|
||||||
|
@@ -128,11 +128,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
if ( !wxFrame::Create( parent, id, title, pos, size, style, name ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
OnCreateClient();
|
m_clientWindow = OnCreateClient();
|
||||||
|
|
||||||
return true;
|
return m_clientWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
|
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
|
||||||
@@ -290,8 +291,7 @@ wxMDIClientWindow *wxMDIParentFrame::GetClientWindow() const
|
|||||||
|
|
||||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
||||||
{
|
{
|
||||||
m_clientWindow = new wxMDIClientWindow( this );
|
return new wxMDIClientWindow( this );
|
||||||
return m_clientWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::ActivateNext()
|
void wxMDIParentFrame::ActivateNext()
|
||||||
|
@@ -119,12 +119,14 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||||||
m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next"));
|
m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next"));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFrame::Create( parent , id , title , pos , size , style , name ) ;
|
if ( !wxFrame::Create( parent , id , title , pos , size , style , name ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
m_parentFrameActive = true;
|
m_parentFrameActive = true;
|
||||||
|
|
||||||
OnCreateClient();
|
m_clientWindow = OnCreateClient();
|
||||||
|
|
||||||
return true;
|
return m_clientWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMDIParentFrame::~wxMDIParentFrame()
|
wxMDIParentFrame::~wxMDIParentFrame()
|
||||||
@@ -275,9 +277,7 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
|||||||
// just return a new class)
|
// just return a new class)
|
||||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
||||||
{
|
{
|
||||||
m_clientWindow = new wxMDIClientWindow( this );
|
return new wxMDIClientWindow( this );
|
||||||
|
|
||||||
return m_clientWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Responds to colour changes, and passes event on to children.
|
// Responds to colour changes, and passes event on to children.
|
||||||
|
Reference in New Issue
Block a user