docmanag.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 479 行 · 第 1/2 页

TEX
479
字号
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name:        docmanag.tex
%% Purpose:     wxDocManager documentation
%% Author:      wxWidgets Team
%% Modified by:
%% Created:     
%% RCS-ID:      $Id: docmanag.tex,v 1.18 2005/04/08 14:33:32 MW Exp $
%% 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,
and cooperates with the \helpref{wxView}{wxview}, \helpref{wxDocument}{wxdocument}\rtfsp
and \helpref{wxDocTemplate}{wxdoctemplate} classes.

\wxheading{Derived from}

\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/docview.h>

\wxheading{See also}

\helpref{wxDocManager overview}{wxdocmanageroverview}, \helpref{wxDocument}{wxdocument},\rtfsp
\helpref{wxView}{wxview}, \helpref{wxDocTemplate}{wxdoctemplate}, \helpref{wxFileHistory}{wxfilehistory}

\latexignore{\rtfignore{\wxheading{Members}}}


\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\_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.


\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.


\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\_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}{m\_templates}

A list of all document templates.


\membersection{wxDocManager::wxDocManager}\label{wxdocmanagerctor}

\func{}{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
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
your own Initialize or OnCreateFileHistory functions to be called.


\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::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::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::CreateDocument}\label{wxdocmanagercreatedocument}

\func{wxDocument*}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags}}

Creates a new document in a manner determined by the {\it flags} parameter, which can be:

\begin{itemize}\itemsep=0pt
\item wxDOC\_NEW Creates a fresh document.
\item wxDOC\_SILENT Silently loads the given document file.
\end{itemize}

If wxDOC\_NEW is present, a new document will be created and returned, possibly after
asking the user for a template to use if there is more than one document template.
If wxDOC\_SILENT is present, a new document will be created and the given file loaded
into it. If neither of these flags is present, the user will be presented with
a file selector for the file to load, and the template to use will be determined by the
extension (Windows) or by popping up a template choice list (other platforms).

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}}

Creates a new view for the given document. If more than one view is allowed for the
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::FileHistoryAddFilesToMenu}\label{wxdocmanagerfilehistoryaddfilestomenu}

\func{void}{FileHistoryAddFilesToMenu}{\void}

Appends the files in the history list, to all menus managed by the file history object.

\func{void}{FileHistoryAddFilesToMenu}{\param{wxMenu*}{ menu}}

Appends the files in the history list, to the given menu only.


\membersection{wxDocManager::FileHistoryLoad}\label{wxdocmanagerfilehistoryload}

\func{void}{FileHistoryLoad}{\param{wxConfigBase\& }{config}}

Loads the file history from a config object.

\wxheading{See also}

\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::FileHistorySave}\label{wxdocmanagerfilehistorysave}

\func{void}{FileHistorySave}{\param{wxConfigBase\& }{resourceFile}}

Saves the file history into a config object. This must be called
explicitly by the application.

\wxheading{See also}

\helpref{wxConfig}{wxconfigbase}


\membersection{wxDocManager::FileHistoryUseMenu}\label{wxdocmanagerfilehistoryusemenu}

\func{void}{FileHistoryUseMenu}{\param{wxMenu*}{ menu}}

Use this menu for appending recently-visited document filenames, for convenient
access. Calling this function with a valid menu pointer enables the history
list functionality.

Note that you can add multiple menus using this function, to be managed by the
file history object.


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?