]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_mdi.cpp
don't expect errno to be set to EOVERFLOW if vsnprintf() fails
[wxWidgets.git] / src / xrc / xh_mdi.cpp
index a290dd923a66ce7f20fee877af3a08c2c1d715f8..5838d7c28814ea79d3928a2d7756daf09e4c1659 100644 (file)
@@ -8,10 +8,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "xh_mdi.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -62,7 +58,7 @@ wxMdiXmlHandler::wxMdiXmlHandler() : wxXmlResourceHandler()
     AddWindowStyles();
 }
 
-wxFrame *wxMdiXmlHandler::CreateFrame()
+wxWindow *wxMdiXmlHandler::CreateFrame()
 {
     if (m_class == wxT("wxMDIParentFrame"))
     {
@@ -99,14 +95,18 @@ 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));
+    {
+        wxFrame* f = wxDynamicCast(frame, wxFrame);
+        if (f)
+            f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
+    }
 
     SetupWindow(frame);