1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Frame classes for MDI document/view applications
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "docmdi.h"
21 #if wxUSE_MDI_ARCHITECTURE
23 #include "wx/docview.h"
27 * Use this instead of wxMDIParentFrame
30 class WXDLLEXPORT wxDocMDIParentFrame
: public wxMDIParentFrame
33 wxDocMDIParentFrame(wxDocManager
*manager
, wxFrame
*parent
, wxWindowID id
,
34 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
37 // Extend event processing to search the document manager's event table
38 virtual bool ProcessEvent(wxEvent
& event
);
40 wxDocManager
*GetDocumentManager(void) const { return m_docManager
; }
42 void OnExit(wxCommandEvent
& event
);
43 void OnMRUFile(wxCommandEvent
& event
);
44 void OnCloseWindow(wxCloseEvent
& event
);
47 wxDocManager
*m_docManager
;
50 DECLARE_CLASS(wxDocMDIParentFrame
)
52 DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame
)
56 * Use this instead of wxMDIChildFrame
59 class WXDLLEXPORT wxDocMDIChildFrame
: public wxMDIChildFrame
62 wxDocMDIChildFrame(wxDocument
*doc
, wxView
*view
, wxMDIParentFrame
*frame
, wxWindowID id
,
63 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
64 long type
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
65 ~wxDocMDIChildFrame();
67 // Extend event processing to search the view's event table
68 virtual bool ProcessEvent(wxEvent
& event
);
70 void OnActivate(wxActivateEvent
& event
);
71 void OnCloseWindow(wxCloseEvent
& event
);
73 inline wxDocument
*GetDocument() const { return m_childDocument
; }
74 inline wxView
*GetView(void) const { return m_childView
; }
75 inline void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
76 inline void SetView(wxView
*view
) { m_childView
= view
; }
77 bool Destroy() { m_childView
= (wxView
*)NULL
; return wxMDIChildFrame::Destroy(); }
80 wxDocument
* m_childDocument
;
85 DECLARE_CLASS(wxDocMDIChildFrame
)
86 DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame
)
90 // wxUSE_MDI_ARCHITECTURE