]>
git.saurik.com Git - wxWidgets.git/blob - interface/docmdi.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDocMDIParentFrame and wxDocMDIChildFrame
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxDocMDIParentFrame
13 The wxDocMDIParentFrame class provides a default top-level frame for
14 applications using the document/view framework. This class can only be used
15 for MDI parent frames.
17 It cooperates with the wxView, wxDocument, wxDocManager and wxDocTemplate
23 @see @ref overview_docview, @ref page_samples_docview, wxMDIParentFrame
25 class wxDocMDIParentFrame
: public wxMDIParentFrame
32 wxDocMDIParentFrame();
33 wxDocMDIParentFrame(wxDocManager
* manager
, wxFrame
* parent
,
35 const wxString
& title
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxDEFAULT_FRAME_STYLE
,
39 const wxString
& name
= "frame");
45 ~wxDocMDIParentFrame();
50 bool Create(wxDocManager
* manager
, wxFrame
* parent
,
51 wxWindowID id
, const wxString
& title
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 long style
= wxDEFAULT_FRAME_STYLE
,
55 const wxString
& name
= "frame");
58 Deletes all views and documents. If no user input cancelled the
59 operation, the frame will be destroyed and the application will exit.
61 Since understanding how document/view clean-up takes place can be
62 difficult, the implementation of this function is shown below:
65 void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
67 if (m_docManager->Clear(!event.CanVeto()))
76 void OnCloseWindow(wxCloseEvent
& event
);
82 @class wxDocMDIChildFrame
85 The wxDocMDIChildFrame class provides a default frame for displaying
86 documents on separate windows. This class can only be used for MDI child
89 The class is part of the document/view framework supported by wxWidgets,
90 and cooperates with the wxView, wxDocument, wxDocManager and wxDocTemplate
96 @see @ref overview_docview, @ref page_samples_docview, wxMDIChildFrame
98 class wxDocMDIChildFrame
: public wxMDIChildFrame
104 wxDocMDIChildFrame(wxDocument
* doc
, wxView
* view
,
105 wxFrame
* parent
, wxWindowID id
,
106 const wxString
& title
,
107 const wxPoint
& pos
= wxDefaultPosition
,
108 const wxSize
& size
= wxDefaultSize
,
109 long style
= wxDEFAULT_FRAME_STYLE
,
110 const wxString
& name
= "frame");
115 ~wxDocMDIChildFrame();
118 Returns the document associated with this frame.
120 wxDocument
* GetDocument() const;
123 Returns the view associated with this frame.
125 wxView
* GetView() const;
128 Sets the currently active view to be the frame's view. You may need
129 to override (but still call) this function in order to set the keyboard
130 focus for your subwindow.
132 void OnActivate(wxActivateEvent event
);
135 Closes and deletes the current view and document.
137 void OnCloseWindow(wxCloseEvent
& event
);
140 Sets the document for this frame.
142 void SetDocument(wxDocument
* doc
);
145 Sets the view for this frame.
147 void SetView(wxView
* view
);