X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/954b8ae60391d18b87a604e7919c87c0c6ae208b..44cf9b50eef370cc94a6c1f249693dee3776d619:/docs/latex/wx/docmanag.tex diff --git a/docs/latex/wx/docmanag.tex b/docs/latex/wx/docmanag.tex index f49e353689..83b22df2e5 100644 --- a/docs/latex/wx/docmanag.tex +++ b/docs/latex/wx/docmanag.tex @@ -58,6 +58,12 @@ A list of all documents. Stores the flags passed to the constructor. +\membersection{wxDocManager::m\_lastDirectory} + +The directory last selected by the user when opening a file. + +\member{wxFileHistory*}{m\_fileHistory} + \membersection{wxDocManager::m\_templates} \member{wxList}{mnTemplates} @@ -66,16 +72,16 @@ A list of all document templates. \membersection{wxDocManager::wxDocManager} -\func{void}{wxDocManager}{\param{long}{ flags = wxDEFAULT\_DOCMAN\_FLAGS}, \param{bool}{ initialize = TRUE}} +\func{void}{wxDocManager}{\param{long}{ flags = wxDEFAULT\_DOCMAN\_FLAGS}, \param{bool}{ initialize = true}} Constructor. Create a document manager instance dynamically near the start of your application before doing any document or view operations. {\it flags} is currently unused. -If {\it initialize} is TRUE, the \helpref{Initialize}{wxdocmanagerinitialize} function will be called +If {\it initialize} is true, the \helpref{Initialize}{wxdocmanagerinitialize} function will be called to create a default history list object. If you derive from wxDocManager, you may wish to call the -base constructor with FALSE, and then call Initialize in your own constructor, to allow +base constructor with false, and then call Initialize in your own constructor, to allow your own Initialize or OnCreateFileHistory functions to be called. \membersection{wxDocManager::\destruct{wxDocManager}} @@ -108,6 +114,12 @@ Adds a file to the file history list, if we have a pointer to an appropriate fil Adds the template to the document manager's template list. +\membersection{wxDocManager::CloseDocuments} + +\func{bool}{CloseDocuments}{\param{bool }{force = true}} + +Closes all currently opened documents. + \membersection{wxDocManager::CreateDocument} \func{wxDocument*}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags}} @@ -222,15 +234,21 @@ Returns a reference to the list of documents. Returns a pointer to file history. +\membersection{wxDocManager::GetLastDirectory}\label{wxdocmanagergetlastdirectory} + +\constfunc{wxString}{GetLastDirectory}{\void} + +Returns the directory last selected by the user when opening a file. Initially empty. + \membersection{wxDocManager::GetMaxDocsOpen} \func{int}{GetMaxDocsOpen}{\void} Returns the number of documents that can be open simultaneously. -\membersection{wxDocManager::GetNoHistoryFiles} +\membersection{wxDocManager::GetHistoryFilesCount} -\func{int}{GetNoHistoryFiles}{\void} +\func{size\_t}{GetHistoryFilesCount}{\void} Returns the number of files currently stored in the file history. @@ -244,7 +262,7 @@ the opportunity to override functionality. If OnCreateFileHistory was called from the constructor, an overridden virtual OnCreateFileHistory would not be called due to C++'s `interesting' constructor semantics. In fact Initialize \rtfsp{\it is} called from the wxDocManager constructor, but this can be -vetoed by passing FALSE to the second argument, allowing the derived class's +vetoed by passing false to the second argument, allowing the derived class's constructor to call Initialize, possibly calling a different OnCreateFileHistory from the default. @@ -272,6 +290,12 @@ from \helpref{Initialize}{wxdocmanagerinitialize}. Closes and deletes the currently active document. +\membersection{wxDocManager::OnFileCloseAll} + +\func{void}{OnFileCloseAll}{\void} + +Closes and deletes all the currently opened documents. + \membersection{wxDocManager::OnFileNew} \func{void}{OnFileNew}{\void} @@ -306,6 +330,7 @@ with the following predefined menu item identifiers: \begin{itemize}\itemsep=0pt \item wxID\_OPEN Creates a new document and opens a file into it. \item wxID\_CLOSE Closes the current document. +\item wxID\_CLOSE\_ALL Closes all documents. \item wxID\_NEW Creates a new document. \item wxID\_SAVE Saves the document. \item wxID\_SAVE\_AS Saves the document into a specified filename. @@ -333,24 +358,58 @@ followed by a file selector. This function is used in wxDocManager::CreateDocument. +\perlnote{In wxPerl {\tt templates} is a reference to a list of templates. +If you override this method in your document manager it must return +two values, eg:\par + (doctemplate, path) = My::DocManager->SelectDocumentPath( ... ); +} + \membersection{wxDocManager::SelectDocumentType} \func{wxDocTemplate *}{SelectDocumentType}{\param{wxDocTemplate **}{templates}, - \param{int}{ noTemplates}} + \param{int}{ noTemplates}, \param{bool}{ sort=false}} Returns a document template by asking the user (if there is more than one template). This function is used in wxDocManager::CreateDocument. +\wxheading{Parameters} + +\docparam{templates}{Pointer to an array of templates from which to choose a desired template.} +\docparam{noTemplates}{Number of templates being pointed to by the {\it templates} pointer.} +\docparam{sort}{If more than one template is passed in in {\it templates}, +then this parameter indicates whether the list of templates that the user +will have to choose from is sorted or not when shown the choice box dialog. +Default is false.} + +\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.} + \membersection{wxDocManager::SelectViewType} \func{wxDocTemplate *}{SelectViewType}{\param{wxDocTemplate **}{templates}, - \param{int}{ noTemplates}} + \param{int}{ noTemplates}, \param{bool}{ sort=false}} Returns a document template by asking the user (if there is more than one template), displaying a list of valid views. This function is used in wxDocManager::CreateView. -The dialog normally won't appear because the array of templates only contains +The dialog normally will not appear because the array of templates only contains those relevant to the document in question, and often there will only be one such. +\wxheading{Parameters} + +\docparam{templates}{Pointer to an array of templates from which to choose a desired template.} +\docparam{noTemplates}{Number of templates being pointed to by the {\it templates} pointer.} +\docparam{sort}{If more than one template is passed in in {\it templates}, +then this parameter indicates whether the list of templates that the user +will have to choose from is sorted or not when shown the choice box dialog. +Default is false.} + +\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.} + +\membersection{wxDocManager::SetLastDirectory}\label{wxdocmanagersetlastdirectory} + +\func{void}{SetLastDirectory}{\param{const wxString\&}{ dir}} + +Sets the directory to be displayed to the user when opening a file. Initially this is empty. + \membersection{wxDocManager::SetMaxDocsOpen} \func{void}{SetMaxDocsOpen}{\param{int}{ n}}