wxdoctemplatethe 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_defaultextwxstring m_defaultext the default extension for files of this type.
wxdoctemplate::m_descriptionwxstring m_description a short description of this template.
wxdoctemplate::m_directorywxstring m_directory the default directory for files of this type.
wxdoctemplate::m_docclassinfowxclassinfo* m_docclassinfo run-time class information that allows document instances to be constructed dynamically.
wxdoctemplate::m_doctypenamewxstring m_doctypename the named type of the document associated with this template.
wxdoctemplate::m_documentmanagerwxdoctemplate* m_documentmanager a pointer to the document manager for which this template was created.
wxdoctemplate::m_filefilterwxstring m_filefilter the file filter (such as *.txt) to be used in file selector dialogs.
wxdoctemplate::m_flagslong m_flags the flags passed to the constructor.
wxdoctemplate::m_viewclassinfowxclassinfo* m_viewclassinfo run-time class information that allows view instances to be constructed dynamically.
wxdoctemplate::m_viewtypenamewxstring m_viewtypename the named type of the view associated with this template.
wxdoctemplate::wxdoctemplatewxdoctemplate(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):
wxdoctemplate::~wxdoctemplatevoid ~wxdoctemplate() destructor.
wxdoctemplate::createdocumentwxdocument * 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.
wxdoctemplate::createviewwxview * 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.
wxdoctemplate::getdefaultextensionwxstring getdefaultextension() returns the default file extension for the document data, as passed to the document template constructor.
wxdoctemplate::getdescriptionwxstring getdescription() returns the text description of this template, as passed to the document template constructor.
wxdoctemplate::getdirectorywxstring getdirectory() returns the default directory, as passed to the document template constructor.
wxdoctemplate::getdocumentmanagerwxdocmanager * getdocumentmanager() returns a pointer to the document manager instance for which this template was created.
wxdoctemplate::getdocumentnamewxstring getdocumentname() returns the document type name, as passed to the document template constructor.
wxdoctemplate::getfilefilterwxstring getfilefilter() returns the file filter, as passed to the document template constructor.
wxdoctemplate::getflagslong getflags() returns the flags, as passed to the document template constructor.
wxdoctemplate::getviewnamewxstring getviewname() returns the view type name, as passed to the document template constructor.
wxdoctemplate::initdocumentbool initdocument(wxdocument* doc, const wxstring& path, long flags = 0) initialises the document, calling wxdocument::oncreate. this is called from wxdoctemplate::createdocument.
wxdoctemplate::isvisiblebool isvisible() returns true if the document template can be shown in user dialogs, false otherwise.
wxdoctemplate::setdefaultextensionvoid setdefaultextension(const wxstring& ext) sets the default file extension.
wxdoctemplate::setdescriptionvoid setdescription(const wxstring& descr) sets the template description.
wxdoctemplate::setdirectoryvoid setdirectory(const wxstring& dir) sets the default directory.
wxdoctemplate::setdocumentmanagervoid setdocumentmanager(wxdocmanager *manager) sets the pointer to the document manager instance for which this template was created. should not be called by the application.
wxdoctemplate::setfilefiltervoid setfilefilter(const wxstring& filter) sets the file filter.
wxdoctemplate::setflagsvoid setflags(long flags) sets the internal document template flags (see the constructor description for more details).
|