]> git.saurik.com Git - wxWidgets.git/blame - include/wx/docmdi.h
MacReopenApp implementation for restoring top-level window
[wxWidgets.git] / include / wx / docmdi.h
CommitLineData
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)
65571936 9// Licence: wxWindows licence
2108f33a
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DOCMDI_H_
13#define _WX_DOCMDI_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
2108f33a
JS
16#pragma interface "docmdi.h"
17#endif
18
2df7be7f
RR
19#include "wx/defs.h"
20
e30285ab 21#if wxUSE_MDI_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 30class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame
2108f33a 31{
2b5f62a0 32public:
f0003d29 33 wxDocMDIParentFrame();
2b5f62a0
VZ
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"));
2108f33a 37
f0003d29
JS
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
2b5f62a0
VZ
42 // Extend event processing to search the document manager's event table
43 virtual bool ProcessEvent(wxEvent& event);
2108f33a 44
2b5f62a0 45 wxDocManager *GetDocumentManager(void) const { return m_docManager; }
2108f33a 46
2b5f62a0
VZ
47 void OnExit(wxCommandEvent& event);
48 void OnMRUFile(wxCommandEvent& event);
49 void OnCloseWindow(wxCloseEvent& event);
2108f33a 50
2b5f62a0 51protected:
f0003d29 52 void Init();
2b5f62a0 53 wxDocManager *m_docManager;
2108f33a 54
2b5f62a0
VZ
55private:
56 DECLARE_CLASS(wxDocMDIParentFrame)
57 DECLARE_EVENT_TABLE()
22f3361e 58 DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame)
2108f33a
JS
59};
60
61/*
62 * Use this instead of wxMDIChildFrame
63 */
64
65class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame
66{
2b5f62a0 67public:
75799719 68 wxDocMDIChildFrame();
2b5f62a0
VZ
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
75799719
VZ
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
2b5f62a0
VZ
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
96protected:
75799719 97 void Init();
2b5f62a0
VZ
98 wxDocument* m_childDocument;
99 wxView* m_childView;
100
101private:
102 DECLARE_EVENT_TABLE()
103 DECLARE_CLASS(wxDocMDIChildFrame)
22f3361e 104 DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame)
2108f33a
JS
105};
106
2df7be7f
RR
107#endif
108 // wxUSE_MDI_ARCHITECTURE
76784eec 109
2108f33a
JS
110#endif
111 // _WX_DOCMDI_H_