The view class can be used to model the viewing and editing component of
an application's file-based data. It is part of the document/view framework supported by wxWindows,
-and cooperates with the \helpref{wxDocument}{wxdocument}, \helpref{wxDocTemplate}{wxdoctemplate}
+and cooperates with the \helpref{wxDocument}{wxdocument}, \helpref{wxDocTemplate}{wxdoctemplate}
and \helpref{wxDocManager}{wxdocmanager} classes.
\wxheading{Derived from}
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
+\wxheading{Include files}
+
+<wx/docview.h>
+
\wxheading{See also}
\helpref{wxView overview}{wxviewoverview}, \helpref{wxDocument}{wxdocument}, \helpref{wxDocTemplate}{wxdoctemplate},\rtfsp
\membersection{wxView::wxView}
-\func{}{wxView}{\param{wxDocument* }{doc = NULL}}
+\func{}{wxView}{\void}
Constructor. Define your own default constructor to initialize application-specific
data.
to close the associated document. Does not delete the view. The application
may wish to do some cleaning up operations in this function, {\it if} a
call to wxDocument::Close succeeded. For example, if your application's
-all share the same canvas, you need to disassociate the canvas from the view
-and perhaps clear the canvas. If {\it deleteWindow} is TRUE, delete the
+all share the same window, you need to disassociate the window from the view
+and perhaps clear the window. If {\it deleteWindow} is TRUE, delete the
frame associated with the view.
+\membersection{wxView::OnClosingDocument}\label{wxviewonclosingdocument}
+
+\func{virtual void}{OnClosingDoocument}{\void}
+
+Override this to clean up the view when the document is being
+closed.
+
\membersection{wxView::OnCreate}
\func{virtual bool}{OnCreate}{\param{wxDocument* }{doc}, \param{long}{ flags}}
-Called just after view construction to give the view a chance to initialize
-itself based on the passed document and flags (unused). By default, simply
-returns TRUE. If the function returns FALSE, the view will be deleted.
+wxDocManager or wxDocument creates a wxView via a wxDocTemplate.
+Just after the wxDocTemplate creates the wxView, it calls
+wxView::OnCreate. In its OnCreate member function, the wxView can create a wxDocChildFrame
+or a derived class. This wxDocChildFrame provides user interface
+elements to view and/or edit the contents of the wxDocument.
-The predefined document child frame, wxDocChildFrame, calls this function
-automatically.
+By default, simply returns TRUE. If the function returns FALSE, the
+view will be deleted.
\membersection{wxView::OnCreatePrintout}
If the printing framework is enabled in the library, this function returns a
\rtfsp\helpref{wxPrintout}{wxprintout} object for the purposes of printing. It should create a new object
-everytime it is called; the framework will delete objects it creates.
+every time it is called; the framework will delete objects it creates.
By default, this function returns an instance of wxDocPrintout, which prints
and previews one page by calling wxView::OnDraw.