]> git.saurik.com Git - wxWidgets.git/blob - include/wx/docmdi.h
Fixed Fontdialog
[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 #ifdef __GNUG__
16 #pragma interface "docmdi.h"
17 #endif
18
19 #include "wx/docview.h"
20 #include "wx/mdi.h"
21
22 /*
23 * Use this instead of wxMDIParentFrame
24 */
25
26 class wxDocMDIParentFrame: public wxMDIParentFrame
27 {
28 DECLARE_CLASS(wxDocMDIParentFrame)
29 public:
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");
33
34 bool OnClose(void);
35 // Extend event processing to search the document manager's event table
36 virtual bool ProcessEvent(wxEvent& event);
37
38 wxDocManager *GetDocumentManager(void) const { return m_docManager; }
39
40 void OnExit(wxCommandEvent& event);
41 void OnMRUFile(wxCommandEvent& event);
42
43 protected:
44 wxDocManager *m_docManager;
45
46
47 DECLARE_EVENT_TABLE()
48 };
49
50 /*
51 * Use this instead of wxMDIChildFrame
52 */
53
54 class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame
55 {
56 DECLARE_CLASS(wxDocMDIChildFrame)
57
58 public:
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);
63
64 bool OnClose(void);
65 // Extend event processing to search the view's event table
66 virtual bool ProcessEvent(wxEvent& event);
67
68 void OnActivate(wxActivateEvent& event);
69
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; }
74 protected:
75 wxDocument* m_childDocument;
76 wxView* m_childView;
77
78 DECLARE_EVENT_TABLE()
79
80 };
81
82 #endif
83 // _WX_DOCMDI_H_