]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/docmdi.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDocMDIParentFrame and wxDocMDIChildFrame
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxDocMDIParentFrame
12 The wxDocMDIParentFrame class provides a default top-level frame for
13 applications using the document/view framework. This class can only be used
14 for MDI parent frames.
16 It cooperates with the wxView, wxDocument, wxDocManager and wxDocTemplate
22 @see @ref overview_docview, @ref page_samples_docview, wxMDIParentFrame
24 class wxDocMDIParentFrame
: public wxMDIParentFrame
31 wxDocMDIParentFrame();
32 wxDocMDIParentFrame(wxDocManager
* manager
, wxFrame
* parent
,
34 const wxString
& title
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxDEFAULT_FRAME_STYLE
,
38 const wxString
& name
= wxFrameNameStr
);
44 virtual ~wxDocMDIParentFrame();
49 bool Create(wxDocManager
* manager
, wxFrame
* parent
,
50 wxWindowID id
, const wxString
& title
,
51 const wxPoint
& pos
= wxDefaultPosition
,
52 const wxSize
& size
= wxDefaultSize
,
53 long style
= wxDEFAULT_FRAME_STYLE
,
54 const wxString
& name
= wxFrameNameStr
);
57 Deletes all views and documents. If no user input cancelled the
58 operation, the frame will be destroyed and the application will exit.
60 Since understanding how document/view clean-up takes place can be
61 difficult, the implementation of this function is shown below:
64 void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
66 if (m_docManager->Clear(!event.CanVeto()))
75 void OnCloseWindow(wxCloseEvent
& event
);
81 @class wxDocMDIChildFrame
83 The wxDocMDIChildFrame class provides a default frame for displaying
84 documents on separate windows. This class can only be used for MDI child
87 The class is part of the document/view framework supported by wxWidgets,
88 and cooperates with the wxView, wxDocument, wxDocManager and wxDocTemplate
94 @see @ref overview_docview, @ref page_samples_docview, wxMDIChildFrame
96 class wxDocMDIChildFrame
: public wxMDIChildFrame
102 wxDocMDIChildFrame(wxDocument
* doc
, wxView
* view
,
103 wxMDIParentFrame
* parent
, wxWindowID id
,
104 const wxString
& title
,
105 const wxPoint
& pos
= wxDefaultPosition
,
106 const wxSize
& size
= wxDefaultSize
,
107 long style
= wxDEFAULT_FRAME_STYLE
,
108 const wxString
& name
= wxFrameNameStr
);
113 virtual ~wxDocMDIChildFrame();
116 Returns the document associated with this frame.
118 wxDocument
* GetDocument() const;
121 Returns the view associated with this frame.
123 wxView
* GetView() const;
126 Sets the currently active view to be the frame's view. You may need
127 to override (but still call) this function in order to set the keyboard
128 focus for your subwindow.
130 void OnActivate(wxActivateEvent
& event
);
133 Closes and deletes the current view and document.
135 void OnCloseWindow(wxCloseEvent
& event
);
138 Sets the document for this frame.
140 void SetDocument(wxDocument
* doc
);
143 Sets the view for this frame.
145 void SetView(wxView
* view
);