X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6def7a17b01a15e68696a1863d114ecc5554e3d4..c9698388a2d5833699ad3d8f698e0be151e6837b:/src/xrc/xh_mdi.cpp diff --git a/src/xrc/xh_mdi.cpp b/src/xrc/xh_mdi.cpp index 21010352f7..980367b19d 100644 --- a/src/xrc/xh_mdi.cpp +++ b/src/xrc/xh_mdi.cpp @@ -68,7 +68,7 @@ wxWindow *wxMdiXmlHandler::CreateFrame() { XRC_MAKE_INSTANCE(frame, wxMDIParentFrame); - ((wxMDIParentFrame*)frame)->Create(m_parentAsWindow, + frame->Create(m_parentAsWindow, GetID(), GetText(wxT("title")), wxDefaultPosition, wxDefaultSize, @@ -86,7 +86,7 @@ wxWindow *wxMdiXmlHandler::CreateFrame() XRC_MAKE_INSTANCE(frame, wxMDIChildFrame); - ((wxMDIChildFrame*) frame)->Create(mdiParent, + frame->Create(mdiParent, GetID(), GetText(wxT("title")), wxDefaultPosition, wxDefaultSize, @@ -105,10 +105,11 @@ wxObject *wxMdiXmlHandler::DoCreateResource() frame->SetClientSize(GetSize()); if (HasParam(wxT("pos"))) frame->Move(GetPosition()); - if (HasParam(wxT("icon")) && frame->IsKindOf(CLASSINFO(wxFrame))) + if (HasParam(wxT("icon"))) { wxFrame* f = wxDynamicCast(f, wxFrame); - f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); + if (f) + f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); } SetupWindow(frame);