From 75799719334c85392638ce5c7d0e90a8b74b7e5a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Jul 2003 23:25:27 +0000 Subject: [PATCH] 2 step creation for wxDocMDIChildFrame (patch 661657) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/docmdi.h | 12 ++++++++++++ src/common/docmdi.cpp | 26 ++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/include/wx/docmdi.h b/include/wx/docmdi.h index cd9b1d9b74..973f16f5fb 100644 --- a/include/wx/docmdi.h +++ b/include/wx/docmdi.h @@ -59,11 +59,22 @@ private: class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame { public: + wxDocMDIChildFrame(); wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); ~wxDocMDIChildFrame(); + bool Create(wxDocument *doc, + wxView *view, + wxMDIParentFrame *frame, + wxWindowID id, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long type = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr); + // Extend event processing to search the view's event table virtual bool ProcessEvent(wxEvent& event); @@ -77,6 +88,7 @@ public: bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } protected: + void Init(); wxDocument* m_childDocument; wxView* m_childView; diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp index 2c7f79268a..4a9857983f 100644 --- a/src/common/docmdi.cpp +++ b/src/common/docmdi.cpp @@ -87,14 +87,36 @@ BEGIN_EVENT_TABLE(wxDocMDIChildFrame, wxMDIChildFrame) EVT_CLOSE(wxDocMDIChildFrame::OnCloseWindow) END_EVENT_TABLE() +void wxDocMDIChildFrame::Init() +{ + m_childDocument = (wxDocument*) NULL; + m_childView = (wxView*) NULL; +} + +wxDocMDIChildFrame::wxDocMDIChildFrame() +{ + Init(); +} + wxDocMDIChildFrame::wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, - const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): - wxMDIChildFrame(frame, id, title, pos, size, style, name) + const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) +{ + Init(); + Create(doc, view, frame, id, title, pos, size, style, name); +} + +bool wxDocMDIChildFrame::Create(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, + const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { m_childDocument = doc; m_childView = view; + if (wxMDIChildFrame::Create(frame, id, title, pos, size, style, name)) { if (view) view->SetFrame(this); + return TRUE; + } + + return FALSE; } wxDocMDIChildFrame::~wxDocMDIChildFrame(void) -- 2.45.2