2 step creation for wxDocMDIChildFrame (patch 661657)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-07-09 23:25:27 +00:00
parent 0e82bd9614
commit 7579971933
2 changed files with 36 additions and 2 deletions

View File

@@ -59,11 +59,22 @@ private:
class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame
{ {
public: public:
wxDocMDIChildFrame();
wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id,
const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame"));
~wxDocMDIChildFrame(); ~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 // Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
@@ -77,6 +88,7 @@ public:
bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); }
protected: protected:
void Init();
wxDocument* m_childDocument; wxDocument* m_childDocument;
wxView* m_childView; wxView* m_childView;

View File

@@ -87,14 +87,36 @@ BEGIN_EVENT_TABLE(wxDocMDIChildFrame, wxMDIChildFrame)
EVT_CLOSE(wxDocMDIChildFrame::OnCloseWindow) EVT_CLOSE(wxDocMDIChildFrame::OnCloseWindow)
END_EVENT_TABLE() 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, wxDocMDIChildFrame::wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id,
const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name)
wxMDIChildFrame(frame, id, title, pos, size, style, 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_childDocument = doc;
m_childView = view; m_childView = view;
if (wxMDIChildFrame::Create(frame, id, title, pos, size, style, name)) {
if (view) if (view)
view->SetFrame(this); view->SetFrame(this);
return TRUE;
}
return FALSE;
} }
wxDocMDIChildFrame::~wxDocMDIChildFrame(void) wxDocMDIChildFrame::~wxDocMDIChildFrame(void)