1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Frame classes for MDI document/view applications
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #if wxUSE_MDI_ARCHITECTURE
19 #include "wx/docview.h"
23 * Use this instead of wxMDIParentFrame
26 class WXDLLEXPORT wxDocMDIParentFrame
: public wxMDIParentFrame
29 wxDocMDIParentFrame();
30 wxDocMDIParentFrame(wxDocManager
*manager
, wxFrame
*parent
, wxWindowID id
,
31 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
34 bool Create(wxDocManager
*manager
, wxFrame
*parent
, wxWindowID id
,
35 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
38 // Extend event processing to search the document manager's event table
39 virtual bool ProcessEvent(wxEvent
& event
);
41 wxDocManager
*GetDocumentManager(void) const { return m_docManager
; }
43 void OnExit(wxCommandEvent
& event
);
44 void OnMRUFile(wxCommandEvent
& event
);
45 void OnCloseWindow(wxCloseEvent
& event
);
49 wxDocManager
*m_docManager
;
52 DECLARE_CLASS(wxDocMDIParentFrame
)
54 DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame
)
58 * Use this instead of wxMDIChildFrame
61 class WXDLLEXPORT wxDocMDIChildFrame
: public wxMDIChildFrame
65 wxDocMDIChildFrame(wxDocument
*doc
, wxView
*view
, wxMDIParentFrame
*frame
, wxWindowID id
,
66 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
67 long type
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
68 ~wxDocMDIChildFrame();
70 bool Create(wxDocument
*doc
,
72 wxMDIParentFrame
*frame
,
74 const wxString
& title
,
75 const wxPoint
& pos
= wxDefaultPosition
,
76 const wxSize
& size
= wxDefaultSize
,
77 long type
= wxDEFAULT_FRAME_STYLE
,
78 const wxString
& name
= wxFrameNameStr
);
80 // Extend event processing to search the view's event table
81 virtual bool ProcessEvent(wxEvent
& event
);
83 void OnActivate(wxActivateEvent
& event
);
84 void OnCloseWindow(wxCloseEvent
& event
);
86 inline wxDocument
*GetDocument() const { return m_childDocument
; }
87 inline wxView
*GetView(void) const { return m_childView
; }
88 inline void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
89 inline void SetView(wxView
*view
) { m_childView
= view
; }
90 bool Destroy() { m_childView
= (wxView
*)NULL
; return wxMDIChildFrame::Destroy(); }
94 wxDocument
* m_childDocument
;
99 DECLARE_CLASS(wxDocMDIChildFrame
)
100 DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame
)
104 // wxUSE_MDI_ARCHITECTURE