.\" This is a wxWidgets manpage page generated from the XML docs .TH wxDocTemplate 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxDocTemplate \- Manages the relationship between a document class and a view class .SH DESCRIPTION The wxDocTemplate class is used to model the relationship between a document class and a view class. .SH "PARENTS" wxObject .SH "INCLUDE FILES" wx/docview.h .SH MEMBERS .SS wxDocTemplate (wxDocManager* managerconst wxString& descrconst wxString& filterconst wxString& dirconst wxString& extconst wxString& docTypeNameconst wxString& viewTypeNamewxClassInfo* docClassInfo = NULLwxClassInfo* viewClassInfo = NULLlong flags = wxDEFAULT_TEMPLATE_FLAGS) Constructor. Create instances dynamically near the start of your application after creating a wxDocManager instance, and before doing any document or view operations. manager is the document manager object which manages this template. descr is a short description of what the template is for. This string will be displayed in the file filter list of Windows file selectors. filter is an appropriate file filter such as *.txt . dir is the default directory to use for file selectors. ext is the default file extension (such as txt). docTypeName is a name that should be unique for a given type of document, used for gathering a list of views relevant to a particular document. viewTypeName is a name that should be unique for a given view. docClassInfo is a pointer to the run-time document class information as returned by the CLASSINFO macro, e.g. CLASSINFO(MyDocumentClass). If this is not supplied, you will need to derive a new wxDocTemplate class and override the CreateDocument member to return a new document instance on demand. viewClassInfo is a pointer to the run-time view class information as returned by the CLASSINFO macro, e.g. CLASSINFO(MyViewClass). If this is not supplied, you will need to derive a new wxDocTemplate class and override the CreateView member to return a new view instance on demand. flags is a bit list of the following: wxTEMPLATE_VISIBLE The template may be displayed to the user in dialogs. wxTEMPLATE_INVISIBLE The template may not be displayed to the user in dialogs. wxDEFAULT_TEMPLATE_FLAGS Defined as wxTEMPLATE_VISIBLE. .SS void ~wxDocTemplate () Destructor. .SS wxDocument * CreateDocument (const wxString& pathlong flags = 0) Creates a new instance of the associated document class. If you have not supplied a wxClassInfo parameter to the template constructor, you will need to override this function to return an appropriate document instance. This function calls wxDocTemplate::InitDocument which in turns calls wxDocument::OnCreate. .SS wxView * CreateView (wxDocument *doclong flags = 0) Creates a new instance of the associated view class. If you have not supplied a wxClassInfo parameter to the template constructor, you will need to override this function to return an appropriate view instance. .SS wxString GetDefaultExtension () Returns the default file extension for the document data, as passed to the document template constructor. .SS wxString GetDescription () Returns the text description of this template, as passed to the document template constructor. .SS wxString GetDirectory () Returns the default directory, as passed to the document template constructor. .SS wxDocManager * GetDocumentManager () Returns a pointer to the document manager instance for which this template was created. .SS wxString GetDocumentName () Returns the document type name, as passed to the document template constructor. .SS wxString GetFileFilter () Returns the file filter, as passed to the document template constructor. .SS long GetFlags () Returns the flags, as passed to the document template constructor. .SS wxString GetViewName () Returns the view type name, as passed to the document template constructor. .SS bool InitDocument (wxDocument* docconst wxString& pathlong flags = 0) Initialises the document, calling wxDocument::OnCreate. This is called from wxDocTemplate::CreateDocument. .SS bool IsVisible () Returns true if the document template can be shown in user dialogs, false otherwise. .SS void SetDefaultExtension (const wxString& ext) Sets the default file extension. .SS void SetDescription (const wxString& descr) Sets the template description. .SS void SetDirectory (const wxString& dir) Sets the default directory. .SS void SetDocumentManager (wxDocManager *manager) Sets the pointer to the document manager instance for which this template was created. Should not be called by the application. .SS void SetFileFilter (const wxString& filter) Sets the file filter. .SS void SetFlags (long flags) Sets the internal document template flags (see the constructor description for more details). .SH "SEE ALSO" wxObject wxDocTemplate overview wxDocument wxView .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.