1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Frame classes for MDI document/view applications
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "docmdi.h"
21 #if wxUSE_MDI_ARCHITECTURE && wxUSE_DOC_VIEW_ARCHITECTURE
23 #include "wx/docview.h"
27 * Use this instead of wxMDIParentFrame
30 class WXDLLEXPORT wxDocMDIParentFrame
: public wxMDIParentFrame
32 DECLARE_CLASS(wxDocMDIParentFrame
)
34 wxDocMDIParentFrame(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
= "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
);
48 wxDocManager
*m_docManager
;
55 * Use this instead of wxMDIChildFrame
58 class WXDLLEXPORT wxDocMDIChildFrame
: public wxMDIChildFrame
60 DECLARE_CLASS(wxDocMDIChildFrame
)
63 wxDocMDIChildFrame(wxDocument
*doc
, wxView
*view
, wxMDIParentFrame
*frame
, wxWindowID id
,
64 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
65 long type
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= "frame");
66 ~wxDocMDIChildFrame(void);
68 // Extend event processing to search the view's event table
69 virtual bool ProcessEvent(wxEvent
& event
);
71 void OnActivate(wxActivateEvent
& event
);
72 void OnCloseWindow(wxCloseEvent
& event
);
74 inline wxDocument
*GetDocument(void) const { return m_childDocument
; }
75 inline wxView
*GetView(void) const { return m_childView
; }
76 inline void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
77 inline void SetView(wxView
*view
) { m_childView
= view
; }
78 bool Destroy() { m_childView
= (wxView
*)NULL
; return wxFrame::Destroy(); }
80 wxDocument
* m_childDocument
;
88 // wxUSE_MDI_ARCHITECTURE