1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Frame classes for MDI document/view applications
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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();
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
= wxT("frame"));
38 bool Create(wxDocManager
*manager
, wxFrame
*parent
, wxWindowID id
,
39 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
42 // Extend event processing to search the document manager's event table
43 virtual bool ProcessEvent(wxEvent
& event
);
45 wxDocManager
*GetDocumentManager(void) const { return m_docManager
; }
47 void OnExit(wxCommandEvent
& event
);
48 void OnMRUFile(wxCommandEvent
& event
);
49 void OnCloseWindow(wxCloseEvent
& event
);
53 wxDocManager
*m_docManager
;
56 DECLARE_CLASS(wxDocMDIParentFrame
)
58 DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame
)
62 * Use this instead of wxMDIChildFrame
65 class WXDLLEXPORT wxDocMDIChildFrame
: public wxMDIChildFrame
69 wxDocMDIChildFrame(wxDocument
*doc
, wxView
*view
, wxMDIParentFrame
*frame
, wxWindowID id
,
70 const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
71 long type
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxT("frame"));
72 ~wxDocMDIChildFrame();
74 bool Create(wxDocument
*doc
,
76 wxMDIParentFrame
*frame
,
78 const wxString
& title
,
79 const wxPoint
& pos
= wxDefaultPosition
,
80 const wxSize
& size
= wxDefaultSize
,
81 long type
= wxDEFAULT_FRAME_STYLE
,
82 const wxString
& name
= wxFrameNameStr
);
84 // Extend event processing to search the view's event table
85 virtual bool ProcessEvent(wxEvent
& event
);
87 void OnActivate(wxActivateEvent
& event
);
88 void OnCloseWindow(wxCloseEvent
& event
);
90 inline wxDocument
*GetDocument() const { return m_childDocument
; }
91 inline wxView
*GetView(void) const { return m_childView
; }
92 inline void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
93 inline void SetView(wxView
*view
) { m_childView
= view
; }
94 bool Destroy() { m_childView
= (wxView
*)NULL
; return wxMDIChildFrame::Destroy(); }
98 wxDocument
* m_childDocument
;
102 DECLARE_EVENT_TABLE()
103 DECLARE_CLASS(wxDocMDIChildFrame
)
104 DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame
)
108 // wxUSE_MDI_ARCHITECTURE