projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wxXXChoiceDialog documentation fixes
[wxWidgets.git]
/
docs
/
latex
/
wx
/
document.tex
diff --git
a/docs/latex/wx/document.tex
b/docs/latex/wx/document.tex
index f75183c29363825384f16b89b6370ab811a58bac..49cb5f9caab95328ba473e22b4dd4cd4b8c97789 100644
(file)
--- a/
docs/latex/wx/document.tex
+++ b/
docs/latex/wx/document.tex
@@
-1,7
+1,7
@@
\section{\class{wxDocument}}\label{wxdocument}
The document class can be used to model an application's file-based
\section{\class{wxDocument}}\label{wxdocument}
The document class can be used to model an application's file-based
-data. It is part of the document/view framework supported by wxWi
ndow
s,
+data. It is part of the document/view framework supported by wxWi
dget
s,
and cooperates with the \helpref{wxView}{wxview}, \helpref{wxDocTemplate}{wxdoctemplate}\rtfsp
and \helpref{wxDocManager}{wxdocmanager} classes.
and cooperates with the \helpref{wxView}{wxview}, \helpref{wxDocTemplate}{wxdoctemplate}\rtfsp
and \helpref{wxDocManager}{wxdocmanager} classes.
@@
-10,6
+10,10
@@
and \helpref{wxDocManager}{wxdocmanager} classes.
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
+\wxheading{Include files}
+
+<wx/docview.h>
+
\wxheading{See also}
\helpref{wxDocument overview}{wxdocumentoverview}, \helpref{wxView}{wxview},\rtfsp
\wxheading{See also}
\helpref{wxDocument overview}{wxdocumentoverview}, \helpref{wxView}{wxview},\rtfsp
@@
-33,7
+37,7
@@
Filename associated with this document (``" if none).
\member{bool}{m\_documentModified}
\member{bool}{m\_documentModified}
-
TRUE if the document has been modified, FALSE
otherwise.
+
true if the document has been modified, false
otherwise.
\membersection{wxDocument::m\_documentTemplate}
\membersection{wxDocument::m\_documentTemplate}
@@
-88,7
+92,7
@@
If the view is not already in the list of views, adds the view and calls OnChang
\func{virtual bool}{Close}{\void}
\func{virtual bool}{Close}{\void}
-Closes the document, by calling OnSaveModified and then (if this returned
TRUE
) OnCloseDocument.
+Closes the document, by calling OnSaveModified and then (if this returned
true
) OnCloseDocument.
This does not normally delete the document object: use DeleteAllViews to do this implicitly.
\membersection{wxDocument::DeleteAllViews}
This does not normally delete the document object: use DeleteAllViews to do this implicitly.
\membersection{wxDocument::DeleteAllViews}
@@
-137,16
+141,18
@@
dialog boxes. By default, uses the frame associated with the first view.
\constfunc{wxString}{GetFilename}{\void}
\constfunc{wxString}{GetFilename}{\void}
-Gets the filename associated with this document, or
NULL
if none is
+Gets the filename associated with this document, or
""
if none is
associated.
associated.
-\membersection{wxDocument::GetFirstView}
+\membersection{wxDocument::GetFirstView}
\label{wxdocumentgetfirstview}
-\constfunc{wxView*}{GetFirstView}{\void}
+\constfunc{wxView
*}{GetFirstView}{\void}
A convenience function to get the first view for a document, because
in many cases a document will only have a single view.
A convenience function to get the first view for a document, because
in many cases a document will only have a single view.
+See also: \helpref{GetViews}{wxdocumentgetviews}
+
\membersection{wxDocument::GetPrintableName}
\constfunc{virtual void}{GetPrintableName}{\param{wxString\& }{name}}
\membersection{wxDocument::GetPrintableName}
\constfunc{virtual void}{GetPrintableName}{\param{wxString\& }{name}}
@@
-155,6
+161,9
@@
Copies a suitable document name into the supplied {\it name} buffer. The default
function uses the title, or if there is no title, uses the filename; or if no
filename, the string {\bf unnamed}.
function uses the title, or if there is no title, uses the filename; or if no
filename, the string {\bf unnamed}.
+\perlnote{In wxPerl this function must return the modified name rather
+than just modifying the argument.}
+
\membersection{wxDocument::GetTitle}
\constfunc{wxString}{GetTitle}{\void}
\membersection{wxDocument::GetTitle}
\constfunc{wxString}{GetTitle}{\void}
@@
-163,11
+172,19
@@
Gets the title for this document. The document title is used for an associated
frame (if any), and is usually constructed by the framework from
the filename.
frame (if any), and is usually constructed by the framework from
the filename.
+\membersection{wxDocument::GetViews}\label{wxdocumentgetviews}
+
+\constfunc{wxList \&}{GetViews}{\void}
+
+Returns the list whose elements are the views on the document.
+
+See also: \helpref{GetFirstView}{wxdocumentgetfirstview}
+
\membersection{wxDocument::IsModified}\label{wxdocumentismodified}
\constfunc{virtual bool}{IsModified}{\void}
\membersection{wxDocument::IsModified}\label{wxdocumentismodified}
\constfunc{virtual bool}{IsModified}{\void}
-Returns
TRUE if the document has been modified since the last save, FALSE
otherwise.
+Returns
true if the document has been modified since the last save, false
otherwise.
You may need to override this if your document view maintains its own
record of being modified (for example if using wxTextWindow to view and edit the document).
You may need to override this if your document view maintains its own
record of being modified (for example if using wxTextWindow to view and edit the document).
@@
-177,15
+194,20
@@
See also \helpref{Modify}{wxdocumentmodify}.
\func{virtual istream\&}{LoadObject}{\param{istream\& }{stream}}
\func{virtual istream\&}{LoadObject}{\param{istream\& }{stream}}
+\func{virtual wxInputStream\&}{LoadObject}{\param{wxInputStream\& }{stream}}
+
Override this function and call it from your own LoadObject before
streaming your own data. LoadObject is called by the framework
automatically when the document contents need to be loaded.
Override this function and call it from your own LoadObject before
streaming your own data. LoadObject is called by the framework
automatically when the document contents need to be loaded.
+Note that only one of these forms exists, depending on how wxWidgets
+was configured.
+
\membersection{wxDocument::Modify}\label{wxdocumentmodify}
\func{virtual void}{Modify}{\param{bool}{ modify}}
\membersection{wxDocument::Modify}\label{wxdocumentmodify}
\func{virtual void}{Modify}{\param{bool}{ modify}}
-Call with
TRUE to mark the document as modified since the last save, FALSE
otherwise.
+Call with
true to mark the document as modified since the last save, false
otherwise.
You may need to override this if your document view maintains its own
record of being modified (for example if using wxTextWindow to view and edit the document).
You may need to override this if your document view maintains its own
record of being modified (for example if using wxTextWindow to view and edit the document).
@@
-204,7
+226,7
@@
one has just been removed).
\func{virtual bool}{OnCloseDocument}{\void}
The default implementation calls DeleteContents (an empty implementation)
\func{virtual bool}{OnCloseDocument}{\void}
The default implementation calls DeleteContents (an empty implementation)
-sets the modified flag to
FALSE
. Override this to
+sets the modified flag to
false
. Override this to
supply additional behaviour when the document is closed with Close.
\membersection{wxDocument::OnCreate}
supply additional behaviour when the document is closed with Close.
\membersection{wxDocument::OnCreate}
@@
-214,7
+236,7
@@
supply additional behaviour when the document is closed with Close.
Called just after the document object is created to give it a chance
to initialize itself. The default implementation uses the
template associated with the document to create an initial view.
Called just after the document object is created to give it a chance
to initialize itself. The default implementation uses the
template associated with the document to create an initial view.
-If this function returns
FALSE
, the document is deleted.
+If this function returns
false
, the document is deleted.
\membersection{wxDocument::OnCreateCommandProcessor}
\membersection{wxDocument::OnCreateCommandProcessor}
@@
-237,8
+259,8
@@
document, and notifies the views that the filename (in fact, the title) has chan
\func{virtual bool}{OnOpenDocument}{\param{const wxString\& }{filename}}
\func{virtual bool}{OnOpenDocument}{\param{const wxString\& }{filename}}
-Constructs an input file stream for the given filename (which must not be
NULL
),
-and calls LoadObject. If LoadObject returns
TRUE
, the document is set to
+Constructs an input file stream for the given filename (which must not be
empty
),
+and calls LoadObject. If LoadObject returns
true
, the document is set to
unmodified; otherwise, an error message box is displayed. The document's
views are notified that the filename has changed, to give windows an opportunity
to update their titles. All of the document's views are then updated.
unmodified; otherwise, an error message box is displayed. The document's
views are notified that the filename has changed, to give windows an opportunity
to update their titles. All of the document's views are then updated.
@@
-247,8
+269,8
@@
to update their titles. All of the document's views are then updated.
\func{virtual bool}{OnSaveDocument}{\param{const wxString\& }{filename}}
\func{virtual bool}{OnSaveDocument}{\param{const wxString\& }{filename}}
-Constructs an output file stream for the given filename (which must not be
NULL
),
-and calls SaveObject. If SaveObject returns
TRUE
, the document is set to
+Constructs an output file stream for the given filename (which must not be
empty
),
+and calls SaveObject. If SaveObject returns
true
, the document is set to
unmodified; otherwise, an error message box is displayed.
\membersection{wxDocument::OnSaveModified}
unmodified; otherwise, an error message box is displayed.
\membersection{wxDocument::OnSaveModified}
@@
-283,10
+305,15
@@
Prompts the user for a file to save to, and then calls OnSaveDocument.
\func{virtual ostream\&}{SaveObject}{\param{ostream\& }{stream}}
\func{virtual ostream\&}{SaveObject}{\param{ostream\& }{stream}}
+\func{virtual wxOutputStream\&}{SaveObject}{\param{wxOutputStream\& }{stream}}
+
Override this function and call it from your own SaveObject before
streaming your own data. SaveObject is called by the framework
automatically when the document contents need to be saved.
Override this function and call it from your own SaveObject before
streaming your own data. SaveObject is called by the framework
automatically when the document contents need to be saved.
+Note that only one of these forms exists, depending on how wxWidgets
+was configured.
+
\membersection{wxDocument::SetCommandProcessor}
\func{virtual void}{SetCommandProcessor}{\param{wxCommandProcessor *}{processor}}
\membersection{wxDocument::SetCommandProcessor}
\func{virtual void}{SetCommandProcessor}{\param{wxCommandProcessor *}{processor}}
@@
-312,10
+339,12
@@
framework.
\membersection{wxDocument::SetFilename}
\membersection{wxDocument::SetFilename}
-\func{void}{SetFilename}{\param{const wxString\& }{filename}}
+\func{void}{SetFilename}{\param{const wxString\& }{filename}
, \param{bool}{ notifyViews = false}
}
Sets the filename for this document. Usually called by the framework.
Sets the filename for this document. Usually called by the framework.
+If {\it notifyViews} is true, wxView::OnChangeFilename is called for all views.
+
\membersection{wxDocument::SetTitle}
\func{void}{SetTitle}{\param{const wxString\& }{title}}
\membersection{wxDocument::SetTitle}
\func{void}{SetTitle}{\param{const wxString\& }{title}}
@@
-326,7
+355,9
@@
the filename.
\membersection{wxDocument::UpdateAllViews}\label{wxdocumentupdateallviews}
\membersection{wxDocument::UpdateAllViews}\label{wxdocumentupdateallviews}
-\func{void}{UpdateAllViews}{\param{wxView* }{sender = NULL}}
+\func{void}{UpdateAllViews}{\param{wxView* }{sender = NULL}
, \param{wxObject*}{ hint = NULL}
}
Updates all views. If {\it sender} is non-NULL, does not update this view.
Updates all views. If {\it sender} is non-NULL, does not update this view.
+{\it hint} represents optional information to allow a view to optimize its update.
+