]>
Commit | Line | Data |
---|---|---|
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(NO_GCC_PRAGMA) | |
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(); | |
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")); | |
37 | ||
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")); | |
41 | ||
42 | // Extend event processing to search the document manager's event table | |
43 | virtual bool ProcessEvent(wxEvent& event); | |
44 | ||
45 | wxDocManager *GetDocumentManager(void) const { return m_docManager; } | |
46 | ||
47 | void OnExit(wxCommandEvent& event); | |
48 | void OnMRUFile(wxCommandEvent& event); | |
49 | void OnCloseWindow(wxCloseEvent& event); | |
50 | ||
51 | protected: | |
52 | void Init(); | |
53 | wxDocManager *m_docManager; | |
54 | ||
55 | private: | |
56 | DECLARE_CLASS(wxDocMDIParentFrame) | |
57 | DECLARE_EVENT_TABLE() | |
58 | DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame) | |
59 | }; | |
60 | ||
61 | /* | |
62 | * Use this instead of wxMDIChildFrame | |
63 | */ | |
64 | ||
65 | class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame | |
66 | { | |
67 | public: | |
68 | wxDocMDIChildFrame(); | |
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(); | |
73 | ||
74 | bool Create(wxDocument *doc, | |
75 | wxView *view, | |
76 | wxMDIParentFrame *frame, | |
77 | wxWindowID id, | |
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); | |
83 | ||
84 | // Extend event processing to search the view's event table | |
85 | virtual bool ProcessEvent(wxEvent& event); | |
86 | ||
87 | void OnActivate(wxActivateEvent& event); | |
88 | void OnCloseWindow(wxCloseEvent& event); | |
89 | ||
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(); } | |
95 | ||
96 | protected: | |
97 | void Init(); | |
98 | wxDocument* m_childDocument; | |
99 | wxView* m_childView; | |
100 | ||
101 | private: | |
102 | DECLARE_EVENT_TABLE() | |
103 | DECLARE_CLASS(wxDocMDIChildFrame) | |
104 | DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame) | |
105 | }; | |
106 | ||
107 | #endif | |
108 | // wxUSE_MDI_ARCHITECTURE | |
109 | ||
110 | #endif | |
111 | // _WX_DOCMDI_H_ |