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:
parent
4cc52142b8
commit
6def7a17b0
@ -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)
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user