]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_mdi.cpp
ignore hidden windows when deciding if the MDI parent frame should be visible
[wxWidgets.git] / src / xrc / xh_mdi.cpp
index 21010352f700e1c97eb8c9f9010ea3cbf240d949..7a581f80779374a2f9118030aabc84047d82b3e6 100644 (file)
@@ -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));
+        wxFrame* f = wxDynamicCast(frame, wxFrame);
+        if (f)
+            f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
     }
 
     SetupWindow(frame);