Not all implementations of wxMDIChildFrame derive from wxFrame

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2005-04-03 09:24:04 +00:00
parent 4cc52142b8
commit 6def7a17b0
2 changed files with 11 additions and 8 deletions

View File

@ -19,7 +19,7 @@
#if wxUSE_MDI
class WXDLLIMPEXP_CORE wxFrame;
class WXDLLIMPEXP_CORE wxWindow;
class WXDLLIMPEXP_XRC wxMdiXmlHandler : public wxXmlResourceHandler
{
@ -29,7 +29,7 @@ public:
virtual bool CanHandle(wxXmlNode *node);
private:
wxFrame *CreateFrame();
wxWindow *CreateFrame();
DECLARE_DYNAMIC_CLASS(wxMdiXmlHandler)
};

View File

@ -62,13 +62,13 @@ wxMdiXmlHandler::wxMdiXmlHandler() : wxXmlResourceHandler()
AddWindowStyles();
}
wxFrame *wxMdiXmlHandler::CreateFrame()
wxWindow *wxMdiXmlHandler::CreateFrame()
{
if (m_class == wxT("wxMDIParentFrame"))
{
XRC_MAKE_INSTANCE(frame, wxMDIParentFrame);
frame->Create(m_parentAsWindow,
((wxMDIParentFrame*)frame)->Create(m_parentAsWindow,
GetID(),
GetText(wxT("title")),
wxDefaultPosition, wxDefaultSize,
@ -86,7 +86,7 @@ wxFrame *wxMdiXmlHandler::CreateFrame()
XRC_MAKE_INSTANCE(frame, wxMDIChildFrame);
frame->Create(mdiParent,
((wxMDIChildFrame*) frame)->Create(mdiParent,
GetID(),
GetText(wxT("title")),
wxDefaultPosition, wxDefaultSize,
@ -99,14 +99,17 @@ wxFrame *wxMdiXmlHandler::CreateFrame()
wxObject *wxMdiXmlHandler::DoCreateResource()
{
wxFrame *frame = CreateFrame();
wxWindow *frame = CreateFrame();
if (HasParam(wxT("size")))
frame->SetClientSize(GetSize());
if (HasParam(wxT("pos")))
frame->Move(GetPosition());
if (HasParam(wxT("icon")))
frame->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
if (HasParam(wxT("icon")) && frame->IsKindOf(CLASSINFO(wxFrame)))
{
wxFrame* f = wxDynamicCast(f, wxFrame);
f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
}
SetupWindow(frame);