$szTitle = "wxdoctemplate"; include "./_header.inc"; ?>
the wxdoctemplate class is used to model the relationship between a document class and a view class.
derived from
include files
<wx/docview.h>
see also
wxdoctemplate overview, wxdocument, wxview
members
wxdoctemplate::m_defaultext
wxdoctemplate::m_description
wxdoctemplate::m_directory
wxdoctemplate::m_docclassinfo
wxdoctemplate::m_doctypename
wxdoctemplate::m_documentmanager
wxdoctemplate::m_filefilter
wxdoctemplate::m_flags
wxdoctemplate::m_viewclassinfo
wxdoctemplate::m_viewtypename
wxdoctemplate::wxdoctemplate
wxdoctemplate::~wxdoctemplate
wxdoctemplate::createdocument
wxdoctemplate::createview
wxdoctemplate::getdefaultextension
wxdoctemplate::getdescription
wxdoctemplate::getdirectory
wxdoctemplate::getdocumentmanager
wxdoctemplate::getdocumentname
wxdoctemplate::getfilefilter
wxdoctemplate::getflags
wxdoctemplate::getviewname
wxdoctemplate::initdocument
wxdoctemplate::isvisible
wxdoctemplate::setdefaultextension
wxdoctemplate::setdescription
wxdoctemplate::setdirectory
wxdoctemplate::setdocumentmanager
wxdoctemplate::setfilefilter
wxdoctemplate::setflags
wxstring m_defaultext
the default extension for files of this type.
wxstring m_description
a short description of this template.
wxstring m_directory
the default directory for files of this type.
wxclassinfo* m_docclassinfo
run-time class information that allows document instances to be constructed dynamically.
wxstring m_doctypename
the named type of the document associated with this template.
wxdoctemplate* m_documentmanager
a pointer to the document manager for which this template was created.
wxstring m_filefilter
the file filter (such as *.txt) to be used in file selector dialogs.
long m_flags
the flags passed to the constructor.
wxclassinfo* m_viewclassinfo
run-time class information that allows view instances to be constructed dynamically.
wxstring m_viewtypename
the named type of the view associated with this template.
wxdoctemplate(wxdocmanager* manager, const wxstring& descr, const wxstring& filter, const wxstring& dir, const wxstring& ext, const wxstring& doctypename, const wxstring& viewtypename, wxclassinfo* docclassinfo = null, wxclassinfo* viewclassinfo = null, long 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:
wxperl note: in wxperl docclassinfo and viewclassinfo can be either wx::classinfo objects or strings which contain the name of the perl packages which are to be used as wx::document and wx::view classes (they must have a constructor named new):
wx::doctemplate->new( docmgr, descr, filter, dir, ext, doctypename, viewtypename, docclassinfo, viewclassinfo, flags ) | will construct document and view objects from the class information |
wx::doctemplate->new( docmgr, descr, filter, dir, ext, doctypename, viewtypename, docclassname, viewclassname, flags ) | will construct document and view objects from perl packages |
wx::doctemplate->new( docmgr, descr, filter, dir, ext, doctypename, viewtypename ) | wx::doctemplate::createdocument() and wx::doctemplate::createview() must be overridden |
void ~wxdoctemplate()
destructor.
wxdocument * createdocument(const wxstring& path, long 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.
wxview * createview(wxdocument *doc, long 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.
wxstring getdefaultextension()
returns the default file extension for the document data, as passed to the document template constructor.
wxstring getdescription()
returns the text description of this template, as passed to the document template constructor.
wxstring getdirectory()
returns the default directory, as passed to the document template constructor.
wxdocmanager * getdocumentmanager()
returns a pointer to the document manager instance for which this template was created.
wxstring getdocumentname()
returns the document type name, as passed to the document template constructor.
wxstring getfilefilter()
returns the file filter, as passed to the document template constructor.
long getflags()
returns the flags, as passed to the document template constructor.
wxstring getviewname()
returns the view type name, as passed to the document template constructor.
bool initdocument(wxdocument* doc, const wxstring& path, long flags = 0)
initialises the document, calling wxdocument::oncreate. this is called from wxdoctemplate::createdocument.
bool isvisible()
returns true if the document template can be shown in user dialogs, false otherwise.
void setdefaultextension(const wxstring& ext)
sets the default file extension.
void setdescription(const wxstring& descr)
sets the template description.
void setdirectory(const wxstring& dir)
sets the default directory.
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.
void setfilefilter(const wxstring& filter)
sets the file filter.
void setflags(long flags)
sets the internal document template flags (see the constructor description for more details).
include "./_footer.inc"; ?>