]>
Commit | Line | Data |
---|---|---|
2108f33a JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: docmdi.h | |
3 | // Purpose: Frame classes for MDI document/view applications | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_DOCMDI_H_ | |
13 | #define _WX_DOCMDI_H_ | |
14 | ||
af49c4b8 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
2108f33a JS |
16 | #pragma interface "docmdi.h" |
17 | #endif | |
18 | ||
2df7be7f RR |
19 | #include "wx/defs.h" |
20 | ||
76784eec | 21 | #if wxUSE_MDI_ARCHITECTURE && wxUSE_DOC_VIEW_ARCHITECTURE |
2df7be7f | 22 | |
2108f33a JS |
23 | #include "wx/docview.h" |
24 | #include "wx/mdi.h" | |
25 | ||
26 | /* | |
27 | * Use this instead of wxMDIParentFrame | |
28 | */ | |
29 | ||
b597caac | 30 | class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame |
2108f33a JS |
31 | { |
32 | DECLARE_CLASS(wxDocMDIParentFrame) | |
33 | public: | |
f449ef69 JS |
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"); | |
2108f33a | 37 | |
2108f33a JS |
38 | // Extend event processing to search the document manager's event table |
39 | virtual bool ProcessEvent(wxEvent& event); | |
40 | ||
41 | wxDocManager *GetDocumentManager(void) const { return m_docManager; } | |
42 | ||
43 | void OnExit(wxCommandEvent& event); | |
44 | void OnMRUFile(wxCommandEvent& event); | |
387a3b02 | 45 | void OnCloseWindow(wxCloseEvent& event); |
2108f33a JS |
46 | |
47 | protected: | |
48 | wxDocManager *m_docManager; | |
49 | ||
50 | ||
51 | DECLARE_EVENT_TABLE() | |
52 | }; | |
53 | ||
54 | /* | |
55 | * Use this instead of wxMDIChildFrame | |
56 | */ | |
57 | ||
58 | class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame | |
59 | { | |
60 | DECLARE_CLASS(wxDocMDIChildFrame) | |
61 | ||
62 | public: | |
f449ef69 JS |
63 | wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, |
64 | const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
2108f33a JS |
65 | long type = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"); |
66 | ~wxDocMDIChildFrame(void); | |
67 | ||
2108f33a JS |
68 | // Extend event processing to search the view's event table |
69 | virtual bool ProcessEvent(wxEvent& event); | |
70 | ||
71 | void OnActivate(wxActivateEvent& event); | |
387a3b02 | 72 | void OnCloseWindow(wxCloseEvent& event); |
2108f33a JS |
73 | |
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; } | |
b9f933ab | 78 | bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } |
2108f33a JS |
79 | protected: |
80 | wxDocument* m_childDocument; | |
81 | wxView* m_childView; | |
82 | ||
83 | DECLARE_EVENT_TABLE() | |
84 | ||
85 | }; | |
86 | ||
2df7be7f RR |
87 | #endif |
88 | // wxUSE_MDI_ARCHITECTURE | |
76784eec | 89 | |
2108f33a JS |
90 | #endif |
91 | // _WX_DOCMDI_H_ |