// Author: Hans Van Leemputten
// Modified by: Benjamin I. Williams / Kirix Corporation
// Created: 29/07/2002
-// RCS-ID: $Id$
// Copyright: (c) Hans Van Leemputten
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxAuiMDIChildFrame *wxAuiMDIParentFrame::GetActiveChild() const
{
- return GetClientWindow()->GetActiveChild();
+ // We can be called before the client window is created, so check for its
+ // existence.
+ wxAuiMDIClientWindow* const client = GetClientWindow();
+ return client ? client->GetActiveChild() : NULL;
}
void wxAuiMDIParentFrame::SetActiveChild(wxAuiMDIChildFrame* pChildFrame)
{
- if (GetClientWindow()->GetActiveChild() != pChildFrame)
+ wxAuiMDIClientWindow* const client = GetClientWindow();
+ if (client && client->GetActiveChild() != pChildFrame)
{
- GetClientWindow()->SetActiveChild(pChildFrame);
+ client->SetActiveChild(pChildFrame);
}
}