git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32335
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name: docmanag.tex
+%% Purpose: wxDocManager documentation
+%% Author: wxWidgets Team
+%% Modified by:
+%% Created:
+%% RCS-ID: $Id$
+%% Copyright: (c) wxWidgets Team
+%% License: wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
\section{\class{wxDocManager}}\label{wxdocmanager}
The wxDocManager class is part of the document/view framework supported by wxWidgets,
\section{\class{wxDocManager}}\label{wxdocmanager}
The wxDocManager class is part of the document/view framework supported by wxWidgets,
\latexignore{\rtfignore{\wxheading{Members}}}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxDocManager::m\_currentView}\label{wxdocmanagermcreateview}
\member{wxView*}{m\_currentView}
The currently active view.
\membersection{wxDocManager::m\_currentView}\label{wxdocmanagermcreateview}
\member{wxView*}{m\_currentView}
The currently active view.
\membersection{wxDocManager::m\_defaultDocumentNameCounter}\label{wxdocmanagermdefaultdocumentnamecounter}
\member{int}{m\_defaultDocumentNameCounter}
Stores the integer to be used for the next default document name.
\membersection{wxDocManager::m\_defaultDocumentNameCounter}\label{wxdocmanagermdefaultdocumentnamecounter}
\member{int}{m\_defaultDocumentNameCounter}
Stores the integer to be used for the next default document name.
\membersection{wxDocManager::m\_fileHistory}\label{wxdocmanagermfilehistory}
\member{wxFileHistory*}{m\_fileHistory}
\membersection{wxDocManager::m\_fileHistory}\label{wxdocmanagermfilehistory}
\member{wxFileHistory*}{m\_fileHistory}
A pointer to an instance of \helpref{wxFileHistory}{wxfilehistory},
which manages the history of recently-visited files on the File menu.
A pointer to an instance of \helpref{wxFileHistory}{wxfilehistory},
which manages the history of recently-visited files on the File menu.
\membersection{wxDocManager::m\_maxDocsOpen}\label{wxdocmanagermmaxdocsopen}
\member{int}{m\_maxDocsOpen}
\membersection{wxDocManager::m\_maxDocsOpen}\label{wxdocmanagermmaxdocsopen}
\member{int}{m\_maxDocsOpen}
Stores the maximum number of documents that can be opened before
existing documents are closed. By default, this is 10,000.
Stores the maximum number of documents that can be opened before
existing documents are closed. By default, this is 10,000.
\membersection{wxDocManager::m\_docs}\label{wxdocmanagermdocs}
\member{wxList}{m\_docs}
A list of all documents.
\membersection{wxDocManager::m\_docs}\label{wxdocmanagermdocs}
\member{wxList}{m\_docs}
A list of all documents.
\membersection{wxDocManager::m\_flags}\label{wxdocmanagermflags}
\member{long}{m\_flags}
Stores the flags passed to the constructor.
\membersection{wxDocManager::m\_flags}\label{wxdocmanagermflags}
\member{long}{m\_flags}
Stores the flags passed to the constructor.
\membersection{wxDocManager::m\_lastDirectory}\label{wxdocmanagermlastdirectory}
The directory last selected by the user when opening a file.
\member{wxFileHistory*}{m\_fileHistory}
\membersection{wxDocManager::m\_lastDirectory}\label{wxdocmanagermlastdirectory}
The directory last selected by the user when opening a file.
\member{wxFileHistory*}{m\_fileHistory}
\membersection{wxDocManager::m\_templates}\label{wxdocmanagermtemplates}
\member{wxList}{mnTemplates}
A list of all document templates.
\membersection{wxDocManager::m\_templates}\label{wxdocmanagermtemplates}
\member{wxList}{mnTemplates}
A list of all document templates.
\membersection{wxDocManager::wxDocManager}\label{wxdocmanagerctor}
\func{}{wxDocManager}{\param{long}{ flags = wxDEFAULT\_DOCMAN\_FLAGS}, \param{bool}{ initialize = true}}
\membersection{wxDocManager::wxDocManager}\label{wxdocmanagerctor}
\func{}{wxDocManager}{\param{long}{ flags = wxDEFAULT\_DOCMAN\_FLAGS}, \param{bool}{ initialize = true}}
base constructor with false, and then call Initialize in your own constructor, to allow
your own Initialize or OnCreateFileHistory functions to be called.
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}}\label{wxdocmanagerdtor}
\func{void}{\destruct{wxDocManager}}{\void}
Destructor.
\membersection{wxDocManager::\destruct{wxDocManager}}\label{wxdocmanagerdtor}
\func{void}{\destruct{wxDocManager}}{\void}
Destructor.
\membersection{wxDocManager::ActivateView}\label{wxdocmanageractivateview}
\func{void}{ActivateView}{\param{wxView* }{doc}, \param{bool}{ activate = true}}
Sets the current view.
\membersection{wxDocManager::ActivateView}\label{wxdocmanageractivateview}
\func{void}{ActivateView}{\param{wxView* }{doc}, \param{bool}{ activate = true}}
Sets the current view.
\membersection{wxDocManager::AddDocument}\label{wxdocmanageradddocument}
\func{void}{AddDocument}{\param{wxDocument *}{doc}}
Adds the document to the list of documents.
\membersection{wxDocManager::AddDocument}\label{wxdocmanageradddocument}
\func{void}{AddDocument}{\param{wxDocument *}{doc}}
Adds the document to the list of documents.
\membersection{wxDocManager::AddFileToHistory}\label{wxdocmanageraddfiletohistory}
\func{void}{AddFileToHistory}{\param{const wxString\& }{filename}}
Adds a file to the file history list, if we have a pointer to an appropriate file menu.
\membersection{wxDocManager::AddFileToHistory}\label{wxdocmanageraddfiletohistory}
\func{void}{AddFileToHistory}{\param{const wxString\& }{filename}}
Adds a file to the file history list, if we have a pointer to an appropriate file menu.
\membersection{wxDocManager::AssociateTemplate}\label{wxdocmanagerassociatetemplate}
\func{void}{AssociateTemplate}{\param{wxDocTemplate *}{temp}}
Adds the template to the document manager's template list.
\membersection{wxDocManager::AssociateTemplate}\label{wxdocmanagerassociatetemplate}
\func{void}{AssociateTemplate}{\param{wxDocTemplate *}{temp}}
Adds the template to the document manager's template list.
\membersection{wxDocManager::CloseDocuments}\label{wxdocmanagerclosedocuments}
\func{bool}{CloseDocuments}{\param{bool }{force = true}}
Closes all currently opened documents.
\membersection{wxDocManager::CloseDocuments}\label{wxdocmanagerclosedocuments}
\func{bool}{CloseDocuments}{\param{bool }{force = true}}
Closes all currently opened documents.
\membersection{wxDocManager::CreateDocument}\label{wxdocmanagercreatedocument}
\func{wxDocument*}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags}}
\membersection{wxDocManager::CreateDocument}\label{wxdocmanagercreatedocument}
\func{wxDocument*}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags}}
If the maximum number of documents has been reached, this function
will delete the oldest currently loaded document before creating a new one.
If the maximum number of documents has been reached, this function
will delete the oldest currently loaded document before creating a new one.
\membersection{wxDocManager::CreateView}\label{wxdocmanagercreateview}
\func{wxView*}{CreateView}{\param{wxDocument*}{doc}, \param{long}{ flags}}
\membersection{wxDocManager::CreateView}\label{wxdocmanagercreateview}
\func{wxView*}{CreateView}{\param{wxDocument*}{doc}, \param{long}{ flags}}
document (by virtue of multiple templates mentioning the same document type), a choice
of view is presented to the user.
document (by virtue of multiple templates mentioning the same document type), a choice
of view is presented to the user.
\membersection{wxDocManager::DisassociateTemplate}\label{wxdocmanagerdisassociatetemplate}
\func{void}{DisassociateTemplate}{\param{wxDocTemplate *}{temp}}
Removes the template from the list of templates.
\membersection{wxDocManager::DisassociateTemplate}\label{wxdocmanagerdisassociatetemplate}
\func{void}{DisassociateTemplate}{\param{wxDocTemplate *}{temp}}
Removes the template from the list of templates.
\membersection{wxDocManager::FileHistoryAddFilesToMenu}\label{wxdocmanagerfilehistoryaddfilestomenu}
\func{void}{FileHistoryAddFilesToMenu}{\void}
\membersection{wxDocManager::FileHistoryAddFilesToMenu}\label{wxdocmanagerfilehistoryaddfilestomenu}
\func{void}{FileHistoryAddFilesToMenu}{\void}
Appends the files in the history list, to the given menu only.
Appends the files in the history list, to the given menu only.
\membersection{wxDocManager::FileHistoryLoad}\label{wxdocmanagerfilehistoryload}
\func{void}{FileHistoryLoad}{\param{wxConfigBase\& }{config}}
\membersection{wxDocManager::FileHistoryLoad}\label{wxdocmanagerfilehistoryload}
\func{void}{FileHistoryLoad}{\param{wxConfigBase\& }{config}}
\helpref{wxConfig}{wxconfigbase}
\helpref{wxConfig}{wxconfigbase}
\membersection{wxDocManager::FileHistoryRemoveMenu}\label{wxdocmanagerfilehistoryremovemenu}
\func{void}{FileHistoryRemoveMenu}{\param{wxMenu*}{ menu}}
Removes the given menu from the list of menus managed by the file history object.
\membersection{wxDocManager::FileHistoryRemoveMenu}\label{wxdocmanagerfilehistoryremovemenu}
\func{void}{FileHistoryRemoveMenu}{\param{wxMenu*}{ menu}}
Removes the given menu from the list of menus managed by the file history object.
\membersection{wxDocManager::FileHistorySave}\label{wxdocmanagerfilehistorysave}
\func{void}{FileHistorySave}{\param{wxConfigBase\& }{resourceFile}}
\membersection{wxDocManager::FileHistorySave}\label{wxdocmanagerfilehistorysave}
\func{void}{FileHistorySave}{\param{wxConfigBase\& }{resourceFile}}
\helpref{wxConfig}{wxconfigbase}
\helpref{wxConfig}{wxconfigbase}
\membersection{wxDocManager::FileHistoryUseMenu}\label{wxdocmanagerfilehistoryusemenu}
\func{void}{FileHistoryUseMenu}{\param{wxMenu*}{ menu}}
\membersection{wxDocManager::FileHistoryUseMenu}\label{wxdocmanagerfilehistoryusemenu}
\func{void}{FileHistoryUseMenu}{\param{wxMenu*}{ menu}}
Note that you can add multiple menus using this function, to be managed by the
file history object.
Note that you can add multiple menus using this function, to be managed by the
file history object.
\membersection{wxDocManager::FindTemplateForPath}\label{wxdocmanagerfindtemplateforpath}
\func{wxDocTemplate *}{FindTemplateForPath}{\param{const wxString\& }{path}}
\membersection{wxDocManager::FindTemplateForPath}\label{wxdocmanagerfindtemplateforpath}
\func{wxDocTemplate *}{FindTemplateForPath}{\param{const wxString\& }{path}}
Given a path, try to find template that matches the extension. This is only
an approximate method of finding a template for creating a document.
Given a path, try to find template that matches the extension. This is only
an approximate method of finding a template for creating a document.
\membersection{wxDocManager::GetCurrentDocument}\label{wxdocmanagergetcurrentdocument}
\func{wxDocument *}{GetCurrentDocument}{\void}
Returns the document associated with the currently active view (if any).
\membersection{wxDocManager::GetCurrentDocument}\label{wxdocmanagergetcurrentdocument}
\func{wxDocument *}{GetCurrentDocument}{\void}
Returns the document associated with the currently active view (if any).
\membersection{wxDocManager::GetCurrentView}\label{wxdocmanagergetcurrentview}
\func{wxView *}{GetCurrentView}{\void}
Returns the currently active view
\membersection{wxDocManager::GetCurrentView}\label{wxdocmanagergetcurrentview}
\func{wxView *}{GetCurrentView}{\void}
Returns the currently active view
\membersection{wxDocManager::GetDocuments}\label{wxdocmanagergetdocuments}
\func{wxList\&}{GetDocuments}{\void}
Returns a reference to the list of documents.
\membersection{wxDocManager::GetDocuments}\label{wxdocmanagergetdocuments}
\func{wxList\&}{GetDocuments}{\void}
Returns a reference to the list of documents.
\membersection{wxDocManager::GetFileHistory}\label{wxdocmanagergetfilehistory}
\func{wxFileHistory *}{GetFileHistory}{\void}
Returns a pointer to file history.
\membersection{wxDocManager::GetFileHistory}\label{wxdocmanagergetfilehistory}
\func{wxFileHistory *}{GetFileHistory}{\void}
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::GetLastDirectory}\label{wxdocmanagergetlastdirectory}
\constfunc{wxString}{GetLastDirectory}{\void}
Returns the directory last selected by the user when opening a file. Initially empty.
\membersection{wxDocManager::GetMaxDocsOpen}\label{wxdocmanagergetmaxdocsopen}
\func{int}{GetMaxDocsOpen}{\void}
Returns the number of documents that can be open simultaneously.
\membersection{wxDocManager::GetMaxDocsOpen}\label{wxdocmanagergetmaxdocsopen}
\func{int}{GetMaxDocsOpen}{\void}
Returns the number of documents that can be open simultaneously.
\membersection{wxDocManager::GetHistoryFilesCount}\label{wxdocmanagergethistoryfilescount}
\func{size\_t}{GetHistoryFilesCount}{\void}
Returns the number of files currently stored in the file history.
\membersection{wxDocManager::GetHistoryFilesCount}\label{wxdocmanagergethistoryfilescount}
\func{size\_t}{GetHistoryFilesCount}{\void}
Returns the number of files currently stored in the file history.
+
+\membersection{wxDocManager::GetTemplates}\label{wxdocmanagergettemplates}
+
+\func{wxList\&}{GetTemplates}{\void}
+
+Returns a reference to the list of associated templates.
+
+
\membersection{wxDocManager::Initialize}\label{wxdocmanagerinitialize}
\func{bool}{Initialize}{\void}
\membersection{wxDocManager::Initialize}\label{wxdocmanagerinitialize}
\func{bool}{Initialize}{\void}
The bottom line: if you're not deriving from Initialize, forget it and
construct wxDocManager with no arguments.
The bottom line: if you're not deriving from Initialize, forget it and
construct wxDocManager with no arguments.
\membersection{wxDocManager::MakeDefaultName}\label{wxdocmanagermakedefaultname}
\func{bool}{MakeDefaultName}{\param{const wxString\& }{buf}}
\membersection{wxDocManager::MakeDefaultName}\label{wxdocmanagermakedefaultname}
\func{bool}{MakeDefaultName}{\param{const wxString\& }{buf}}
\perlnote{In wxPerl this function must return the modified name rather
than just modifying the argument.}
\perlnote{In wxPerl this function must return the modified name rather
than just modifying the argument.}
\membersection{wxDocManager::OnCreateFileHistory}\label{wxdocmanageroncreatefilehistory}
\func{wxFileHistory *}{OnCreateFileHistory}{\void}
\membersection{wxDocManager::OnCreateFileHistory}\label{wxdocmanageroncreatefilehistory}
\func{wxFileHistory *}{OnCreateFileHistory}{\void}
A hook to allow a derived class to create a different type of file history. Called
from \helpref{Initialize}{wxdocmanagerinitialize}.
A hook to allow a derived class to create a different type of file history. Called
from \helpref{Initialize}{wxdocmanagerinitialize}.
\membersection{wxDocManager::OnFileClose}\label{wxdocmanageronfileclose}
\func{void}{OnFileClose}{\param{wxCommandEvent\& }{event}}
Closes and deletes the currently active document.
\membersection{wxDocManager::OnFileClose}\label{wxdocmanageronfileclose}
\func{void}{OnFileClose}{\param{wxCommandEvent\& }{event}}
Closes and deletes the currently active document.
\membersection{wxDocManager::OnFileCloseAll}\label{wxdocmanageronfilecloseall}
\func{void}{OnFileCloseAll}{\param{wxCommandEvent\& }{event}}
Closes and deletes all the currently opened documents.
\membersection{wxDocManager::OnFileCloseAll}\label{wxdocmanageronfilecloseall}
\func{void}{OnFileCloseAll}{\param{wxCommandEvent\& }{event}}
Closes and deletes all the currently opened documents.
\membersection{wxDocManager::OnFileNew}\label{wxdocmanageronfilenew}
\func{void}{OnFileNew}{\param{wxCommandEvent\& }{event}}
Creates a document from a list of templates (if more than one template).
\membersection{wxDocManager::OnFileNew}\label{wxdocmanageronfilenew}
\func{void}{OnFileNew}{\param{wxCommandEvent\& }{event}}
Creates a document from a list of templates (if more than one template).
\membersection{wxDocManager::OnFileOpen}\label{wxdocmanageronfileopen}
\func{void}{OnFileOpen}{\param{wxCommandEvent\& }{event}}
Creates a new document and reads in the selected file.
\membersection{wxDocManager::OnFileOpen}\label{wxdocmanageronfileopen}
\func{void}{OnFileOpen}{\param{wxCommandEvent\& }{event}}
Creates a new document and reads in the selected file.
\membersection{wxDocManager::OnFileRevert}\label{wxdocmanageronfilerevert}
\func{void}{OnFileRevert}{\param{wxCommandEvent\& }{event}}
Reverts the current document by calling wxDocument::Revert for the current document.
\membersection{wxDocManager::OnFileRevert}\label{wxdocmanageronfilerevert}
\func{void}{OnFileRevert}{\param{wxCommandEvent\& }{event}}
Reverts the current document by calling wxDocument::Revert for the current document.
\membersection{wxDocManager::OnFileSave}\label{wxdocmanageronfilesave}
\func{void}{OnFileSave}{\param{wxCommandEvent\& }{event}}
Saves the current document by calling wxDocument::Save for the current document.
\membersection{wxDocManager::OnFileSave}\label{wxdocmanageronfilesave}
\func{void}{OnFileSave}{\param{wxCommandEvent\& }{event}}
Saves the current document by calling wxDocument::Save for the current document.
\membersection{wxDocManager::OnFileSaveAs}\label{wxdocmanageronfilesaveas}
\func{void}{OnFileSaveAs}{\param{wxCommandEvent\& }{event}}
Calls wxDocument::SaveAs for the current document.
\membersection{wxDocManager::OnFileSaveAs}\label{wxdocmanageronfilesaveas}
\func{void}{OnFileSaveAs}{\param{wxCommandEvent\& }{event}}
Calls wxDocument::SaveAs for the current document.
\membersection{wxDocManager::RemoveDocument}\label{wxdocmanagerremovedocument}
\func{void}{RemoveDocument}{\param{wxDocument *}{doc}}
Removes the document from the list of documents.
\membersection{wxDocManager::RemoveDocument}\label{wxdocmanagerremovedocument}
\func{void}{RemoveDocument}{\param{wxDocument *}{doc}}
Removes the document from the list of documents.
\membersection{wxDocManager::SelectDocumentPath}\label{wxdocmanagerselectdocumentpath}
\func{wxDocTemplate *}{SelectDocumentPath}{\param{wxDocTemplate **}{templates},
\membersection{wxDocManager::SelectDocumentPath}\label{wxdocmanagerselectdocumentpath}
\func{wxDocTemplate *}{SelectDocumentPath}{\param{wxDocTemplate **}{templates},
(doctemplate, path) = My::DocManager->SelectDocumentPath( ... );
}
(doctemplate, path) = My::DocManager->SelectDocumentPath( ... );
}
\membersection{wxDocManager::SelectDocumentType}\label{wxdocmanagerselectdocumenttype}
\func{wxDocTemplate *}{SelectDocumentType}{\param{wxDocTemplate **}{templates},
\membersection{wxDocManager::SelectDocumentType}\label{wxdocmanagerselectdocumenttype}
\func{wxDocTemplate *}{SelectDocumentType}{\param{wxDocTemplate **}{templates},
\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.}
\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.}
\membersection{wxDocManager::SelectViewType}\label{wxdocmanagerselectviewtype}
\func{wxDocTemplate *}{SelectViewType}{\param{wxDocTemplate **}{templates},
\membersection{wxDocManager::SelectViewType}\label{wxdocmanagerselectviewtype}
\func{wxDocTemplate *}{SelectViewType}{\param{wxDocTemplate **}{templates},
\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.}
\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::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}\label{wxdocmanagersetmaxdocsopen}
\func{void}{SetMaxDocsOpen}{\param{int}{ n}}
\membersection{wxDocManager::SetMaxDocsOpen}\label{wxdocmanagersetmaxdocsopen}
\func{void}{SetMaxDocsOpen}{\param{int}{ n}}
of Windows Write, for example). Allowing multiple documents gives behaviour
more akin to MS Word and other Multiple Document Interface applications.
of Windows Write, for example). Allowing multiple documents gives behaviour
more akin to MS Word and other Multiple Document Interface applications.