1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Frame classes for MDI document/view applications
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "docmdi.h"
19 #include "wx/docview.h"
23 * Use this instead of wxMDIParentFrame
26 class wxDocMDIParentFrame
: public wxMDIParentFrame
28 DECLARE_CLASS(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
= "frame");
34 // Extend event processing to search the document manager's event table
35 virtual bool ProcessEvent(wxEvent
& event
);
37 wxDocManager
*GetDocumentManager(void) const { return m_docManager
; }
39 void OnExit(wxCommandEvent
& event
);
40 void OnMRUFile(wxCommandEvent
& event
);
41 void OnCloseWindow(wxCloseEvent
& event
);
44 wxDocManager
*m_docManager
;
51 * Use this instead of wxMDIChildFrame
54 class WXDLLEXPORT wxDocMDIChildFrame
: public wxMDIChildFrame
56 DECLARE_CLASS(wxDocMDIChildFrame
)
59 wxDocMDIChildFrame(wxDocument
*doc
, wxView
*view
, wxMDIParentFrame
*frame
, wxWindowID id
,
60 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
61 long type
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= "frame");
62 ~wxDocMDIChildFrame(void);
64 // Extend event processing to search the view's event table
65 virtual bool ProcessEvent(wxEvent
& event
);
67 void OnActivate(wxActivateEvent
& event
);
68 void OnCloseWindow(wxCloseEvent
& event
);
70 inline wxDocument
*GetDocument(void) const { return m_childDocument
; }
71 inline wxView
*GetView(void) const { return m_childView
; }
72 inline void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
73 inline void SetView(wxView
*view
) { m_childView
= view
; }
75 wxDocument
* m_childDocument
;