]> git.saurik.com Git - wxWidgets.git/blob - include/wx/docmdi.h
added wxprec.h
[wxWidgets.git] / include / wx / docmdi.h
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
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "docmdi.h"
17 #endif
18
19 #include "wx/defs.h"
20
21 #if wxUSE_MDI_ARCHITECTURE
22
23 #include "wx/docview.h"
24 #include "wx/mdi.h"
25
26 /*
27 * Use this instead of wxMDIParentFrame
28 */
29
30 class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame
31 {
32 public:
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"));
36
37 // Extend event processing to search the document manager's event table
38 virtual bool ProcessEvent(wxEvent& event);
39
40 wxDocManager *GetDocumentManager(void) const { return m_docManager; }
41
42 void OnExit(wxCommandEvent& event);
43 void OnMRUFile(wxCommandEvent& event);
44 void OnCloseWindow(wxCloseEvent& event);
45
46 protected:
47 wxDocManager *m_docManager;
48
49 private:
50 DECLARE_CLASS(wxDocMDIParentFrame)
51 DECLARE_EVENT_TABLE()
52 DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame)
53 };
54
55 /*
56 * Use this instead of wxMDIChildFrame
57 */
58
59 class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame
60 {
61 public:
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();
66
67 // Extend event processing to search the view's event table
68 virtual bool ProcessEvent(wxEvent& event);
69
70 void OnActivate(wxActivateEvent& event);
71 void OnCloseWindow(wxCloseEvent& event);
72
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(); }
78
79 protected:
80 wxDocument* m_childDocument;
81 wxView* m_childView;
82
83 private:
84 DECLARE_EVENT_TABLE()
85 DECLARE_CLASS(wxDocMDIChildFrame)
86 DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame)
87 };
88
89 #endif
90 // wxUSE_MDI_ARCHITECTURE
91
92 #endif
93 // _WX_DOCMDI_H_