1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxDocManager}}\label{wxdocmanager}
|
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
The wxDocManager class is part of the document/view framework supported by wxWidgets,
|
1998-05-20 10:25:30 -04:00
|
|
|
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}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/docview.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxDocManager overview}{wxdocmanageroverview}, \helpref{wxDocument}{wxdocument},\rtfsp
|
1998-09-16 17:52:23 -04:00
|
|
|
\helpref{wxView}{wxview}, \helpref{wxDocTemplate}{wxdoctemplate}, \helpref{wxFileHistory}{wxfilehistory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_currentView}\label{wxdocmanagermcreateview}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxView*}{m\_currentView}
|
|
|
|
|
|
|
|
The currently active view.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_defaultDocumentNameCounter}\label{wxdocmanagermdefaultdocumentnamecounter}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{int}{m\_defaultDocumentNameCounter}
|
|
|
|
|
|
|
|
Stores the integer to be used for the next default document name.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_fileHistory}\label{wxdocmanagermfilehistory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_maxDocsOpen}\label{wxdocmanagermmaxdocsopen}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_docs}\label{wxdocmanagermdocs}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxList}{m\_docs}
|
|
|
|
|
|
|
|
A list of all documents.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_flags}\label{wxdocmanagermflags}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{long}{m\_flags}
|
|
|
|
|
|
|
|
Stores the flags passed to the constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_lastDirectory}\label{wxdocmanagermlastdirectory}
|
1999-10-19 18:18:32 -04:00
|
|
|
|
|
|
|
The directory last selected by the user when opening a file.
|
|
|
|
|
|
|
|
\member{wxFileHistory*}{m\_fileHistory}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::m\_templates}\label{wxdocmanagermtemplates}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxList}{mnTemplates}
|
|
|
|
|
|
|
|
A list of all document templates.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::wxDocManager}\label{wxdocmanagerctor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{void}{wxDocManager}{\param{long}{ flags = wxDEFAULT\_DOCMAN\_FLAGS}, \param{bool}{ initialize = true}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
If {\it initialize} is true, the \helpref{Initialize}{wxdocmanagerinitialize} function will be called
|
1998-05-20 10:25:30 -04:00
|
|
|
to create a default history list object. If you derive from wxDocManager, you may wish to call the
|
2003-01-17 19:16:34 -05:00
|
|
|
base constructor with false, and then call Initialize in your own constructor, to allow
|
1998-05-20 10:25:30 -04:00
|
|
|
your own Initialize or OnCreateFileHistory functions to be called.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::\destruct{wxDocManager}}\label{wxdocmanagerdtor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{\destruct{wxDocManager}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::ActivateView}\label{wxdocmanageractivateview}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2005-02-06 12:27:04 -05:00
|
|
|
\func{void}{ActivateView}{\param{wxView* }{doc}, \param{bool}{ activate = true}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the current view.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::AddDocument}\label{wxdocmanageradddocument}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{AddDocument}{\param{wxDocument *}{doc}}
|
|
|
|
|
|
|
|
Adds the document to the list of documents.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::AddFileToHistory}\label{wxdocmanageraddfiletohistory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::AssociateTemplate}\label{wxdocmanagerassociatetemplate}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{AssociateTemplate}{\param{wxDocTemplate *}{temp}}
|
|
|
|
|
|
|
|
Adds the template to the document manager's template list.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::CloseDocuments}\label{wxdocmanagerclosedocuments}
|
2001-12-30 12:35:07 -05:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{bool}{CloseDocuments}{\param{bool }{force = true}}
|
2001-12-30 12:35:07 -05:00
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
Closes all currently opened documents.
|
2001-12-30 12:35:07 -05:00
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::CreateDocument}\label{wxdocmanagercreatedocument}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::CreateView}\label{wxdocmanagercreateview}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::DisassociateTemplate}\label{wxdocmanagerdisassociatetemplate}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{DisassociateTemplate}{\param{wxDocTemplate *}{temp}}
|
|
|
|
|
|
|
|
Removes the template from the list of templates.
|
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\membersection{wxDocManager::FileHistoryAddFilesToMenu}\label{wxdocmanagerfilehistoryaddfilestomenu}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\func{void}{FileHistoryAddFilesToMenu}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
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}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\helpref{wxConfig}{wxconfigbase}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\membersection{wxDocManager::FileHistoryRemoveMenu}\label{wxdocmanagerfilehistoryremovemenu}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\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
|
1998-05-20 10:25:30 -04:00
|
|
|
explicitly by the application.
|
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxConfig}{wxconfigbase}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
\membersection{wxDocManager::FileHistoryUseMenu}\label{wxdocmanagerfilehistoryusemenu}
|
|
|
|
|
|
|
|
\func{void}{FileHistoryUseMenu}{\param{wxMenu*}{ menu}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
1998-09-16 17:52:23 -04:00
|
|
|
Note that you can add multiple menus using this function, to be managed by the
|
|
|
|
file history object.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::FindTemplateForPath}\label{wxdocmanagerfindtemplateforpath}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::GetCurrentDocument}\label{wxdocmanagergetcurrentdocument}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxDocument *}{GetCurrentDocument}{\void}
|
|
|
|
|
|
|
|
Returns the document associated with the currently active view (if any).
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::GetCurrentView}\label{wxdocmanagergetcurrentview}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxView *}{GetCurrentView}{\void}
|
|
|
|
|
|
|
|
Returns the currently active view
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::GetDocuments}\label{wxdocmanagergetdocuments}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxList\&}{GetDocuments}{\void}
|
|
|
|
|
|
|
|
Returns a reference to the list of documents.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::GetFileHistory}\label{wxdocmanagergetfilehistory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxFileHistory *}{GetFileHistory}{\void}
|
|
|
|
|
|
|
|
Returns a pointer to file history.
|
|
|
|
|
1999-10-19 18:18:32 -04:00
|
|
|
\membersection{wxDocManager::GetLastDirectory}\label{wxdocmanagergetlastdirectory}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetLastDirectory}{\void}
|
|
|
|
|
|
|
|
Returns the directory last selected by the user when opening a file. Initially empty.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::GetMaxDocsOpen}\label{wxdocmanagergetmaxdocsopen}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{int}{GetMaxDocsOpen}{\void}
|
|
|
|
|
|
|
|
Returns the number of documents that can be open simultaneously.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::GetHistoryFilesCount}\label{wxdocmanagergethistoryfilescount}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2003-05-08 20:02:58 -04:00
|
|
|
\func{size\_t}{GetHistoryFilesCount}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Returns the number of files currently stored in the file history.
|
|
|
|
|
|
|
|
\membersection{wxDocManager::Initialize}\label{wxdocmanagerinitialize}
|
|
|
|
|
|
|
|
\func{bool}{Initialize}{\void}
|
|
|
|
|
|
|
|
Initializes data; currently just calls OnCreateFileHistory. Some data cannot
|
|
|
|
always be initialized in the constructor because the programmer must be given
|
|
|
|
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
|
2003-01-17 19:16:34 -05:00
|
|
|
vetoed by passing false to the second argument, allowing the derived class's
|
1998-05-20 10:25:30 -04:00
|
|
|
constructor to call Initialize, possibly calling a different OnCreateFileHistory
|
|
|
|
from the default.
|
|
|
|
|
|
|
|
The bottom line: if you're not deriving from Initialize, forget it and
|
|
|
|
construct wxDocManager with no arguments.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::MakeDefaultName}\label{wxdocmanagermakedefaultname}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{bool}{MakeDefaultName}{\param{const wxString\& }{buf}}
|
|
|
|
|
|
|
|
Copies a suitable default name into {\it buf}. This is implemented by
|
|
|
|
appending an integer counter to the string {\bf unnamed} and incrementing
|
|
|
|
the counter.
|
|
|
|
|
2003-10-19 05:09:12 -04:00
|
|
|
\perlnote{In wxPerl this function must return the modified name rather
|
|
|
|
than just modifying the argument.}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnCreateFileHistory}\label{wxdocmanageroncreatefilehistory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxFileHistory *}{OnCreateFileHistory}{\void}
|
|
|
|
|
|
|
|
A hook to allow a derived class to create a different type of file history. Called
|
|
|
|
from \helpref{Initialize}{wxdocmanagerinitialize}.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnFileClose}\label{wxdocmanageronfileclose}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\func{void}{OnFileClose}{\param{wxCommandEvent\& }{event}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Closes and deletes the currently active document.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnFileCloseAll}\label{wxdocmanageronfilecloseall}
|
2001-12-30 12:35:07 -05:00
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\func{void}{OnFileCloseAll}{\param{wxCommandEvent\& }{event}}
|
2001-12-30 12:35:07 -05:00
|
|
|
|
|
|
|
Closes and deletes all the currently opened documents.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnFileNew}\label{wxdocmanageronfilenew}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\func{void}{OnFileNew}{\param{wxCommandEvent\& }{event}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Creates a document from a list of templates (if more than one template).
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnFileOpen}\label{wxdocmanageronfileopen}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\func{void}{OnFileOpen}{\param{wxCommandEvent\& }{event}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Creates a new document and reads in the selected file.
|
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\membersection{wxDocManager::OnFileRevert}\label{wxdocmanageronfilerevert}
|
|
|
|
|
|
|
|
\func{void}{OnFileRevert}{\param{wxCommandEvent\& }{event}}
|
|
|
|
|
|
|
|
Reverts the current document by calling wxDocument::Revert for the current document.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnFileSave}\label{wxdocmanageronfilesave}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\func{void}{OnFileSave}{\param{wxCommandEvent\& }{event}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Saves the current document by calling wxDocument::Save for the current document.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::OnFileSaveAs}\label{wxdocmanageronfilesaveas}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 16:33:17 -05:00
|
|
|
\func{void}{OnFileSaveAs}{\param{wxCommandEvent\& }{event}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Calls wxDocument::SaveAs for the current document.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::RemoveDocument}\label{wxdocmanagerremovedocument}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{RemoveDocument}{\param{wxDocument *}{doc}}
|
|
|
|
|
|
|
|
Removes the document from the list of documents.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::SelectDocumentPath}\label{wxdocmanagerselectdocumentpath}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxDocTemplate *}{SelectDocumentPath}{\param{wxDocTemplate **}{templates},
|
2005-02-06 12:27:04 -05:00
|
|
|
\param{int}{ noTemplates}, \param{wxString\& }{path},
|
1998-05-20 10:25:30 -04:00
|
|
|
\param{long}{ flags}, \param{bool}{ save}}
|
|
|
|
|
|
|
|
Under Windows, pops up a file selector with a list of filters corresponding to document templates.
|
|
|
|
The wxDocTemplate corresponding to the selected file's extension is returned.
|
|
|
|
|
|
|
|
On other platforms, if there is more than one document template a choice list is popped up,
|
|
|
|
followed by a file selector.
|
|
|
|
|
|
|
|
This function is used in wxDocManager::CreateDocument.
|
|
|
|
|
2002-12-27 13:30:48 -05:00
|
|
|
\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( ... );
|
|
|
|
}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::SelectDocumentType}\label{wxdocmanagerselectdocumenttype}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxDocTemplate *}{SelectDocumentType}{\param{wxDocTemplate **}{templates},
|
2003-01-17 19:16:34 -05:00
|
|
|
\param{int}{ noTemplates}, \param{bool}{ sort=false}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Returns a document template by asking the user (if there is more than one template).
|
|
|
|
This function is used in wxDocManager::CreateDocument.
|
|
|
|
|
2001-01-24 06:04:30 -05:00
|
|
|
\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.
|
2003-01-17 19:16:34 -05:00
|
|
|
Default is false.}
|
2001-01-24 06:04:30 -05:00
|
|
|
|
2002-12-27 13:30:48 -05:00
|
|
|
\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::SelectViewType}\label{wxdocmanagerselectviewtype}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxDocTemplate *}{SelectViewType}{\param{wxDocTemplate **}{templates},
|
2003-01-17 19:16:34 -05:00
|
|
|
\param{int}{ noTemplates}, \param{bool}{ sort=false}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
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.
|
2001-01-24 06:04:30 -05:00
|
|
|
The dialog normally will not appear because the array of templates only contains
|
1998-05-20 10:25:30 -04:00
|
|
|
those relevant to the document in question, and often there will only be one such.
|
|
|
|
|
2001-01-24 06:04:30 -05:00
|
|
|
\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.
|
2003-01-17 19:16:34 -05:00
|
|
|
Default is false.}
|
2001-01-24 06:04:30 -05:00
|
|
|
|
2002-12-27 13:30:48 -05:00
|
|
|
\perlnote{In wxPerl {\tt templates} is a reference to a list of templates.}
|
|
|
|
|
1999-10-19 18:18:32 -04:00
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocManager::SetMaxDocsOpen}\label{wxdocmanagersetmaxdocsopen}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetMaxDocsOpen}{\param{int}{ n}}
|
|
|
|
|
|
|
|
Sets the maximum number of documents that can be open at a time. By default, this
|
|
|
|
is 10,000. If you set it to 1, existing documents will be saved and deleted
|
|
|
|
when the user tries to open or create a new one (similar to the behaviour
|
|
|
|
of Windows Write, for example). Allowing multiple documents gives behaviour
|
|
|
|
more akin to MS Word and other Multiple Document Interface applications.
|
|
|
|
|
|
|
|
|
|
|
|
|